Skip to content

GiveCommand ​

class · pocketmine\command\defaults\GiveCommand · source

Extends VanillaCommand
Implements ExhaustiveOverloads

/give <player: target> <itemName> [amount] [data] [components]: gives the item to every target (1 by default, like Bedrock); what does not fit in the inventory is dropped at the player's feet.

The item may be any PocketMine item name or vanilla item ID. [data] selects a variant (e.g. the potion type). [components] is Bedrock's JSON ({"minecraft:can_destroy":{"blocks":["stone"]}}, minecraft:can_place_on, minecraft:keep_on_death, minecraft:item_lock), or PocketMine's JSON NBT tags, which may also directly follow the amount.

Methods ​

__construct() ​

php
public function __construct()

execute() ​

php
public function execute(\pocketmine\command\CommandSender $sender, string $commandLabel, array $args)

getOverloads() 5.46.0 ​

php
public function getOverloads() : array

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