use of net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving in project FireAPI by FireBlade-Serv.
the class FireBossBar method gen.
public void gen(String title) {
EntityEnderDragon ew = new EntityEnderDragon(((CraftWorld) this.p.getWorld()).getHandle());
Location loc = this.p.getLocation();
ew.setInvisible(true);
ew.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getPitch(), loc.getYaw());
ew.setCustomName(title);
PacketPlayOutSpawnEntityLiving pel = new PacketPlayOutSpawnEntityLiving(ew);
((CraftPlayer) this.p).getHandle().playerConnection.sendPacket(pel);
}
use of net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving in project Denizen-For-Bukkit by DenizenScript.
the class BossBar_v1_8_R3 method showBossBar.
public static void showBossBar(Player player, String text, int health) {
wither.setCustomName(text);
wither.setHealth(health);
Location location = player.getLocation().clone();
location.add(player.getLocation().getDirection().multiply(30));
wither.setPosition(location.getX(), location.getY(), location.getZ());
PacketHelper_v1_8_R3.sendPacket(player, new PacketPlayOutSpawnEntityLiving(wither));
hasHealthBar.put(player.getName(), true);
playersWithHealthBar.add(player);
}
Aggregations