Related code can be found here on Pastebin. Demostration It's much easier to show what happens exactly, rather than typing it out in an attempt to explain. Conclution Note that this happens when you close the inventory in any way, such as teleporting the player which will automatically close their inventory. Point is, it's not just the player.closeInventory() function. I'm sure there's a simple way of solving this that I have missed out on while trying to fix the issue. Suggestions and/or fixes are much appreciated. Cheers in advance.