Hi. I want to throw gold ingots like a snowball. I only know how to do it for a snowball :/ PHP: $nbt = new CompoundTag("", [ "Pos" => new ListTag("Pos", [ new DoubleTag("", $player->x), new DoubleTag("", $player->y + $player->getEyeHeight()), new DoubleTag("", $player->z) ]), "Motion" => new ListTag("Motion", [ new DoubleTag("", $aimPos->x), new DoubleTag("", $aimPos->y), new DoubleTag("", $aimPos->z) ]), "Rotation" => new ListTag("Rotation", [ new FloatTag("", $player->yaw), new FloatTag("", $player->pitch) ]),]);$projectile = Entity::createEntity("Snowball", $player->getLevel()->getChunk($player->getX() >> 4, $player->getZ() >> 4), $nbt, $player);$f = 1.5;$projectile->setMotion($projectile->getMotion()->multiply($f));$projectile->spawnToAll();
PHP: $aimPos = $player->getDirectionVector(); $nbt = new CompoundTag("", [ "Pos" => new ListTag("Pos", [ new DoubleTag("", $player->x), new DoubleTag("", $player->y + $player->getEyeHeight()), new DoubleTag("", $player->z) ]), "Motion" => new ListTag("Motion", [ new DoubleTag("", $aimPos->x), new DoubleTag("", $aimPos->y), new DoubleTag("", $aimPos->z) ]), "Rotation" => new ListTag("Rotation", [ new FloatTag("", $player->yaw), new FloatTag("", $player->pitch) ]), "Health" => new ShortTag("Health", 5), "Item" => new CompoundTag("Item", [ "id" => new ShortTag("id", Item::GOLD_INGOT), "Damage" => new ShortTag("Damage", 0), "Count" => new ByteTag("Count", 1), ]), "PickupDelay" => new ShortTag("PickupDelay", 0x7F), ]); $f = 1.5; $ing = Entity::createEntity("Item", $player->getLevel(), $nbt, $player); $ing->setMotion($ing->getMotion()->multiply($f));