package vloryn.chest.command;import org.bukkit.Bukkit;import org.bukkit.ChatColor;import org.bukkit.Location;import org.bukkit.Material;import org.bukkit.block.Chest;import org.bukkit.command.Command;import org.bukkit.command.CommandExecutor;import org.bukkit.command.CommandSender;import org.bukkit.entity.Player;import org.bukkit.inventory.Inventory;import org.bukkit.inventory.ItemStack;publicclass evcheststart implements CommandExecutor{@Overridepublic boolean onCommand(CommandSender sender,Command cmd,String w,String[] arg3){Player p =(Player) sender;int x =1000;int z =1000;ItemStackItem1=newItemStack(Material.DIAMOND);Location locChest =newLocation(Bukkit.getWorld(w), x,50, z);
locChest.getBlock().setType(Material.CHEST);Chest chest =(Chest) locChest.getBlock().getState();Inventory chestInv = chest.getInventory();
chestInv.addItem(Item1);
p.sendMessage(ChatColor.GREEN +"Pomyślnie dodano skrzynke w "+ChatColor.GOLD + arg3 +ChatColor.GREEN +" na kordynatach "+ChatColor.GOLD + x +" "+ z);returnfalse;}}
i jak próbuje wywołać komendę (do główne klasy dodałem taką linijkę getCommand("eChestStart").setExecutor(new evcheststart()); ) to wypisuje "An internal error occurred while attempting to perform this commend" wie ktoś jak to naprawić?
Pytanie
TheVloryn6336 0
mam o taki skrypt
i jak próbuje wywołać komendę (do główne klasy dodałem taką linijkę getCommand("eChestStart").setExecutor(new evcheststart()); ) to wypisuje "An internal error occurred while attempting to perform this commend" wie ktoś jak to naprawić?
Odnośnik do komentarza
Udostępnij na innych stronach
6 odpowiedzi na to pytanie
Rekomendowane odpowiedzi