Guest User

Untitled

a guest
Jul 4th, 2014
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public class TestDiamondToss {
  2.  
  3. @SubscribeEvent
  4. public void diamondDropped(ItemTossEvent e){
  5. Time t = new Time();
  6. World world = e.player.getEntityWorld();
  7. int x,y,z;
  8. x = (int) e.entityItem.posX;
  9. y = (int) e.entityItem.posY;
  10. z = (int) e.entityItem.posZ;
  11.  
  12.  
  13. if(e.entityItem.getEntityItem().getItem() == Items.diamond){
  14. System.out.println("Item detected");
  15. if(world.getBlock(x, y, z) == Blocks.water){
  16. System.out.println("Item is water");
  17. e.entityItem.dropItem(testmod.testitem, 1);
  18. e.entityItem.setDead();
  19.  
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment