InventoryTransactionEvent

JackboyPlay

Пользователь
Hello folks, if I use this:
PHP:
@EventHandler
	public void onTransact(InventoryTransactionEvent e){
		Set<Transaction> transactions = e.getTransaction().getTransactions();
		Set<Inventory> invs = e.getTransaction().getInventories();
		for(Inventory inv : invs){
			for(Transaction trans : transactions){
				if(inv.getHolder() instanceof Player){
					Player player = (Player) inv.getHolder();
					e.setCancelled();
				}
			}
		}
	}
The Event wont cancelled!
If I want to send a message in this event to the player it works if a player put something into a chest but if a player take something out of a chest he wont get a message!
 
Top