Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7463

Negative RepairCost tag is being stripped from the items

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • None
    • None
    • 3856-Spigot-94e187b-b76ceb4 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)
    • Yes

      Vanilla Minecraft allows to create items with negative RepairCost tag. This makes that item to be unmodifiable within the anvil (disallows enchanting with a book, renaming and repairing using the anvil). However, the Spigot server outright removes the repair cost tag upon certain conditions unknown to me.

      Steps to reproduce:


      I couldn't find a way to consistently reproduce, and I could not reproduce the tag removal on vanilla.

      1. As a player, make sure you have empty slot in your hotbar
      2. /give @s iron_pickaxe{display:{Name:'{"text":"This should have RepairCost tag"}'},RepairCost:-7777} 1
        
      3. Hold the item in main hand
      4. /data get entity @s SelectedItem
        
      5. ✅ Notice, that the RepairCost tag is still on the item
      6. open the inventory, move the item around the inventory by placing into inventory slots and back out, placing the item back in the hotbar in the end and close the inventory
      7. /data get entity @s SelectedItem
        
      8. ❌Notice, that the RepairCost tag is removed

      Another way to reproduce that might be more consistent

      1. As a player, make sure you have empty slot in your hotbar, you have at least 1 experience level and you have an anvil nearby
      2. /give @s iron_pickaxe{display:{Name:'{"text":"This should have RepairCost tag"}'},RepairCost:-7777} 1
        
      3. Hold the item in main hand
      4. /data get entity @s SelectedItem
        
      5. ✅ Notice, that the RepairCost tag is still on the item
      6. try to rename the item multiple times using an anvil, if you can't, put it back in the inventory and back to anvil again
      7. ❌If you succeed to rename an item, notice, that the RepairCost tag is removed using a command given before

      Both of those steps to reproduce works regardless if a player is in survival or creative mode, but the player must be opped

            Unassigned Unassigned
            Wroclaw Wroclaw
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: