[GH-ISSUE #7823] Saved InWaterTime ignores whether zombie eyes are in water #4607

Open
opened 2026-11-03 05:05:14 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @TheMrZZ on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7823

Originally assigned to: @TheMrZZ on GitHub.

🤖 Filed by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

InWaterTime saves the supplied raw counter even when a zombie's eyes are not in water. Java 26.3's ConversionTracker.addAdditionalSaveData writes the affliction time only when isAfflicted is true, otherwise -1. Zombie supplies isEyeInFluid(WATER) as that predicate.

In a fresh isolated loaded area, freeze ticks, prepare a floor at Y=199, and clear Y=200..206. Summon:

summon zombie 10.5 200 10.5 {Tags:["subject"],NoAI:1b,NoGravity:1b,Silent:1b,InWaterTime:37,DrownedConversionTime:12}

Read InWaterTime, DrownedConversionTime and Pos before advancing ticks, after two ticks, and after two more ticks. Repeat in four fresh scenes:

Scene Water Java InWaterTime at ticks 0 / 2 / 4
Dry none -1 / -1 / -1
Feet only fill 9 200 9 11 200 11 water -1 / -1 / -1
Submerged fill 9 200 9 11 202 11 water -1 / 37 / 37
Water removed same submerged setup; clear water after tick 2 -1 / 37 / -1

Horizon keeps 37 at every boundary. The conversion counter remains 12 and the position stays unchanged on both servers. At tick 0 even the submerged zombie's cached eye-fluid state has not updated, so querying world water directly while saving would also be wrong. Feet-only water distinguishes eye immersion from body immersion.

The dry case also affects husks, drowned, zombie villagers and zombified piglins. Current entity_nbt::mob_to_nbt preserves InWaterTime through map.entry(...).or_insert(...) without applying the live predicate. The existing codec test sets counters without fluid state.

Scope: the saved live predicate, with raw supplied counters and live fluid-state controls. Conversion/countdown behavior, general counter defaults, packets and reload behavior are separate.

🤖 Generated with Codex

Originally created by @TheMrZZ on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7823 Originally assigned to: @TheMrZZ on GitHub. > 🤖 Filed by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. `InWaterTime` saves the supplied raw counter even when a zombie's eyes are not in water. Java 26.3's `ConversionTracker.addAdditionalSaveData` writes the affliction time only when `isAfflicted` is true, otherwise `-1`. Zombie supplies `isEyeInFluid(WATER)` as that predicate. In a fresh isolated loaded area, freeze ticks, prepare a floor at Y=199, and clear Y=200..206. Summon: ```mcfunction summon zombie 10.5 200 10.5 {Tags:["subject"],NoAI:1b,NoGravity:1b,Silent:1b,InWaterTime:37,DrownedConversionTime:12} ``` Read `InWaterTime`, `DrownedConversionTime` and `Pos` before advancing ticks, after two ticks, and after two more ticks. Repeat in four fresh scenes: | Scene | Water | Java InWaterTime at ticks 0 / 2 / 4 | | --- | --- | --- | | Dry | none | -1 / -1 / -1 | | Feet only | fill 9 200 9 11 200 11 water | -1 / -1 / -1 | | Submerged | fill 9 200 9 11 202 11 water | -1 / 37 / 37 | | Water removed | same submerged setup; clear water after tick 2 | -1 / 37 / -1 | Horizon keeps 37 at every boundary. The conversion counter remains 12 and the position stays unchanged on both servers. At tick 0 even the submerged zombie's cached eye-fluid state has not updated, so querying world water directly while saving would also be wrong. Feet-only water distinguishes eye immersion from body immersion. The dry case also affects husks, drowned, zombie villagers and zombified piglins. Current `entity_nbt::mob_to_nbt` preserves `InWaterTime` through `map.entry(...).or_insert(...)` without applying the live predicate. The existing codec test sets counters without fluid state. Scope: the saved live predicate, with raw supplied counters and live fluid-state controls. Conversion/countdown behavior, general counter defaults, packets and reload behavior are separate. 🤖 Generated with [Codex](https://openai.com/codex/)
Author
Owner

@TheMrZZ commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6589112095 --> @TheMrZZ commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4607
No description provided.