Posted September 23, 20159 yr EntityItem droppedItem = new EntityItem(player.worldObj, player.lastTickPosX, player.lastTickPosY + 2, player.lastTickPosZ, stack.copy()); player.worldObj.spawnEntityInWorld(droppedItem); There is obviously something wrong with my code, because it isn't working. I'm just unable to find it... Any help will be great.
September 23, 20159 yr Author From inside a class that implements IInventory. The method is called on both Server and client. As for player.lastTickPos, I've noticed that sometimes "player.playerLocation" or "player.posX" is null.
September 24, 20159 yr Author Thanks! I made sure to only run it on server side. It's working now, but basically... I have a TileEntity that stores ItemStacks. The amount it stores can vary, so if the container is full and the amount it can store is decreased, it checks if it can place the items that it can no longer stored, can be placed into the player's inventory. If not, spawn EntityItem below player. Unfortunately, when in creative mode, it always says the player has inventory space, even when he doesn't. So yeah. Don't test in creative mode. haha. Thanks for the help!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.