@Listener(order = Order.FIRST)
public void onDropItem(DropItemEvent.Pre e) {
e.setCancelled(true);
}
not working.
please help me.
@Listener(order = Order.FIRST)
public void onDropItem(DropItemEvent.Pre e) {
e.setCancelled(true);
}
not working.
please help me.
DropItemEvent.Pre
’s javadoc:
/**
* Handles {@link ItemStack}s and may be called before an {@link Item}
* entity is actually constructed.
*
* <p>Note: This is not guaranteed to fire due to custom handling within
* a mod or plugin.</p>
*
* <p>Canceling this event only prevents the items from being dropped.
* Inventories or blocks affected are not rolled back.</p>
*/
“not working” is very unclear but I think you should cancel DropItemEvent
directly instead.