GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
EntityEatBlockEvent Class Reference

Public Member Functions

 __construct (Entity $entity, FoodSource $foodSource)
 
 getResidue ()
 
 setResidue ($residue)
 
- Public Member Functions inherited from EntityEatEvent
 __construct (Entity $entity, FoodSource $foodSource)
 
 getFoodSource ()
 
 getFoodRestore ()
 
 setFoodRestore (int $foodRestore)
 
 getSaturationRestore ()
 
 setSaturationRestore (float $saturationRestore)
 
 getResidue ()
 
 setResidue ($residue)
 
 getAdditionalEffects ()
 
 setAdditionalEffects (array $additionalEffects)
 
- Public Member Functions inherited from EntityEvent
 getEntity ()
 
- Public Member Functions inherited from Event
 getEventName ()
 
 getHandlers ()
 
- Public Member Functions inherited from Cancellable
 isCancelled ()
 
 setCancelled ($forceCancel=false)
 

Additional Inherited Members

- Static Public Attributes inherited from EntityEatEvent
static $handlerList = null
 
- Protected Attributes inherited from EntityEvent
 $entity
 
- Protected Attributes inherited from Event
 $eventName = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( Entity  $entity,
FoodSource  $foodSource 
)

EntityEatBlockEvent constructor.

Parameters
Entity$entity
FoodSource$foodSource
36  {
37  if(!($foodSource instanceof Block)){
38  throw new \InvalidArgumentException("Food source must be a block");
39  }
40  parent::__construct($entity, $foodSource);
41  }

Member Function Documentation

◆ getResidue()

getResidue ( )
Returns
Block
46  {
47  return parent::getResidue();
48  }

◆ setResidue()

setResidue (   $residue)
Parameters
$residue
53  {
54  if(!($residue instanceof Block)){
55  throw new \InvalidArgumentException("Eating a Block can only result in a Block residue");
56  }
57  parent::setResidue($residue);
58  }

The documentation for this class was generated from the following file: