Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. public class ItemPoisonSword extends ItemSword {
  2.     public ItemDumbSword(ToolMaterial materialIn) {
  3.         super(materialIn);
  4.         setRegistryName("item_poison_sword");
  5.         this.setUnlocalizedName("poison_sword");
  6.         setCreativeTab(CreativeTabs.COMBAT);
  7.     }
  8.  
  9.     public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
  10.     {
  11.         stack.damageItem(1, attacker); //The first number is how much damage you do, probably more than 1.
  12.         attacker.sendMessage(new TextComponentString("hitEntity Method Called"));
  13.         target.addPotionEffect(new PotionEffect(Potion.getPotionById(10), 100, 3)); //The 10 is the ID of poison, the 100 is duration and 3 is how much it's amplified by.
  14.         return true;
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement