Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TestDiamondToss {
- @SubscribeEvent
- public void diamondDropped(ItemTossEvent e){
- Time t = new Time();
- World world = e.player.getEntityWorld();
- int x,y,z;
- x = (int) e.entityItem.posX;
- y = (int) e.entityItem.posY;
- z = (int) e.entityItem.posZ;
- if(e.entityItem.getEntityItem().getItem() == Items.diamond){
- System.out.println("Item detected");
- if(world.getBlock(x, y, z) == Blocks.water){
- System.out.println("Item is water");
- e.entityItem.dropItem(testmod.testitem, 1);
- e.entityItem.setDead();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment