diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 1730751171..06a4358669 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -312,6 +312,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Check if the fromWorld and toWorld are the same. if (fromWorld == toWorld) { + // Close any foreign inventory + if (getHandle().activeContainer != getHandle().defaultContainer){ + getHandle().closeInventory(); + } entity.netServerHandler.teleport(to); } else { server.getHandle().moveToWorld(entity, toWorld.dimension, true, to);