mojira.dev
MC-264953

advancement_location context uses fractional coordinates for block locations

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.

Comments 1

GrifterMage

(Unassigned)

Confirmed

Platform

Important

Advancements

1.20.1, 23w33a

Retrieved