tptoffa sword mostmar teleportal

This commit is contained in:
2025-02-16 18:47:05 +01:00
parent c3799fa3b9
commit 5e03040b1b
9 changed files with 28 additions and 1 deletions

View File

@@ -1,7 +1,9 @@
package hu.jgj52.wolfFFA.Commands;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@@ -26,6 +28,7 @@ public class WolfFfaCommand implements CommandExecutor, TabCompleter {
if (args.length > 1) {
Player target = Bukkit.getPlayer(args[1]);
if (target instanceof Player player) {
player.getInventory().clear();
ItemStack helmet = new ItemStack(Material.DIAMOND_HELMET);
ItemStack chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE);
ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS);
@@ -39,7 +42,16 @@ public class WolfFfaCommand implements CommandExecutor, TabCompleter {
sword.addEnchantment(Enchantment.UNBREAKING, 3);
player.getInventory().setArmorContents(new ItemStack[]{boots, leggings, chestplate, helmet});
player.getInventory().addItem(sword);
player.getInventory().setItem(0, sword);
World world = Bukkit.getWorld("world");
double x = 0;
double y = 1;
double z = 1000;
float yaw = (float) 0;
float pitch = (float) 0;
Location loc = new Location(world, x, y, z, yaw, pitch);
player.teleport(loc);
}
}
break;