daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top