Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-180331

"minecraft:enchantable" component value uses a modulus formula

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.0.20 Preview
    • None
    • Confirmed
    • Windows
    • 1234884

      According to the [official docs|https://learn.microsoft.com/en-us/minecraft/creator/reference/content/itemreference/examples/itemcomponents/minecraft_enchantable?view=minecraft-bedrock-stable] the "minecraft:enchantable" component supports an integer type. However, upon further testing, it seems that it uses the following formula:

      value = value % 256

      rather than using the actual value.

      Reproduce:

      • Download the attached pack below
      • Import the pack into Preview 1.21.0.20
      • Give yourself the following items:
        • mojira:enchantable_0
        • mojira:enchantable_1
        • mojira:enchantable_255
        • mojira:enchantable_256
        • mojira:enchantable_257
        • mojira:enchantable_511
      • Open your inventory and hover over the items

      Expected Result:

      • mojira:enchantable_0 should not be enchantable
      • mojira:enchantable_1 should be enchantable, low enchants
      • mojira:enchantable_255 should be enchantable, high enchants
      • mojira:enchantable_256 should be enchantable, high enchants
      • mojira:enchantable_257 should be enchantable, high enchants
      • mojira:enchantable_511 should be enchantable, high enchants

      Actual Result:

      • mojira:enchantable_0 is not enchantable
      • mojira:enchantable_1 is enchantable, low enchants
      • mojira:enchantable_255 is enchantable, high enchants
      • mojira:enchantable_256 is not enchantable
      • mojira:enchantable_257 is enchantable, low enchants
      • mojira:enchantable_511 is enchantable, high enchants

        1. mojira.mcpack
          2 kB
          SmokeyStack
        2. 2024-04-04 14-16-53 - Trim.mp4
          9.87 MB
          SmokeyStack

            SmokeyStack SmokeyStack
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              CHK: