I'm making an Attack on Titan datapack and in the series, titans have a weakspot on the back of their neck. if my datapack was made with only pvp in mind that would be okay since I could just use interaction entities in that area for if a player hits it. the only issue is that you are also able to turn into a titan, meaning mobs have to be able to somehow hit this weakpoint. thoughts?
#how to detect what part of the body was damaged?
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
Someone will come and help soon!
💬 While you wait, take this time to provide more context and details.
🙇 If nobody has answered you by <t:1731383871:t>, feel free to use the Summon Helpers button to ping our helper team.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
Sounds like more of a creative question than a practical one
well I asked a similar question in misc help and they suggested I put my next one in datapack help
If you want mobs to actively attack it, you could use something like a villager as the hitbox, that would atleast attract zombies
How are you doing the hitbox currently? Just a scaled up player?
You could also do angle and height checks to approximate if anything should have hit that part
"How do macros work" is more of a technical question, so it’s a data pack help question
"How should I design my pack" sounds like a conversation that’s better suited for general or a misc help
"How can I make a weakspot attackable by mobs" on the other hand fits here
oh the height is a good idea, but how do I check whether the entity they’re hurting is me?
The attacker relation refers to the last entity that has hit you.
So you can react to getting hit using an entity_hurt_player advancement and then use execute on attacker to do stuff with the entity that attacked you
This is assuming that the titan can only ever be a player, it that’s not the case it will be a lot more annoying
do players get the attacker nbt?
Attacker isn't an NBT, but they can be registered as an attacker for execute on, yes
ah okay
and how long are they marked as attacker? if I only want to run the function once
That I'm not sure on
alright. so does that make "execute on target" execute on whomever was hurt?
and does "execute on x" make x the selector?
I don't believe so, I think execute on target only works for mobs that target things as part of their AI, but I could be wrong. You can try checking the wiki to confirm
It makes X the executing entity, yes
so this advancement should make it so any mob hitting a player with a barrier at their head runs this function?
I made the final function mentioned summon a creeper and it's not activating
I'm on mobile so I can't see that
{
"criteria": {
"requirement": {
"trigger": "minecraft:entity_hurt_player",
"conditions": {
"player": [
{
"entity": "this",
"condition": "minecraft:entity_properties",
"predicate": {
"equipment": {
"head": {
"items": "minecraft:barrier"
}
}
}
}
]
}
}
},
"rewards": {
"function": "minecraft:titan_shifting/titan_form/nape/hit"
}
}
I even tried:
{
"criteria": {
"requirement": {
"trigger": "minecraft:entity_hurt_player",
"conditions": {}
}
},
"rewards": {
"function": "minecraft:titan_shifting/titan_form/nape/hit"
}
}
and it's still not working
Yes, this should run that function under the conditions you described
it's not running though 🤕
I also tried this and it's not even running
I'm testing with a husk hitting me
Make sure you don't already have the advancement
ah I see, I forgot to revoke it
that should be it; again, thanks to you and the other person!