61 $player = $this->fetchPermittedPlayerTarget($sender, $args[0], DefaultPermissionNames::COMMAND_GIVE_SELF, DefaultPermissionNames::COMMAND_GIVE_OTHER);
67 $item = StringToItemParser::getInstance()->parse($args[1]) ?? LegacyStringToItemParser::getInstance()->parse($args[1]);
69 $sender->sendMessage(KnownTranslationFactory::commands_give_item_notFound($args[1])->prefix(TextFormat::RED));
74 $item->setCount($item->getMaxStackSize());
76 $count = $this->getBoundedInt($sender, $args[2], 1, 32767);
80 $item->setCount($count);
84 $data = implode(
" ", array_slice($args, 3));
88 $sender->sendMessage(KnownTranslationFactory::commands_give_tagError($e->getMessage()));
93 $item->setNamedTag($tags);
95 $sender->sendMessage(KnownTranslationFactory::commands_give_tagError($e->getMessage()));
101 $player->getInventory()->addItem($item);
103 Command::broadcastCommandMessage($sender, KnownTranslationFactory::commands_give_success(
104 $item->getName() .
" (" . $args[1] .
")",
105 (
string) $item->getCount(),