Documentation

FoodSourceItem extends ConsumableItem, FoodSource

Interface implemented by objects that can be consumed by mobs.

Table of Contents

canStartUsingItem()  : bool
getAdditionalEffects()  : array<string|int, EffectInstance>
getFoodRestore()  : int
getResidue()  : Item
Returns the leftover that this Consumable produces when it is consumed. For Items, this is usually air, but could be an Item to add to a Player's inventory afterwards (such as a bowl).
getSaturationRestore()  : float
onConsume()  : void
Called when this Consumable is consumed by mob, after standard resulting effects have been applied.
requiresHunger()  : bool
Returns whether a Human eating this FoodSource must have a non-full hunger bar.

Methods

canStartUsingItem()

public canStartUsingItem(Player $player) : bool
Parameters
$player : Player
Return values
bool

getFoodRestore()

public getFoodRestore() : int
Return values
int

getResidue()

Returns the leftover that this Consumable produces when it is consumed. For Items, this is usually air, but could be an Item to add to a Player's inventory afterwards (such as a bowl).

public getResidue() : Item
Return values
Item

getSaturationRestore()

public getSaturationRestore() : float
Return values
float

onConsume()

Called when this Consumable is consumed by mob, after standard resulting effects have been applied.

public onConsume(Living $consumer) : void
Parameters
$consumer : Living
Return values
void

requiresHunger()

Returns whether a Human eating this FoodSource must have a non-full hunger bar.

public requiresHunger() : bool
Return values
bool

Search results