What event is it? You can always track the change and save it in your memory if it is player.equipment.change, and you can get the item object by $data["item"] if the event is player.block.*** or player.equipment.change, and you can get the count by $item->count (not sure if it is public field. Or check economys airport for examples).
Player action is when you just take an item and long tap to the screen. This won't work in this case. So, most likely, you should use player.equipment.change
it doesn't work out for me . i am doing a plugin called eateverything . and i should use player.action
Oh, I see what you want to do) when you have an item and "act" with it, it cleans your inventory and heals you, right?
Well , for cleaning inventory just use PHP: public function inventoryClean($cmd, $params, $issuer, $alias, $args, $issuer) { $username = $params[0]; if($username === '' && $username === null) return "use /inventory clean "; $player = $this->api->player->get($username); if(! ($player instanceof Player) and ! ($player->entity instanceof Entity)) {return "player not found."; } $player->inventory = array(); $player->sendInventory(); }
If the player doesn't give any parameters, $args[0] will be not defined. It will still work, but with an E_NOTICE level error.