Minecart
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\MinecartTypeonInteractBlock() 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\ItemUseResultspawnMinecart() 5.46.0
php
public function spawnMinecart(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos, float $yaw = 0.0) : \pocketmine\entity\vehicle\AbstractMinecartCreates and spawns the cart of this item at the given position. Does not consume the item.
