Posted May 18, 20169 yr I created a block. Now, if i drop an item on a block the tile entity have to do that: variable +=1. My code doesnt work. :'( pls help me code: public void onDrop(ItemTossEvent e){ if(e.getEntity().getEntityWorld().getBlockState(e.getEntityItem().getPosition().add(0, 1, 0)).getBlock() == ModBlocks.earth_totem || e.getEntity().getEntityWorld().getBlockState(e.getEntityItem().getPosition()).getBlock() == ModBlocks.earth_totem ){ Item item = e.getEntityItem().getEntityItem().getItem(); if(item == Items.glowstone_dust){ TileEntity te = e.getEntity().getEntityWorld().getTileEntity(e.getEntityItem().getPosition().add(0, -1, 0)); te.getTileData().setInteger("Power", te.getTileData().getInteger("Power") + 1); e.getEntity().getEntityWorld().removeEntity(e.getEntity()); } } }
May 18, 20169 yr Author I dont understand how this is implemented in the class hooper. How it capture the items?
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.