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

/give command running through a function tagged minecraft:tick creating invisible item when giving to selected hotbar slot

XMLWordPrintable

    • Community Consensus
    • Creative
    • (Unassigned)

      This bug occurs when the player is given an item by a /give command (or a function containing a /give command) running every tick, due to it either being tagged minecraft:tick or running in a repeating command block, and that item would land in the selected slot of the player's inventory, and that slot was cleared the previous tick by the player dropping an item. E.g. the player drops an item in hotbar slot 0, and then the immediate next tick the player is given an item, such that it lands in hotbar slot 0.

      The given item then becomes invisible and unusable, and doesn't show up when moused over. However, when the inventory is scanned by commands using the nbt={Inventory:...} command argument, the item registers as being in the player's inventory. Additionally, when the drop key is pressed when the slot in which the given item is supposedly in is selected, it does drop the item. If another item is placed in the slot where the given item supposedly is, the game realises that there is in fact not an item there, and the above tests register as if the given item is not in the player's inventory.

      The following methods have been shown to NOT result in this bug:

      • Dropping an item held in another hotbar slot while a lower slot, such that it triggers a command to give a player an item, and will thus land in a slot that is not selected.
      • Dropping an item by pressing 'q' in the inventory screen, such that is triggers a command to give a player an item, regardless of where the given item lands.
      • Removing an item using a /clear @p minecraft:<item_name> command, such that it triggers a command to give a player an item, regardless of where the given item lands.

      A direct method of reproducing this bug is to run this command every tick, either through a repeating command block or by tagging it minecraft:tick:

      give @a[nbt=give @a[tag=gunboat,nbt=!{Inventory:[{tag:{display:{Name:'{"text":"test"}'}}}]}] minecraft:stone{display:{Name:'{"text":"test"}'}} 1
      

      Then, holding this item in the lowest available hotbar slot and dropping the item will reproduce this bug.

            Unassigned Unassigned
            TheG_Ghaladron Gene McLay
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: