Skip to content

Backpacks can be moved into themselves via hotbar shortcuts #48

Description

@daltonpro

Describe the bug
As we know, backpack logic is coded to prevent you from placing one inside of the other. In fact, clicking and releasing triggers the warning in chat and stops the displacement from happening (1st screenshot).

However, if you use hotbar slot hotkeys to move a backpack into another (or even into ITSELF), the plugin doesn't stop you from doing it. By hotbar slot hotkeys, it is intended that you have, for example, your backpack in slot one, you open it, hover over a slot inside the backpack, and press 1 on your keyboard (2nd screenshot). This transfers the backpack into whatever backpack was opened (which can include itself) and the plugin doesn't flag and stop this behavior. The second screenshot shows an enderpack placed within itself.

As soon as you exit the backpack UI, the backpack is gone, and in the case of moving it into itself, it completely disappears. If you're lucky and you have a clone of the enderpack, you can go retrieve it from inside of itself. In the other cases (no cloned enderpacks, or normal backpack), you simply lose it forever.

To Reproduce
Steps to reproduce the behavior:

  1. Place your backpack (e.g., an enderpack) in a hotbar slot, such as slot 1.
  2. Open the backpack, so its inventory UI is visible.
  3. Hover your cursor over a slot inside the backpack's inventory.
  4. Press the hotbar slot number (e.g., "1") on your keyboard to move the backpack item into the hovered slot inside the open backpack.
  5. This can move the backpack into another backpack, or even into itself.
  6. Observe that the plugin does not block this action, allowing the backpack to be placed inside itself or another backpack.
  7. Close the backpack UI.
  8. Result: The backpack disappears. If you move it into itself, it is lost completely. If you have a clone of the enderpack, you may be able to retrieve it from inside itself. Otherwise, the backpack is lost permanently.

Expected behavior
It should follow the same default logic as if we were attempting to place an enderpack into each other without using the hotbar slot numbers via your keyboard.

Screenshots

Image

Version information:

  • Vanilla version: 1.21.10
  • Server version: Paper-1.21.10
  • Plugin version 1.1.1

Additional context
This bug was submitted by a community member within our network. If you require further clarification or feedback, please don't hesitate to let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions