I'm trying to set the damage of a weapon to a variable

Started by Green_Warrior777 on

Topic category: Help with modding (Java Edition)

Last seen on 17:56, 11. Nov 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm trying to set the damage of a weapon to a variable

I want to set the damage of a weapon equivalent of how much of a certain item I have in my inventory but I can't find out how to set its value to a variable I keep getting errors

Last seen on 18:54, 23. Aug 2023
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Set it's default damage to 0…
Tue, 08/25/2020 - 03:56

Set it's default damage to 0 in its properties, then use a procedure to check when someone attacks with that item, then use the block, "deal (number) damage to (entity)", and set the number to whatever value you want depending on the factors you're using.