PlayerInventorySlotChangeEvent not triggers by swapping item
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Expected behavior
PlayerInventorySlotChangeEvent should trigger when swap item with offhand in container
Observed/Actual behavior
PlayerInventorySlotChangeEvent not triggers when swap item with offhand in container
https://youtu.be/A3zPAAu2l8w
Steps/models to reproduce
@EventHandler()
public void onSlotChange(PlayerInventorySlotChangeEvent event) {
Player player = event.getPlayer();
ItemStack oldItem = event.getOldItemStack();
ItemStack newItem = event.getNewItemStack();
player.sendMessage(oldItem.getType() + " " + newItem.getType());
}
Plugin and Datapack List
nope
Paper version
This server is running Paper version git-Paper-171 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 33bec7f)
You are running the latest version
Other
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with PlayerInventorySlotChangeEvent and reproduce the offhand swap in a container on Paper 1.20.1 using the listener shown in the report. Trace the inventory swap handling to determine why the event is skipped; done means the event fires with the old and new item stacks for this action.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100