using_item advancement trigger keeps being activated even after the item stops being used, after teleporting to another dimension
The using_item advancement keeps trigger even when the player isn't holding down right mouse button if the reward function has a command that let the player teleport through dimension, causing the player to be stuck at a position unless they no longer holding the item.
The advancement:
{
"criteria":
{
"book":
{
"trigger": "minecraft:using_item",
"conditions":
{
"item":
{
"items": "minecraft:book"
}
}
}
},
"rewards":
{
"function": "test:book"
}
}
The function:
advancement revoke @s only test:book execute in overworld run tp @s 0 -60 0 0 0 playsound entity.player.teleport
What I expected to happen was:
The advancement stop trigger when release right mouse button.
What actually happened was:
The advancement keeps trigger and execute the reward function none-stop.
Steps to Reproduce:
1. Put the following datapack into your world and /reload it.
2. Use the following command to get an edible book.
/give @s book[food={can_always_eat: true, eat_seconds: 86400, nutrition: 1, saturation: 1}]
3. Go to the nether.
4. In the nether, start using the book until you appear in the overworld.
5. You will be teleported back to the overworld, and stuck at (0, -60, 0) until you use the book again or switch to another hotbar slot.
2024-07-12, 06:34 AM
2024-08-07, 08:15 AM
2024-08-07, 08:15 AM
3
2