diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index 50835358ff..f77ea7cf29 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -662,7 +662,12 @@ public abstract class EntityHuman extends EntityLiving { if (this.getBukkitEntity() instanceof Player) { Player player = (Player) this.getBukkitEntity(); CraftServer server = ((WorldServer) world).getServer(); - org.bukkit.block.Block bed = ((WorldServer) world).getWorld().getBlockAt(this.b.a, this.b.b, this.b.c); + org.bukkit.block.Block bed; + if (chunkcoordinates != null) { + bed = ((WorldServer) world).getWorld().getBlockAt(chunkcoordinates.a, chunkcoordinates.b, chunkcoordinates.c); + } else { + bed = ((WorldServer) world).getWorld().getBlockAt(player.getLocation()); + } PlayerBedLeaveEvent event = new PlayerBedLeaveEvent(player, bed); server.getPluginManager().callEvent(event); }