Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-229882

Predicate still passes for certain stacks even after dropping them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.17, 1.17.1 Pre-release 1, 1.17.1, 1.19.4, 1.20 Pre-release 5, 23w51b
    • None
    • Confirmed
    • Commands, Data Packs

      The bug

      If you drop an item, the predicate will still say you are holding that item, even if there is nothing in your hand. Opening your inventory and clicking on the slot where the item used to be will update it and the using the predicate will result in the correct outcome.

      Did not happen in 1.16.5

      How to reproduce

      1. Create a predicate as follows:
        {
          "condition": "minecraft:entity_properties",
          "entity": "this",
          "predicate": {
            "equipment": {
              "mainhand": {
                "nbt": "{Cap:1b}"
              }
            }
          }
        }
        
      2. Give yourself a shield with the tag Cap:1b, 
        /give @s shield{Cap:1b}
        
      3. Drop the item
      4. Test the predicate
        execute if predicate ...
        
      5. It will result in "Test Passed"
      6. Go into your inventory and click on your empty selected item slot, then testing the predicate again will result in "Test Failed"

            Unassigned Unassigned
            HotElbows Miles Spink
            Votes:
            12 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              CHK: