Помогите с кодом на поты

    $pots = VanillaItems::POTION_HEAL_SPLASH_NAME();
	$pots->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
	$pots->setCount(28);

как мне сделать так чтобы она выдавал взрывное зелье исцеления 2 NetherGameMC Api 5


Когда вернусь домой, отвечу на твой вопрос (если кто-то не ответит до меня)

$player->getInventory()->addItem($pots);

спасибо. жду

у меня она есть

у меня просто только этот код не работает

могу часть кода скинуть

public function ClassicFFA(Player $player, bool $hasItem = false): void {
    $config = new Config($this->getDataFolder() . "config.yml", Config::YAML);
    $prefix = $config->get("Prefix");
	$player->getInventory()->clearAll();
	$player->getArmorInventory()->clearAll();

	// items
	$espada = VanillaItems::DIAMOND_SWORD();
	$espada->addEnchantment(new EnchantmentInstance(VanillaEnchantments::UNBREAKING(), 5));
	$espada->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
	$espada->setCount(1);

    $pearl = VanillaItems::ENDER_PEARL();
	$pearl->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
	$pearl->setCount(16);

    $pots = VanillaItems::POTION(PotionType::HEALING())->setSplash(true);
    $pots->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
    $pots->setCount(28);
    
    $pots = VanillaItems::SPLASH_POTION(); // Get a splash potion base
    $pots->setPotionType(VanillaPotionTypes::HEALING()); // Set to healing typ
    $pots->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
    $pots->setCount(2);

$player->getInventory()->setItem(0, $espada);
    $player->getInventory()->setItem(1, $pearl);
    $player->getInventory()->setItem(2, $pots);

public function ClassicFFA(Player $player, bool $hasItem = false): void {
$config = new Config($this->getDataFolder() . “config.yml”, Config::YAML);
$prefix = $config->get(“Prefix”);

$player->getInventory()->clearAll();
$player->getArmorInventory()->clearAll();

$espada = VanillaItems::DIAMOND_SWORD();
$espada->addEnchantment(new EnchantmentInstance(VanillaEnchantments::UNBREAKING(), 5));
$espada->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
$espada->setCount(1);

$pearl = VanillaItems::ENDER_PEARL();
$pearl->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
$pearl->setCount(16);

$healPotion = VanillaItems::SPLASH_POTION();
$healPotion->setPotionType(VanillaPotionTypes::STRONG_HEALING()); // HEALING II
$healPotion->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
$healPotion->setCount(28);

$player->getInventory()->setItem(0, $espada);
$player->getInventory()->setItem(1, $pearl);
$player->getInventory()->setItem(2, $healPotion);

}

попробуй

image

Main.php (42,5 КБ)

407 строка там находиться

перепутал сорян


Не юзай нейронку

эт ты кому?

Вот ответ

$potion = VanillaItems::SPLASH_POTION();
$potion->setType(PotionType::STRONG_HEALING());
// Всё остальное 

К тому что ты 2 раза ошибся, даже не удостоверившись, что твой код работает

а как именно мне его вставить в код?

О боже…


	$pots = VanillaItems::SPLASH_POTION();
	$pots->setType(PotionType::STRONG_HEALING())
	$pots->setLore(["§b» §l§fFirelyTeam§dPVP§r"]);
	$pots->setCount(28);

Твой изначальной код, но измененный

Поты блин… ПОТЫ! А перевести слово слабо? Либо сразу писать слово на английском, либо перевод слова. Но вот так коверкать, не понимаю.

1 лайк

Так вот они, “поты”

поты - зельки - potions