#My advancement doesn't seem to work
1 messages · Page 1 of 1 (latest)
this is the advancement
this function runs as tick ⬇️
execute as @a[tag=YesAmVampire,scores={vamphurtEntity=1..}] run function vampire_gets_blood:check_if_hurt_entity
what has the function to do with the advancement?
just a sec
this is check_if_hurt_entity
execute unless items entity @s weapon.offhand minecraft:glass_bottle run function vampire_gets_blood:vamphunt_set_0 execute if entity @s[advancements={vampire_gets_blood:hit_a_skeleton=true}] if items entity @s weapon.offhand minecraft:glass_bottle run function vampire_gets_blood:vamphunt_set_0 execute unless entity @s[advancements={vampire_gets_blood:hit_a_skeleton=true}] if items entity @s weapon.offhand minecraft:glass_bottle run function vampire_gets_blood:blood_bottle
the function checks if the advancement is true or not
you do know that all this command code can all be condensed inside the advancement and the advancement can also run a function automatically once it is true?
lemme educate myself
btw, which version?
1.21.10
😭
ayyy ,hello
hi
do what he said
I suggest you use misode for advancements or any json files for that matter, it makes your like 100 times easier
the health nbt checks the health value of the mob but i want it to check only if the entity has health or not
{ "criteria": { "hit_other_mob_no_bottle": { "trigger": "minecraft:player_hurt_entity", "conditions": { "entity": [ { "condition": "minecraft:all_of", "terms": [ { "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "nbt": "{Health:1.0f}" } }, { "condition": "minecraft:inverted", "term": { "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "type": "minecraft:armor_stand" } } }, { "condition": "minecraft:inverted", "term": { "condition": "minecraft:entity_properties", "entity": "this", "predicate": { "type": "#minecraft:skeletons" } } } ] } ] } } }, "rewards": { "function": "vampire_gets_blood:hit_a_skeleton" } }
If I understand correctly, you can just check if Health is not zero
in advancements ?? i am using 1.21.10 version
i dont see anything that compares health in advancements
well what i wanted to do after player_hurt_entity is :-
- check if entity has health
- check if its not an armor stand
- check if its not skeleton
then run the function
can you not just use inverted Health:0.0f?
you can just invert Health:0.0f
because checking for a specific in a predicate will just be true if that entity has the specific Health
Inverting the health did work ,but due to Health:0.0f ,the advancement stopped running the moment i hit the entity which had half heart left.
So i had to make it Health:0.1f to just run the function after i hit it for the last time.
but thanks alot for the help