Shweit / Shweit/Expendable-Backpacks

Backpacks can be moved into themselves via hotbar shortcuts

Open
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
1
Forks
4
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the hotbar-slot shortcut described in the issue on Paper 1.21.10, then compare that path with the existing click-and-release backpack placement behavior. Done means hotbar moves into another backpack or itself are blocked consistently, without the backpack disappearing when the UI closes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.