Looking for a plugin that cancels the offhand swap event

Discussion in 'Spigot Discussion' started by Alter-Ego, Jul 15, 2018.

  1. Looking for a plugin that cancels the offhand swap event that happens when the F-key or a set key for the swap offhand item with selected hotbar item is pressed if that makes sense. The reason I need it is so that players can't move a certain locked item in their hotbar via swapping with the f key.

    I'm willing to pay a dev to make one if one doesn't already exist.
  2. I can make that plugin for you if you need it.
  3. Hey this is super easy to accomplish! I just tested a basic version of what you described that prevents the player from swapping any item from their main-hand to their offhand and vice versa. Note this does not prevent the player from opening their inventory and manually adding items into their offhand slot.

    I imagine you only want this to occur for specific items or in specific scenarios? Feel free to message me with the specifics and I'll be happy to get it done free of charge, or I can just send you the .jar that will prevent any item swap event period.

    Edit: If you want to do this on your own its as simple as handling this event in the API: https://hub.spigotmc.org/javadocs/s...etOffHandItem-org.bukkit.inventory.ItemStack-
  4. ben alrerady sent me a plugin thanks tho
  5. No Worries mark this as solved!
  6. Um... how do I do that?
  7. haha actually I have no idea... maybe you can't in this forum section haven't tried myself.
  8. all good it originally wasn't an issue anyway it was more of a seeking assistance thing