Skip to content

PlayerItemConsumeEvent ​

class · pocketmine\event\player\PlayerItemConsumeEvent · source

Extends PlayerEvent
Implements Cancellable

Called when a player eats something

Methods ​

__construct() ​

php
public function __construct(\pocketmine\player\Player $player, \pocketmine\item\Item $item, array $residue = [])

getItem() ​

php
public function getItem() : \pocketmine\item\Item

getResidue() ​

php
public function getResidue() : array

Returns the leftover items returned to the player after consuming the item. For example, glass bottles for potions, bowls for beetroot soup, etc.

setResidue() ​

php
public function setResidue(array $items) : void

Sets the items returned to the player after consuming the item.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.