#Detecting hit or punch on entity
44 messages · Page 1 of 1 (latest)
Your title being "extremely generic" is probably not going to help explain your issue.
damage_sensor not interact
Also ditto on the question title and tags being bad. I will redo them for you
Detecting hit or punch on entity
So
"minecraft:damage_sensor": {
"interactions": {
"on_interact": {
"event": "rightclick"
}
}
}```
?
Mm, that is to say you need to use a different component entirely, rather than just rename it. Thankfully the layouts are near identical, just with some keys renamed
Wait wdum
"minecraft:damage_sensor": {
"triggers": {
"on_damage": {
"event": "leftclick"
}
}
}
Alr thanks
uh
Did I mess up the commas?
From what I can see, no
It's not working
{
"format_version": "1.13.0",
"minecraft:entity": {
"description": {
"identifier": "smp:npc3",
"is_spawnable": false,
"is_summonable": true,
"is_experimental": false
},
"components": {
"minecraft:type_family": {
"family": [
"npc3"
]
},
"minecraft:collision_box": {
"width": 0.6,
"height": 1.9
},
"minecraft:health": {
"value": 999999999,
"max": 999999999
},
"minecraft:damage_sensor": {
"triggers": [
{
"on_damage": {
"filters": {
"test": "is_family",
"subject": "other",
"value": "player"
},
"event": "leftclick"
},
"deals_damage": false
}
]
},
"minecraft:physics": {},
"minecraft:nameable": {
"always_show": true
},
"minecraft:pushable": {
"is_pushable": false,
"is_pushable_by_piston": false
},
"minecraft:knockback_resistance": {
"value": 100,
"max": 100
},
"minecraft:interact": {
"interactions": {
"on_interact": {
"event": "rightclick"
}
}
},
"minecraft:damage_sensor": {
"triggers": {
"on_damage": {
"event": "leftclick"
}
}
}
},
"events": {
"leftclick": {
"run_command": {
"target": "other",
"command": [
"tag @s add antittp29982848757823978487348385678929893479378",
"tp @s 0 92 0"
]
}
},
"rightclick": {
"run_command": {
"target": "other",
"command": [
"tag @s add antittp29982848757823978487348385678929893479378",
"tp @s 0 92 0"
]
}
}
}
}
}```
Try updating the format version, it looks a bit old.
Right click works but not left.
I'd do "1.19.0"
What's wrong with 1.13?
It could be expecting some old syntax for damage sensors. What's wrong with updating it?
Yeah not working
Not registering the left click
Maybe it needs a target explicitly set. Add "target": "self" to on_damage
Yeah, although with the typo removed
Nope not working
Any thoughts?
wait!
What if I create a trigger?
"minecraft:damage_sensor": {
"triggers": [
{
"on_damage": {
"filters": {
"test": "is_family",
"subject": "other",
"value": "player"
},
"event": "leftclick"
},
"deals_damage": false
}
]
},```
Something like this.
Nope didn't work either
So is left clicking not possible anymore?
nope that worked
weird lmfao