--- a/net/minecraft/server/bossevents/CustomBossEvent.java +++ b/net/minecraft/server/bossevents/CustomBossEvent.java @@ -18,6 +18,10 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.util.Mth; import net.minecraft.world.BossEvent; +// CraftBukkit start +import org.bukkit.boss.KeyedBossBar; +import org.bukkit.craftbukkit.boss.CraftKeyedBossbar; +// CraftBukkit end public class CustomBossEvent extends ServerBossEvent { @@ -25,7 +29,17 @@ private final Set players = Sets.newHashSet(); private int value; private int max = 100; + // CraftBukkit start + private KeyedBossBar bossBar; + public KeyedBossBar getBukkitEntity() { + if (this.bossBar == null) { + this.bossBar = new CraftKeyedBossbar(this); + } + return this.bossBar; + } + // CraftBukkit end + public CustomBossEvent(ResourceLocation id, Component displayName) { super(displayName, BossEvent.BossBarColor.WHITE, BossEvent.BossBarOverlay.PROGRESS); this.id = id;