Skip to content

MinecartHopper 5.46.0 ​

class · pocketmine\entity\vehicle\MinecartHopper · source

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 = 5

TAG_ENABLED ​

php
public const TAG_ENABLED = "Enabled"

TRANSFER_COOLDOWN_TICKS ​

php
public const TRANSFER_COOLDOWN_TICKS = \pocketmine\block\utils\ItemTransfer::HOPPER_COOLDOWN_TICKS

Ticks between transfers (the Bedrock hopper rate).

Properties ​

$enabled protected ​

php
protected bool $enabled

Methods ​

getCartDrops() ​

php
public function getCartDrops() : array

getInventorySize() ​

php
public function getInventorySize() : int

getMinecartType() ​

php
public function getMinecartType() : \pocketmine\entity\vehicle\MinecartType

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

isEnabled() ​

php
public function isEnabled() : bool

onActivatorRail() protected ​

php
protected function onActivatorRail(bool $powered) : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

setEnabled() ​

php
public function setEnabled(bool $enabled) : void

suckInItems() ​

php
public function suckInItems() : bool

Takes 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

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