Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mod.drakania.dynamite;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.projectile.EntitySnowball;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.world.World;
- public class dynamite extends Item
- {
- public dynamite()
- {
- this.maxStackSize = 16;
- }
- public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
- {
- if (!player.capabilities.isCreativeMode)
- {
- --stack.stackSize;
- }
- world.playSoundAtEntity(player, "PrimedTNT", 1F, 1F / (itemRand.nextFloat() * 1F + 1F));
- if (!world.isRemote)
- {
- world.spawnEntityInWorld(new EntityDynamite(world, player));
- }
- return stack;
- }
- }
Add Comment
Please, Sign In to add comment