MinecartHopper 5.46.0
Extends ContainerMinecart
Minecart with hopper (vanilla minecraft:hopper_minecart): 5 slots. While enabled it takes items out of the container above it and picks up item entities around it, one transfer every MinecartHopper::TRANSFER_COOLDOWN_TICKS. It doesn't push items anywhere: hoppers under the rails empty it. A powered activator rail disables it, an unpowered one enables it again (vanilla rail_sensor events hopper_deactivate / hopper_activate).
Constants
INVENTORY_SIZE
php
public const INVENTORY_SIZE = 5TAG_ENABLED
php
public const TAG_ENABLED = "Enabled"TRANSFER_COOLDOWN_TICKS
php
public const TRANSFER_COOLDOWN_TICKS = \pocketmine\block\utils\ItemTransfer::HOPPER_COOLDOWN_TICKSTicks between transfers (the Bedrock hopper rate).
Properties
$enabled protected
php
protected bool $enabledMethods
getCartDrops()
php
public function getCartDrops() : arraygetInventorySize()
php
public function getInventorySize() : intgetMinecartType()
php
public function getMinecartType() : \pocketmine\entity\vehicle\MinecartTypegetName()
php
public function getName() : stringgetNetworkTypeId()
php
public static function getNetworkTypeId() : stringinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisEnabled()
php
public function isEnabled() : boolonActivatorRail() protected
php
protected function onActivatorRail(bool $powered) : voidsaveNBT()
php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetEnabled()
php
public function setEnabled(bool $enabled) : voidsuckInItems()
php
public function suckInItems() : boolTakes one item from the container above, or picks up item entities around the cart (vanilla MinecartHopper.suckInItems()). Returns whether something was taken.
tickMinecart() protected
php
protected function tickMinecart() : void