How to deal Custom Damage with variable value?

Started by vinicius0910 on

Topic category: Help with MCreator software

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to deal Custom Damage with variable value?

I'm trying to make custom damage with variable value when player attack entities, but it doesn't seens to work

 

https://prnt.sc/t2gBOBQVInpn

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
#1 - question - what do you…
Thu, 08/03/2023 - 22:49

#1 - question - what do you have global "physical" set as? If it's set as 0... 0 * 3 = 0, so it would not cause damage

#2 - suggestion - you may want to add a "cancel event that triggered global trigger" located under "advanced" that way it doesn't cause base damage on top of custom damage.

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i tried this but it still…
Mon, 08/07/2023 - 02:48

i tried this but it still doesn't work

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know what your problem is…
Fri, 08/11/2023 - 13:55

I know what your problem is.

 

Variables used globally cannot define mob entities. I've tried it before in previous mods I've made, and it just doesn't work no matter what I've tried. Try using the Entity NBT number tags instead: they will affect mobs and players both, but it won't be able to permanently store the value, so I would recommend a separate global function that gives the values if Physical relies on "PLAYER_PERSISTENT"