-
Bug
-
Resolution: Won't Fix
-
None
-
1.21.1, 24w38a
-
Confirmed
-
(Unassigned)
When an entity is transformed into another entity type (e.g. a pig struck by lightning is turned into a zombified piglin), a periodic_tick predicate will reset, causing a blip in timing-related code.
Steps to reproduce:
- Place and power a repeating command block with this command in it:
execute as @e[tag=periodic_tick_test] if predicate {condition:"entity_properties",entity:"this",predicate:{periodic_tick:1000}} run say Hello
- Summon a pig with the command tag periodic_tick_test with this command:
summon pig ~ ~ ~ {Tags:["periodic_tick_test"]}
- Shortly after that, summon a lightning_bolt entity at pig's position with this command:
execute at @n[tag=periodic_tick_test] run summon lightning_bolt
Observed Results
- The pig says "Hello" once when it is spawned and then once every 50 seconds after that.
- When the lightning bolt is summoned, the Zombified Piglin it gets converted into immediately says "Hello" when the lightning strike occurs, regardless of the time between the last time the pig said "Hello" and then.
Expected Results
The time between the pig/zombified piglin saying "Hello" should remain consistent, even if a transformation happens during that period.
This is likely due to the data relating to an entity's "age" in memory not being transferred to the entity it gets transformed into.