Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //String namE = "blessedPick";
- String toggle = "Enabled";
- //adds tooltip(duh?)
- @Override
- public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced)
- {
- tooltip.add("Right Click " + toggle);
- }
- @Override
- public void onUpdate(ItemStack itemstack, World world, Entity entity, int metadata, boolean bool)
- {
- if (itemstack.getTagCompound() == null)
- {
- itemstack.setTagCompound(new NBTTagCompound());
- String toggle = "Enabled";
- itemstack.getTagCompound().setBoolean("state", true);
- }
- /*
- if(itemstack.getTagCompound().getBoolean("state")==true)
- {
- String namE = "blessedPick";
- }
- if(itemstack.getTagCompound().getBoolean("state")==false)
- {
- String namE = "blessedPick1";
- String toggle = "Disabled";
- }
- */
- }
- //So when you hold right click you get haste, last 1 second after clicking
- @Override
- public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer player)
- {
- if(!worldIn.isRemote)
- {
- if(player.isSneaking())
- {
- if(itemStackIn.getTagCompound().getBoolean("state")==true)
- {
- itemStackIn.getTagCompound().setBoolean("state", false);
- }
- if(itemStackIn.getTagCompound().getBoolean("state")==false)
- {
- itemStackIn.getTagCompound().setBoolean("state", true);
- }
- }
- if(!player.isSneaking())
- {
- if(itemStackIn.getTagCompound().getBoolean("state")==true)
- {
- player.addPotionEffect((new PotionEffect(Potion.digSpeed.getId(), 400, 1)));
- player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 300, 1)));
- player.addPotionEffect((new PotionEffect(Potion.fireResistance.getId(), 60, 1)));
- itemStackIn.damageItem(5, player);
- }
- }
- }
- return itemStackIn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement