SpoutDev/Spout — Issue #1390: onPlayerEnchant() does not work correctly
Author: DerFlash
Created: 2012-01-05 11:52:00+00:00
State: open

Actually I'm trying to find a way to disable specific enchantments. So I found onPlayerEnchant() on Spout and hoped it's what I need...

So I added:
getServer().getPluginManager().registerEvent(Type.CUSTOM_EVENT, new InventoryManager(this), Priority.Monitor, this);

and within my InventoryManager.java:
public void onPlayerEnchant(InventoryEnchantEvent event) {
plugin.getServer().getLogger().log(Level.INFO, "onPlayerEnchant!");
}

Problem now:
- onPlayerEnchant() is thrown on every item crafting along with onInventoryCraft()
- onPlayerEnchant() is thrown when I pick up an item the first time within my inventory while the enchantment table is open
- onPlayerEnchant() is NOT thrown when enchanting an item :-/ (MOST important!)