[GH-ISSUE #7602] Negative integer InLove values are clamped when writing entity NBT #3298

Open
opened 2026-11-03 04:07:21 +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/7602

Originally assigned to: @TheMrZZ on GitHub.

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

The animal NBT writer clamps negative InLove values to zero, although the loader preserves the signed integer and Java 26.3 writes it directly.

With ticks frozen in a loaded area:

/summon pig 4 200 4 {Tags:["h056"],NoAI:1b,NoGravity:1b,InLove:-1}
/data get entity @e[tag=h056,limit=1] InLove

Java reports -1; Horizon reports 0. The same mismatch occurs for integer -32769, -32768, -129 and -128, and byte -1b and -128b. Zero, positive values and remove/default behavior are controls.

Official Animal.addAdditionalSaveData writes inLove directly with putInt; readAdditionalSaveData uses getIntOr("InLove",0). Current main's entity_nbt writer uses extra.in_love.max(0).

Scope: signed integer field serialization only. Floating numeric conversion, LoveCause, age ticking and breeding behavior are separate. Closed #1396 addressed positive breeding readiness persistence.

Originally created by @TheMrZZ on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7602 Originally assigned to: @TheMrZZ on GitHub. > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. The animal NBT writer clamps negative InLove values to zero, although the loader preserves the signed integer and Java 26.3 writes it directly. With ticks frozen in a loaded area: ``` /summon pig 4 200 4 {Tags:["h056"],NoAI:1b,NoGravity:1b,InLove:-1} /data get entity @e[tag=h056,limit=1] InLove ``` Java reports -1; Horizon reports 0. The same mismatch occurs for integer -32769, -32768, -129 and -128, and byte -1b and -128b. Zero, positive values and remove/default behavior are controls. Official Animal.addAdditionalSaveData writes inLove directly with putInt; readAdditionalSaveData uses getIntOr("InLove",0). Current main's entity_nbt writer uses extra.in_love.max(0). Scope: signed integer field serialization only. Floating numeric conversion, LoveCause, age ticking and breeding behavior are separate. Closed #1396 addressed positive breeding readiness persistence.
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6584466994 --> @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#3298
No description provided.