1

Execute Command REFUSES to Run Function!!! (Resolved)live_help

Dermugettum 3/28/23 11:58 pm history
379
3/29/2023 1:35 pm
I would think this would be an easy thing to fix, but this command's just driving me crazy:
execute as @e[type=minecraft:piglin,predicate=fixitself:holds_amulet,tag=!amulet,sort=nearest,limit=1] at @s run function fixitself:events/tag_piglinIt's part of a .mcfunction file that is triggered by a custom advancement. All the stuff I've made in this data pack is working just fine except this one stubborn line. I've run this very same command from ingame chat and it works, but the data pack just won't do it itself. Command blocks won't solve this problem as this is not for any adventure map of sorts, but a quality of life pack.

(edit) I guess I just had to move some commands over to a function running under the "tick" tag. Problem solved.
Posted by
Dermugettum
Level 26 : Expert Miner
34

  Have something to say?

JoinSign in

2

Spuduking
03/29/2023 1:18 pm
Level 34 : Artisan Procrastinator
The advancement triggers the function correctly, right?
2
Dermugettum
03/29/2023 1:35 pm
Level 26 : Expert Miner
Yes, but it won't run this command I mentioned above. It works on chat and command blocks, but not within the function itself.

As far as I can tell, advancements can only be triggered by players, so the function would be executed by the player. So I'm trying to execute another function from a specific mob at that point.
1

Welcome