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

SelectedItem not working with Enchantments Proproperly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • Minecraft 1.8.8, Minecraft 15w32b
    • None
    • Windows 7
    • Unconfirmed

      When trying to detect if a item has a enchant using the SelectedItem nbt tag, you can detect items with enchants when naturally adding the enchant using a crafting table or using the give command with the enchant already on it. If you give yourself the item and then use the /enchant command, then the SelectedItem nbt tag doesn't pick up that the item has a enchantment on it.

      Steps to Reproduce
      1.Put down a command block with this command:

      /testfor @p {SelectedItem:{tag:{ench:[{id:33,lvl:1}]}}}
      

      2. Put a button on the command block & put a comparator detecting if the command block has a output or not.

      3. Use this command.

       /give @p iron_pickaxe 1 0 {ench:[{id:33,lvl:1}]}
       

      Click the button while holding the pickaxe to see if the comparator activated. (This should work.)

      4. Use this command.

      /give @p iron_pickaxe 1 0
      

      Hold the item in your hand & do this command.

      /enchant @p 33 1
      

      Click the button and see if the comparator activated or not. (This should not work.)

            Unassigned Unassigned
            AoElite AoElite
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: