Guest User

Untitled

a guest
Jul 5th, 2014
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public class ItemTestItem extends Item{
  2.  
  3. public ItemTestItem(){
  4. super();
  5. setUnlocalizedName("testItem");
  6. GiveTexture.GiveItemTexture(this);
  7. setCreativeTab(testmod.testtab);
  8.  
  9.  
  10. }
  11.  
  12. int counter = 0;
  13. @Override
  14. public boolean onEntityItemUpdate(EntityItem item){
  15. if(item.handleWaterMovement()) {
  16. EntitySquid squid = new EntitySquid(item.worldObj);
  17. counter++;
  18. if(counter >= 40){
  19. if(!item.worldObj.isRemote){
  20. if(item.worldObj.getBlock((int)item.posX, (int)item.posY -1, (int)item.posZ) == Blocks.lapis_block){
  21. squid.setPositionAndUpdate(item.posX, item.posY, item.posZ);
  22. item.worldObj.spawnEntityInWorld(squid);
  23. item.setDead();
  24. counter = 0;
  25. }
  26.  
  27. }
  28. }
  29. return false;
  30. }
  31. return false;
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment