Open baailey opened 6 months ago
It's only using the PlayerSwapHandItemsEvent event from Spigot, so if you think is a bug, then it's a bug with Spigot.
then what measure would you recommend to block any items going into the offhand?
I mean, that event should be working. You could try to check on the spigot forums why the event PlayerSwapHandItemsEvent (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerSwapHandItemsEvent.html) doesn't work.
This is the description of the event: "Called when a player swap items between main hand and off hand using the hotkey."
Maybe it's not what you are looking for?
I mean, it should be what I need. From the description, it's exactly what I need in-fact. For my use-case, I don't want players to be able to move a specific item into their off-hand, however when testing, the item I'm blocking can be moved into the off-hand, but then is blocked when trying to swap it back into the main hand.
I will have to take a look into it when I have the time.
When trying to block moving an item into your offhand, player_swap_hand will instead block moving the item out of the offhand. Unless there is a different way of blocking this, it seems like player_swap_hand may be bugged?