Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ItemTestItem extends Item{
- public ItemTestItem(){
- super();
- setUnlocalizedName("testItem");
- GiveTexture.GiveItemTexture(this);
- setCreativeTab(testmod.testtab);
- }
- int counter = 0;
- @Override
- public boolean onEntityItemUpdate(EntityItem item){
- if(item.handleWaterMovement()) {
- EntitySquid squid = new EntitySquid(item.worldObj);
- counter++;
- if(counter >= 40){
- if(!item.worldObj.isRemote){
- if(item.worldObj.getBlock((int)item.posX, (int)item.posY -1, (int)item.posZ) == Blocks.lapis_block){
- squid.setPositionAndUpdate(item.posX, item.posY, item.posZ);
- item.worldObj.spawnEntityInWorld(squid);
- item.setDead();
- counter = 0;
- }
- }
- }
- return false;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment