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

Started by Green_Warrior777 on

Topic category: Help with Minecraft modding (Java Edition)

Active 4 years ago
Joined Jul 2020
Points:
625

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
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

Active 1 month ago
Joined Jun 2020
Points:
712

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 1
  • Comments: 137
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.