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

advancement_location context uses fractional coordinates for block locations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.1, 23w33a
    • None
    • Confirmed
    • Advancements
    • Important
    • Platform

      The advancement_location loot context used by placed_block, item_used_on_block, and allay_drop_item_on_block is evaluated using the fractional coordinates of the center of the relevant block, not that block's integer coordinates.

      For example, this advancement:

      {  "criteria": {
          "requirement": {
            "trigger": "minecraft:placed_block",
            "conditions": {
              "location": [
                {
                  "condition": "minecraft:location_check",
                  "predicate": {
                    "position": {
                      "x": -10,
                      "y": 60,
                      "z": 25
                    }
                  }
                }
              ]
            }
          }
        }
      }

      ...can never trigger, because if you place a block in position -10 60 25, the advancement sees that as you placing a block at -9.5 60.5 25.5 instead.

            Unassigned Unassigned
            GrifterMage Callum Milne
            Votes:
            10 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: