[Deal damage to entity from source:] Doesn't work, Attributes don't work

Started by Grinprim on

Topic category: Help with modding (Java Edition)

Last seen on 20:21, 27. Jun 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Deal damage to entity from source:] Doesn't work, Attributes don't work
Sat, 06/22/2024 - 19:00 (edited)

So I created a weapon that levels up its damage based on the number of kills you get. However, no matter what I try, it doesn't seem to work. Here's what I've tried so far:

Adding and Removing Damage Attributes [Attribute plugin]:
I tried adding generic.attack_damage to the weapon and then removing it before re-adding a stronger one with the same UUID.

Example:
- Level 1: +1 generic.attack_damage
- Level 2: +2 generic.attack_damage

However, it either adds the strongest one or combines all the previous ones, even though I remove the previous attribute first.

Using Triggers:
I used the trigger "Before entity is Hurt" to check if the item causing damage is the weapon. Inside that check, I verify the weapon's level and then add "Deal [ ] damage to [Event/Target entity] from source: [ ]". This approach didn't work either.

Problem:
I want to add damage to a weapon dynamically, similar to creating a new weapon with different damage values for each level, but without actually creating multiple weapons. For example, instead of creating 10 different weapons for 10 levels, I want a single weapon that handles all levels.

Working Part:
The levelling system itself works because it adds enchantments correctly at each level (e.g., sharpness 1 at level 1 and up to sharpness 10 at level 10).

Questions:
Are there any bugs with the "Deal Damage" function?
Is it possible to directly change a weapon's damage attribute dynamically without creating a new weapon each time?

Edited by Grinprim on Sat, 06/22/2024 - 19:00
Last seen on 17:56, 27. Jun 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
do you use attributes plugin…
Sat, 06/22/2024 - 18:43

do you use attributes plugin for it?

Last seen on 20:21, 27. Jun 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes, i have used it and i am…
Sat, 06/22/2024 - 18:52

Yes, i have used it and i am still using it but it doesn't want to work properly

Last seen on 17:56, 27. Jun 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
use variables to count kills…
Sat, 06/22/2024 - 19:55

use variables to count kills then use variable for modifier number

Last seen on 17:56, 27. Jun 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
item's nbt variable*
Sat, 06/22/2024 - 19:56

item's nbt variable*

Last seen on 17:56, 27. Jun 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also use deprecated…
Sat, 06/22/2024 - 19:58

also use deprecated procedure blocks for items from attribute plugin

Last seen on 20:21, 27. Jun 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have tried all of that…
Sat, 06/22/2024 - 22:17

I have tried all of that already and it didnt work. i will post it here if i find a fix or idk what else