Guest User

Untitled

a guest
Aug 2nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. package com.mod.drakania.dynamite;
  2.  
  3. import net.minecraft.creativetab.CreativeTabs;
  4. import net.minecraft.entity.player.EntityPlayer;
  5. import net.minecraft.entity.projectile.EntitySnowball;
  6. import net.minecraft.item.Item;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.world.World;
  9.  
  10. public class dynamite extends Item
  11. {
  12. public dynamite()
  13. {
  14. this.maxStackSize = 16;
  15.  
  16. }
  17. public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
  18. {
  19. if (!player.capabilities.isCreativeMode)
  20. {
  21. --stack.stackSize;
  22. }
  23.  
  24. world.playSoundAtEntity(player, "PrimedTNT", 1F, 1F / (itemRand.nextFloat() * 1F + 1F));
  25.  
  26. if (!world.isRemote)
  27. {
  28. world.spawnEntityInWorld(new EntityDynamite(world, player));
  29. }
  30.  
  31. return stack;
  32. }
  33. }
Add Comment
Please, Sign In to add comment