In datapacks, our only current methods of detecting when a player right-clicks are all a little flawed: using carrots or warped fungus on sticks means nearby pigs or striders are attracted, an undesired side effect. using interaction entities glued to the player means the player can no longer otherwise interact with the world, like punching blocks or opening chests. using eyes of ender doesn't work if the world actually has a stronghold, and knowledge books are used up, as well as creating a little toast in the top right corner when used.
i suggest there could be an unobtainable item, much like the knowledge book, that has an NBT tag that takes a function as its parameter.
datapack creators could make a function, and then give the player such an item:
/give @s command_on_a_stick{function:"mydatapack:myfunction"} and the item would run that function every time it is used.
this would make the creation of custom usable items in datapacks a lot easier.
Please sign in to leave a comment.
0 Comments