I'm developing a plugin in 1.12(because it's for a friend, and his server is still in 1.12 lol), but can't get my event to fire... Code: Code: public class OnItemInHopper implements Listener { @EventHandler public static void onItemInHopper(InventoryMoveItemEvent event) { and: Code: public class Core extends JavaPlugin{ @Override public void onEnable() { this.getServer().getPluginManager().registerEvents(new OnItemInHopper(), this); } I get no errors in the console, so that's weird... Anyone that knows a solution?
@TFOXTom Have you tried printing a simple message to the console in the event? (outside of any if statements) EDIT: Try removing the 'static' keyword from the event.
@TFOXTom Any errors in the console? Did you get the message when trying to print it to console outside of any if statements in the event?
I'm 95% sure. Im trying to check if a item is moved to or from a hopper, so it's the good one right? EDIT: found the problem. There probably is a bug in my bukkit.jar, where the event is only fired when the interaction is between two TileEntities, and not via a player...
The InventoryItemMoveEvent can't be caused by a player. It is called exclusively when a hopper moves an item to or from a container, which has no relation to a player. Listen into the InventoryPickupItemEvent instead. There is no player association with that, either, though.