#running commands when hurt [SOLVED]

1 messages · Page 1 of 1 (latest)

copper jacinth
#

I'm creating an add-on, somewhat similar to the origin mod

I've created a tag called fire that gives the player properties similar to a blaze and im trying to make all entities around it like on fire when it gets hurt
This is what i have as a component for the tag:
"minecraft:on_hurt":
"/execute at @a[tag=fire, r=5] at @e[tag=!fire,r=5] run setblock ~ ~ ~ fire"
but it doesn't seem to work, can anyone help me out?

#

just to be clear, if i open the game and run the command it lights things around me on fire, so the command isnt the problem

near bane
#

You'd need to use the minecraft:damage_sensor component. Something like:

        "minecraft:damage_sensor": {
          "triggers": {
            "on_damage": {
              "event": "example:event"
            },
            "deals_damage": true
          } 
        }```

Where `example:event` will run the command using `queue_command`
copper jacinth
#

running commands when hurt [SOLVED]