[SPIGOT-7997] Cancelling EntityTransformEvent does not reset StrayConversionTime Created: 19/Jan/25  Updated: 20/Jan/25  Resolved: 20/Jan/25

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Asteraoth Assignee: Doc
Resolution: Fixed Votes: 0
Labels: None

Version: 4426-Spigot-aa7842e-8da2a0a (MC: 1.21.4) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

If a plugin cancels the EntityTransformEvent event, the StrayConversionTime nbt will not reset.

How to reproduce:

  1. Run a test plugin with the following code:
    @EventHandler
    public void onEliteTransform(EntityTransformEvent event) {
        Bukkit.getLogger().info("Cancelled EntityTransformEvent");
        event.setCancelled(true);
    }
    
  2. Spawn a skeleton in Powder Snow block (make sure the skeleton cannot move).
  3. Run this command to speed up the conversion:
    /data merge entity @e[type=minecraft:skeleton,sort=nearest,limit=1] {StrayConversionTime:10}
    
  4. Keep checking the StrayConversionTime nbt with this command:
    /data get entity @e[type=skeleton,sort=nearest,limit=1] StrayConversionTime
    

Observed Results:
The StrayConversionTime nbt is not resetting. This causes the Skeleton to spam entity.skeleton.converted_to_stray sound and EntityTransformEvent (look in the console "Cancelled EntityTransformEvent").

Expected Results:
The StrayConversionTime nbt is reset properly to match Zombies with DrownedConversionTime nbt. Command to test Zombies when their heads are in water:

/data get entity @e[type=zombie,sort=nearest,limit=1] DrownedConversionTime


 Comments   
Comment by Doc [ 19/Jan/25 ]

PR created for that: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1532/overview

Generated at Sun Mar 30 02:41:55 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.