Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8]Dropping item into world?


Atijaf
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.