I want to write a plugin on how to disable putting specific item on chest. I ask back then how to disable specific item drop on chest but now this one. But i dont know where to start. Is there someone who can help me. Is there an event that check if player is gonna put item on chest.
Correct me if I'm wrong, but I'm sure you can use pocketmine\tile\Chest as $chest to get the chest inventory. $inventory = $chest->getInventory();
InventoryTransactionEvent is fired when player puts an item in chest. It actually fires everytime a player makes a change in an inventory so you need to validate whether they're putting an item and not taking out.
It isn't deprecated? https://github.com/pmmp/PocketMine-...t/inventory/InventoryTransactionEvent.php#L42
Still cant make it work can someone give me a code using transaction event to cancel chest transaction. The api change and i cant seem to make it work.
What do u mean by that. I want to check if player is clicking or selecting an item then use $event set cancelled true
Oh you're the maker of InvMenu. I have found your callback that detect the "ItemClicked" in inventory. Can u create a seperate api to that that check if player is holding/selecting/clicking item in inventory.