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

Location based enchantment effects don't check when the player switches their held item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • 1.21
    • None
    • Unconfirmed
    • Data Packs, Enchantments

      I have the following custom enchantment, which should apply a jump bonus whenever the player is holding an enchanted item and standing on the correct block:

      {
        "anvil_cost": 8,
        "description": {
          "text": "Amethyst Jump"
        },
        "effects": {
          "minecraft:location_changed": [
            {
              "effect": {
                "type": "minecraft:attribute",
                "amount": 1.0,
                "attribute": "minecraft:generic.jump_strength",
                "id": "enchantmenttest:enchantment.amethyst_jump",
                "operation": "add_multiplied_base"
              },
              "requirements": {
                "condition": "minecraft:entity_properties",
                "entity": "this",
                "predicate": {
                  "stepping_on": {
                    "block": {
                      "blocks": "minecraft:small_amethyst_bud"
                    }
                  }
                }
              }
            }
          ]
        },
        "max_cost": {
          "base": 25,
          "per_level_above_first": 10
        },
        "max_level": 1,
        "min_cost": {
          "base": 10,
          "per_level_above_first": 10
        },
        "slots": [
          "hand"
        ],
        "supported_items": "minecraft:stick",
        "weight": 1
      }
      

      However, the game doesn't evaluate this when the player switches their held item, so if the player switches to an enchanted item while standing on the block, they don't receive the jump boost until they enter a new blockspace, and if they switch away from the enchanted item while standing on the correct block, they retain the boost indefinitely. This is in contrast to equipped items - since Soul Speed works in the Feet slot, equipping or unequpipping a pair of Soul Sped boots will apply the check immediately.

            Unassigned Unassigned
            00gogo00 Zachary Barbanell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: