Hi! I wanted to make an smp, where you have a few group's. One of this is poison group, that when hitting a player, you get a regeneration 1 for 2 seconds. How could I make it, because it's hard. I tried using advancments that reward is a function, but the advancment doesn't work. I don't know if I should use advancement or not, but still used advancement tag
#Hit dettect
1 messages · Page 1 of 1 (latest)
advancements should be able to work. Show your work.
Also try to be specific as the above can be read four ways.
- poison group is hit
- poison group (victim) gets regen
- attacker gets regen
- poison group hits something else
- poison group (attacker) gets regen
- victim gets regen
this os the adancment:
{ "criteria": { "poison_hit": { "trigger": "minecraft:player_hurt_entity", "conditions": { "damage": { "type": { "is_projectile": false, "is_explosion": false, "is_magic": false, "is_fire": false, "is_fall": false, "is_drowning": false, "is_starve": false, "is_cactus": false, "is_fly_in_wall": false } } } } }, "rewards": { "function": "toxic:poison_hit" } }
and this is the function:
`execute if entity @s[tag=poison] run effect give @s regeneration 1 0 true
execute as @e[distance=..5,tag=!poison,nbt={HurtTime:10s}] run effect give @s poison 5 0
advancement revoke @s only toxic:poison_hit`
idk why, but before when i typed advancement revoke @s only toxic:poison_hit vs code made it yellow, but now its okay
i changed the advancment to this:
{ "criteria": { "poison_hit": { "trigger": "minecraft:player_hurt_entity" } }, "rewards": { "function": "toxic:poison_hit" } }
and the function to say hello, still doesnt work
I'm dumb, i didnt add the parent etc.
you don't need a parent advancement
oh, okay
and you are sure it does not do the say hello when you hurt any entity?
if that is the case your advancement hasn't been revoked properly or you forgot to reload
I changed it to tellraw, and it doesn't pop up
This is my code now
{ "criteria": { "poison_hit": { "trigger": "minecraft:player_hurt_entity" } }, "rewards": { "function": "toxic:poison_hit" } }
`tellraw @a hello
advancement revoke @a only toxic:poison_hit`
I don't know what's wrong
did you reload and have you checked the logs?
i realoded, and i didnt check the logs
it's the thing you turn on, in the minecraft launcher?
yes, usually helps finding errors like typos etc.
okay, so i turned it on, and when i kill a pig, nothing happens