Skip to content

Minecart ​

class · pocketmine\item\Minecart · source

Extends UnstackableItem

A minecart item (plain, with chest, hopper, TNT or command block): used on a rail, it places the cart on it.

Methods ​

__construct() 5.46.0 ​

php
public function __construct(\pocketmine\item\ItemIdentifier $identifier, string $name = "Unknown", array $enchantmentTags = [], \pocketmine\entity\vehicle\MinecartType $minecartType = \pocketmine\entity\vehicle\MinecartType::NORMAL)

getMinecartType() 5.46.0 ​

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

onInteractBlock() 5.46.0 ​

php
public function onInteractBlock(\pocketmine\player\Player $player, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, array &$returnedItems) : \pocketmine\item\ItemUseResult

spawnMinecart() 5.46.0 ​

php
public function spawnMinecart(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos, float $yaw = 0.0) : \pocketmine\entity\vehicle\AbstractMinecart

Creates and spawns the cart of this item at the given position. Does not consume the item.

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