Paper
Paper copied to clipboard
Cant cancel properly ender dragon spawn with CreatureSpawnEvent
Expected behavior
After canceling the spawn of a dragon from CreatureSpawnEvent, a bossbar should not appear since the dragon's spawn is canceled Note: Nether portal is cancelled, only the end portal is not.
Observed/Actual behavior
After canceling the spawn of the CreatureSpawnEvent dragon, a boss bar appears, and the event is canceled (the dragon is not spawn but regardless a boss bar appears)
http://prntscr.com/121u9mc
Steps/models to reproduce
@EventHandler
protected void onDragonSpawn(CreatureSpawnEvent event) { if (event.getEntityType() == EntityType.ENDER_DRAGON && event.getLocation().getWorld().getEnvironment() == Environment.THE_END) { EnderDragon dragon = ((EnderDragon) event.getEntity());
dragon.getBossBar().removeAll();
dragon.getDragonBattle().generateEndPortal(false);
event.setCancelled(true);
}
}
Plugin list
FastAsyncWorldEdit-Bukkit-1.16-655 HolographicDisplays Multiverse-Core-4.2.2 ProtocolLib
Paper version
This server is running Paper version git-Paper-756 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT) You are running the latest version Previous version: git-Paper-a98d389d1 (MC: 1.16.5)
Agreements
- [X] I am running the latest version of Paper available from https://papermc.io/downloads.
- [X] I have searched for and ensured there isn't already an open issue regarding this.
- [X] My version of Minecraft is supported by Paper.
Other
No response
#5717
I am having the same issue - it seems Machine had a PR for this that was closed during the hardfork and never got updated? Idk if they'd be willing to update it, or if not I don't mind giving it a go myself if someone can confirm it's still (at least overall) the correct solution.