[SPIGOT-6726] NPE when calling getBossBar() on plugin spawned EnderDragon Created: 28/Aug/21  Updated: 28/Aug/21  Resolved: 28/Aug/21

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

Type: New Feature Priority: Minor
Reporter: Brokkonaut Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Version: 1.17.1
Guidelines Read: Yes

 Description   

Some EnderDragons may not have a dragonFight, so they do not have a bossbar.

 

Caused by: java.lang.NullPointerException: Cannot read field "k" because "this.handle" is null
at org.bukkit.craftbukkit.v1_17_R1.boss.CraftDragonBattle.getBossBar(CraftDragonBattle.java:29)
at org.bukkit.craftbukkit.v1_17_R1.entity.CraftEnderDragon.getBossBar(CraftEnderDragon.java:69)
at de.iani.security.commands.SpawnMobWithoutAI.spawnMob(SpawnMobWithoutAI.java:99)
at de.iani.security.commands.SpawnMobWithoutAI.onCommand(SpawnMobWithoutAI.java:68)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
... 21 more

 

PR: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/925/overview


Generated at Tue Apr 22 03:12:15 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.