Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-276857

periodic_tick resets when an entity is transformed

XMLWordPrintable

    • 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:

      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
      2. Summon a pig with the command tag periodic_tick_test with this command:
        summon pig ~ ~ ~ {Tags:["periodic_tick_test"]}
      3. 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.

            Unassigned Unassigned
            Deoxyribonucleic Evans DorkOrc
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: