The Issue
When using a spawn egg on fluids (water and lava) or the waterlogged portion of a non-whole block, an advancement with correct item_used_on_block
criteria fails to be rewarded.
Steps to Reproduce
Enable attached datapack (
), which contains the following advancement:
{
"criteria": {
"requirement": {
"trigger": "minecraft:item_used_on_block",
"conditions": {
"item": {
"items": [
"minecraft:pig_spawn_egg"
]
}
}
}
},
"rewards": {
"function": "spawneggbug:detect"
}
}
Enter Creative mode (note that this bug is not particular to Creative mode, but it is better for demonstration purposes)
Obtain a pig spawn egg (note that this bug affects other spawn eggs; the datapack only tracks pig spawn eggs for demonstration purposes)
Spawn a pig on land
Observe pig spawns with "[PLAYERNAME] I placed a spawn egg!" message sent in chat (advancement succeeds)
Spawn a pig in water/lava (click on the fluid, not on any block wireframe)
Observe pig spawns with no "[PLAYERNAME] I placed a spawn egg!" message in chat (advancement fails)
Give yourself another pig spawn egg with the following command:
/give @s pig_spawn_egg{CanPlaceOn:["minecraft:campfire"]}
Place a campfire underwater (note that this affects other waterloggable blocks; campfires are picked for demonstration purposes)
Enter Adventure mode
Place second pig spawn egg against waterlogged non-solid edge of the campfire
Observe pig spawns with no "[PLAYERNAME] I placed a spawn egg!" message in chat (advancement fails)
These steps have also been recorded and attached to this report for ease of visualization (
[media]).
Note
A scoreboard objective with minecraft.used:minecraft.[ENTITY]_spawn_egg
criteria is able to detect using spawn eggs in the cases where the advancement cannot. However, the expected behavior is still that the advancement could detect such cases as well, since the item is technically used against a block.
Attachments
Comments 4
I was just about to report this, and I also have something to add to it: it seems that emptying a bucket onto the ground (so, using the bucket item on a block) also fails to trigger the advancement.
@unknown Use the placed_block
advancement trigger instead; it is intended behavior that it does not work with item_used_on_block
.
I can confirm this behavior; the advancement isn't triggered.