Jump to content

notdeadbro

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by notdeadbro

  1. public void itemAttributeModifier(ItemAttributeModifierEvent event) { ItemStack stack = event.getItemStack(); Item item = stack.getItem(); if (item == Items.DIAMOND_SWORD) { stack.addAttributeModifier(Attributes.ATTACK_DAMAGE, new AttributeModifier("damage", 1.0D, AttributeModifier.Operation.MULTIPLY_BASE), EquipmentSlotType.MAINHAND); } } It continues to call the addAttributeModifier infinitely. In game, the tooltip ends up just overflowing with attribute modifiers.
  2. Also, a side note, is anyone aware of why the diamond sword is not getting its updated tooltip? Here's my code:
  3. Well, I'm not sure if I'm being stupid, but the ItemAttributeModifierEvent is obviously an event executed every tick, so it just adds the attribute modifier over and over again.
  4. Sorry for late reply, but is there a way to specifically set the item's attack damage with this? I see that you can use addAttributeModifier but that is not as practical, especially for my case.
  5. Would this change the damage value of the sword that is displayed in the tooltip as well? Like this: I want to literally be able to change its attack damage value.
  6. I want to be able to change how much damage the diamond sword does in my mod. I know that I need to use reflections to accomplish this, but I'm not sure exactly how, and I've been trying for hours. Can someone possibly tell me how to write a reflection that can do this? I'm aware that this is not a Java school but this is my last resort.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.