diff --git a/src/main/resources/assets/carpet/scripts/ai_tracker.sc b/src/main/resources/assets/carpet/scripts/ai_tracker.sc index c7ee3db8..d92c7c7d 100644 --- a/src/main/resources/assets/carpet/scripts/ai_tracker.sc +++ b/src/main/resources/assets/carpet/scripts/ai_tracker.sc @@ -319,6 +319,28 @@ global_functions = { null ] }, + + 'drowning' -> { + 'zombie' -> [ + _(arg) -> _(entity) -> ( + w = query(entity, 'width')/2; + e = query(entity, 'eye_height'); + from = [-w, e-0.111,-w]; + to = [w, e-0.111, w]; + data = query(entity, 'nbt'); + iwt = data:'InWaterTime'; + messages = if( + 0 < iwt < 600, + [['drown','drowning in:', 600-iwt]], + dt = data:'DrownedConversionTime'; dt > 0, + [['drown','drowned in:', dt]], + []); + [[ ['box', global_duration, 'from', from, 'to', to, 'follow', entity, 'color', 0x00bbbbff, 'fill', 0x00bbbb22]],[],messages], + ) + , + null + ] + } }; global_hostile_to_villager = { @@ -348,7 +370,7 @@ __config() ->{ 'transparency '->_(alpha)->global_opacity = alpha }, 'arguments'->{ - 'display'->{'type'->'term','options'->['item_pickup','velocity','portal_cooldown','health','pathfinding','xpstack']}, + 'display'->{'type'->'term','options'->['item_pickup','velocity','portal_cooldown','health','pathfinding','xpstack','drowning']}, 'aspect'->{'type'->'term','options'->['iron_golem_spawning','buddy_detection','hostile_detection','breeding']}, 'ticks'->{'type'->'int','min'->0,'max'->100}, 'alpha'->{'type'->'int','min'->0,'max'->255},