#is it possible to make a "use item on entity" interaction with a datapack?
1 messages · Page 1 of 1 (latest)
You can detect existing interactions, like bone on dog or nametag on most entities or any click on villager but not any arbitrary interaction, nope, that would require trickery with an interaction entity.
Also, this should probably be in #1051225367807000706 ^^
oh ok sorry
hm so i am clicking on villagers tho
not sure why its not working
"criteria": {
"sole_criterion": {
"trigger": "minecraft:player_interacted_with_entity",
"conditions": {
"entity": {
"type": "minecraft:villager"
}
}
}
},
"requirements": [
[ "sole_criterion" ]
],
"rewards": {
"function": "reset_trades:reset_villager_trades"
}
}``` this is the advancement class, and the function is just
``` say successful```
U sure that you don’t have the advancement unlocked already?
im thinking that may be the issue as well, im going to try and remove it in the function with this now advancement revoke @p from reset_trades:used_resetting_item_on_villager
(also i know a datapack that does this already exists, i wanted to try and make my own)
You probably want to use @s only instead but this should also work as is, it’s just cleaner and with less side effects
Since @s is the player running the function and from can revoke multiple advancements (if they exist)
oh ok
hm ok so it is giving me the advancement the function just isnt running properly
is the functions folder supposed to be function or functions
If you are in 1.21+ it’s function
In older versions it’s plural
Same with the advancement(s) folder for the advancement
alright that was the issue
Does the advancement show up when you try and autocomplete a command like
advancement revoke @s only
Yes, it’s a rather recent change
thank you