mojira.dev
MC-270175

Advancement trigger item_used_on_block no longer triggers when using the right click action of a block without an item

In 1.20.4 (and earlier), it was possible, to do right click detection of any block that has a right click action like so:

{
    "criteria": {
        "click_button": {
            "trigger": "minecraft:item_used_on_block",
            "conditions": {
                "location": [
                    {
                        "condition": "minecraft:location_check",
                        "predicate": {
                            "block": {
                                "tag": "minecraft:buttons"
                            }
                        }
                    }
                ]
            }
        }    
    },
    "rewards": {
        "function": "test"
    }
}

However, this no longer works in the current snapshot (note that you have to replace tag with blocks and prefix the block tag with a #)

It looks like, the advancement now requires an item to be used.

Steps to reproduce:

  1. Download the 1.20.5 datapack from the attachment

  2. Use a dye or glow ink on a sign
    -> ✔ You will see a chat message "Do not temper with the signs on my yard!"

  3. Right click any button
    -> ❌ The advancement `buttons` does not trigger

  4. Download the 1.20.4 version of the datapack (the only difference is the blocks field being changed to tag and the # being removed, because of format changes)

  5. Repeat the steps above in 1.20.4
    -> ✔ Pressing a button now prints "WHY ARE YOU PLAYING WITH MY BUTTONS?!"

Expected Behavior

minecraft:item_used_on_block should work for any right click action on any block that has a right click action.

Observed Behavior

minecraft:item_used_on_block only triggers when using an item on a block.

Attachments

Comments 3

I believe this is WAI. You need to use the new default_block_use‌ criterion. See also MC-269330 and MC-267456.

Is your use case covered by the `default_block_use‌` and/or `any_block_use` triggers?

Yes, thank you, I missed those!

NeunEinser

(Unassigned)

Confirmed

Advancements

24w13a

Retrieved