Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addItem problem with offhand and full inventory #11921

Open
ssomar1607 opened this issue Jan 5, 2025 · 0 comments
Open

addItem problem with offhand and full inventory #11921

ssomar1607 opened this issue Jan 5, 2025 · 0 comments

Comments

@ssomar1607
Copy link

ssomar1607 commented Jan 5, 2025

Expected behavior

Hello.

The following method when there is a space to add the item should add the item in the inventory:

PlayerInventory inv = p.getInventory();
inv.addItem(new ItemStack(Material.DIAMOND));

Image

On my screenshot, I have space in my offhand, so it should increase to 37, 38, 39 up to 64.

Observed/Actual behavior

But currently, it doesnt work when the space is in the off hand.
The additem method return a non empty Map.

Steps/models to reproduce

Create a small plugin with

PlayerInventory inv = p.getInventory();
inv.addItem(new ItemStack(Material.DIAMOND));

when you do a specific action

put at least one of the item you add in your offhand and fullfill your inventory with another item

Plugin and Datapack List

[21:25:21 INFO]: - AceStore, CustomPiglinsTrades, ExecutableBlocks, ExecutableEvents, ExecutableItems, LuckPerms, MyFurniture, NBTAPI, packetevents, PlaceholderAPI
[21:25:21 INFO]: SCore, Vault, WorldEdit

Paper version

[21:25:29 INFO]: This server is running Paper version 1.21.4-76-main@486e521 (2025-01-05T18:15:54Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.4-53-326c687 (MC: 1.21.4)

Other

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant