mojira.dev
MC-276857

periodic_tick resets when an entity is transformed

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:

  1. 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{\code}
    # Summon a pig with the command tag {{periodic_tick_test}} with this command:
    execute as @e[tag=periodic_tick_test] if predicate {condition:"entity_properties",entity:"this",predicate:{periodic_tick:1000}} run say Hello{\code}
    # Summon a pig with the command tag {{periodic_tick_test}} with this command:

    summon pig ~ ~ ~ {Tags:["periodic_tick_test"]}{\code}

  2. 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{\code}

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.

Attachments

Comments 2

Thank you for your report!
After consideration, the issue is being closed as Won't Fix.

Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

DorkOrc

(Unassigned)

Confirmed

(Unassigned)

entity_properties, periodic_tick, predicate

1.21.1, 24w38a

Retrieved