jh62 Posted August 31, 2013 Posted August 31, 2013 Hello. I've searched through the forum, but the search engine is terrible (or is just messed up in my browser i don't know), but the thing is that i couldn't find a proper answer. I've managed to drop an item at the player's feet with par5EntityPlayer.dropItem()...., but if I play on an actual dedicated server the item is duplicated and I can't pick it up, I've tried use isremote && !isremote but i can't pick the item. It seems out of sync or something. How would I go about dropping an item in a dedicated server??? NOTE: I'm using minecraft 1.4.7 Quote
hydroflame Posted August 31, 2013 Posted August 31, 2013 dedi/integrated is the same thing can we have code or something ? Quote how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
jh62 Posted August 31, 2013 Author Posted August 31, 2013 On 8/31/2013 at 5:04 PM, hydroflame said: dedi/integrated is the same thing can we have code or something ? I don't know... it seems to be working now... It's weird because sometimes works right away, sometimes you have to use the item a few times in order for the code to work properly: boolean flushed = false; long start = System.currentTimeMillis(); ItemStack drop; @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (drop == null) { if (par5EntityPlayer.getCurrentEquippedItem() == null) { System.out.println("DROP NULL"); par5EntityPlayer.sendChatToPlayer("DROP NULL"); return true; } } if (par5EntityPlayer.worldObj.isRemote) { System.out.println("CLIENT"); par5EntityPlayer.sendChatToPlayer("CLIENT"); return true; } long end = System.currentTimeMillis(); if (!flushed) { flushed = true; drop = par5EntityPlayer.getCurrentEquippedItem().copy(); par5EntityPlayer.destroyCurrentEquippedItem(); if (!par5EntityPlayer.worldObj.isRemote) par1World.playSoundEffect(par2, par3, par4, "pablisMod.flush", 1.0f, 1.0f); } else { if (end - start > 3000) { flushed = false; start = System.currentTimeMillis(); drop = null; } else { if (drop != null) { par5EntityPlayer.entityDropItem(drop, 1); drop = null; System.out.println("DROPPING"); par5EntityPlayer.sendChatToPlayer("DROPPING"); } par1World.playSoundEffect(par2, par3, par4, "random.click", 0.3F, 0.6F); } } return true; } and I noticed that if I use dropItem instead of EntityDropItem the drop never drops... Quote
Recommended Posts
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.