Executing command gives me an internal (null) error!

Discussion in 'Plugin Development' started by Matthiaantje, Sep 18, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Matthiaantje

    So, I wanted to test the command (to see if working), but when I try executing the command (yes, the plugin IS registered) it gives me "An internal error has occured)

    This is the console:
    Code:
    18.09 09:48:42 [Server] INFO Admins: Matthiaantje 18.09 09:48:42 [Server] INFO CONSOLE issued server command: /list 18.09 09:48:40 [Server] INFO ... 15 more 18.09 09:48:40 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at dev.matthiaantje.vanity.Main.onCommand(Main.java:45) ~[?:?] 18.09 09:48:40 [Server] INFO at dev.matthiaantje.vanity.Main.UI(Main.java:56) ~[?:?] 18.09 09:48:40 [Server] INFO Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_8_R3.inventory.CraftMetaItem cannot be cast to org.bukkit.inventory.meta.SkullMeta 18.09 09:48:40 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_91] 18.09 09:48:40 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_91] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162) [spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot8.jar:git-Spigot-21fe707-e1ebe52] 18.09 09:48:40 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'vanity' in plugin Vanity v0.1 18.09 09:48:40 [Server] ERROR null 18.09 09:48:40 [Server] INFO Matthiaantje issued server command: /vanity 18.09 09:48:38 [Server] INFO Matthiaantje issued server command: /pl 18.09 09:48:30 [Server] INFO GroupManager - INFO - Bukkit Permissions Updated! 18.09 09:48:30 [Server] WARN There is a newer version available: 0.9.9 18.09 09:48:30 [Server] INFO Key accepted and connection successful. 18.09 09:48:30 [Server] INFO ViaVersion detected protocol version: 47 18.09 09:48:30 [Server] INFO No update available! 18.09 09:48:30 [Server] INFO Checking for updates: 18.09 09:48:30 [Multicraft] Skipped 6 lines due to rate limit (30/s) 18.09 09:48:29 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91] 18.09 09:48:29 [Server] INFO at net.gravitydevelopment.updater.Updater$UpdateRunnable.run(Updater.java:713) [WirelessRedstone-2.6.3.jar:?] 18.09 09:48:29 [Server] INFO at net.gravitydevelopment.updater.Updater.access$100(Updater.java:36) [WirelessRedstone-2.6.3.jar:?] 18.09 09:48:29 [Server] INFO at net.gravitydevelopment.updater.Updater.runUpdater(Updater.java:718) [WirelessRedstone-2.6.3.jar:?] 18.09 09:48:29 [Server] INFO at net.gravitydevelopment.updater.Updater.read(Updater.java:643) [WirelessRedstone-2.6.3.jar:?] 18.09 09:48:29 [Server] INFO at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) ~[?:1.8.0_91] 18.09 09:48:29 [Server] INFO at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) ~[?:1.8.0_91] 18.09 09:48:29 [Server] INFO at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840) ~[?:1.8.0_91] 18.09 09:48:29 [Server] INFO java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.curseforge.com/servermods/filesrojectIds=37345 18.09 09:48:29 [Server] ERROR null 18.09 09:48:29 [Server] ERROR Please double-check your configuration to ensure it is correct. 18.09 09:48:29 [Server] ERROR dev.bukkit.org rejected the API key provided in plugins/Updater/config.yml 18.09 09:48:29 [Server] INFO WorldGuard plugin found. WorldGuard support enabled. 18.09 09:48:29 [Server] INFO Enabling ArmorStandTools v2.1.4 18.09 09:48:29 [Server] INFO is enabled! 18.09 09:48:29 [Server] INFO config.yml loaded. 18.09 09:48:29 [Server] INFO Enabling RedstoneCommand v3.1.2 18.09 09:48:29 [Server] INFO WirelessRedstone version 2.6.3 is enabled! 18.09 09:48:29 [Server] INFO Loading Chunks... 18.09 09:48:29 [Server] INFO Registering commands... 18.09 09:48:29 [Server] INFO Using GroupManager for permissions ! 18.09 09:48:29 [Server] INFO Loading Permissions... 18.09 09:48:29 [Server] INFO WirelessRedstone version 2.6.3 is loading... 18.09 09:48:28 [Server] INFO Enabling WirelessRedstone v2.6.3 18.09 09:48:28 [Server] INFO Enabling EssentialsSpawn vTeamCity 18.09 09:48:28 [Server] INFO Links successfully added to array 18.09 09:48:28 [Server] INFO Getting Links... 18.09 09:48:28 [Server] INFO Enabled! 18.09 09:48:28 [Server] INFO Enabling CCTV_Camera v2.8 18.09 09:48:28 [Server] INFO Enabling CustomJoinItems v1.5.2 18.09 09:48:28 [Server] INFO Enabling MyMenu v1.0.4.3 18.09 09:48:28 [Server] INFO Enabling ViaVersion v0.9.8 18.09 09:48:28 [Server] INFO Version 4.5.1 is now enabled. 18.09 09:48:28 [Server] INFO Please download Vault at http://dev.bukkit.org/server-mods/vault/ for Economy and "Permission grant" support. 18.09 09:48:28 [Server] INFO Unable to load Vault dependency - certain economy and permission features will be disabled 18.09 09:48:28 [Server] INFO Enabling ServerSigns v4.5.1 18.09 09:48:28 [Server] INFO Enabling EssentialsChat vTeamCity 18.09 09:48:28 [Server] INFO Train_Carts version 1.75-SNAPSHOT enabled! (1.004s) 18.09 09:48:28 [Server] INFO SignLink detected, support for arrival signs added! 18.09 09:48:28 [Server] INFO Restoring trains and loading nearby chunks... 18.09 09:48:28 [Server] INFO 0 detector rail regions loaded covering 0 blocks 18.09 09:48:27 [Server] INFO 45 Trains have been loaded in 4 worlds. (63 Minecarts) 18.09 09:48:27 [Server] INFO Enabling Train_Carts v1.75-SNAPSHOT 18.09 09:48:26 [Server] INFO Found 266 heads in the database! 18.09 09:48:26 [Server] INFO Enabling ElsweyrsHeads v1.1 18.09 09:48:26 [Server] INFO iDisguise 5.3.6 enabled! 18.09 09:48:26 [Server] INFO Enabling iDisguise v5.3.6 18.09 09:48:26 [Server] INFO Infinite Dispensers & Droppers is enabled! 18.09 09:48:26 [Server] INFO You are using the newest version! 18.09 09:48:26 [Multicraft] Skipped 88 lines due to rate limit (30/s) 18.09 09:48:25 [Server] INFO load de Q2 18.09 09:48:25 [Server] INFO Arena Q2 type: Team 18.09 09:48:25 [Server] INFO load de Q1 18.09 09:48:25 [Server] INFO Arena Q1 type: Solo 18.09 09:48:25 [Server] INFO 2SIZE 18.09 09:48:25 [Server] INFO Found arena : Q2 18.09 09:48:25 [Server] INFO Found arena : Q1 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorPurpleHelm.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorPurpleHelm.yml 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorPurpleChestplate.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorPurpleChestplate.yml 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorRedChestplate.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorRedChestplate.yml 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorPurpleLEGGINGS.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorPurpleLEGGINGS.yml 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorPurpleBoots.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorPurpleBoots.yml 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Hats/JackOHat.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Hats/JackOHat.yml 18.09 09:48:25 [Server] ERROR 0 not a valid Material. Example: APPLE 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Hats/duivel.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Hats/duivel.yml 18.09 09:48:25 [Server] ERROR 0 not a valid Material. Example: APPLE 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Hats/clear.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Hats/clear.yml 18.09 09:48:25 [Server] ERROR 0 not a valid Material. Example: APPLE 18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Hats/Geekpower14.yml found implementation 18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Hats/Geekpower14.yml 18.09 09:48:25 [Server] INFO Enabling Quake v2.4.1 18.09 09:48:25 [Server] INFO Succesfully loaded 222 gate(s) and 31 group(s) 18.09 09:48:25 [Multicraft] Skipped 6 lines due to rate limit (30/s) 18.09 09:48:24 [Server] INFO GroupManager - INFO - Backups will be retained for 24 hours! 18.09 09:48:24 [Server] INFO GroupManager - INFO - Scheduled Data Saving is set for every 10 minutes! 18.09 09:48:24 [Server] INFO GroupManager - INFO - Superperms support enabled. 18.09 09:48:24 [Server] INFO GroupManager - INFO - World Found: world 18.09 09:48:24 [Server] INFO Enabling GroupManager vPre2.14.1.3 FINAL (Phoenix)
    Chat log
    
    
    Here's the plugin.yml
    Code:
    main: dev.matthiaantje.vanity.Main
    name: Vanity
    version: 0.1
    author: Matthiaantje
    description: A nice menu with a bunch of cosmetics!
    commands: vanity: usage: /vanity
    description: Opens the Vanity Menu
    
    and here's the main class
    Code:
    package dev.matthiaantje.vanity;import org.bukkit.Bukkit;import org.bukkit.ChatColor;import org.bukkit.Color;import org.bukkit.Material;import org.bukkit.command.Command;import org.bukkit.command.CommandSender;import org.bukkit.entity.Player;import org.bukkit.event.Listener;import org.bukkit.inventory.Inventory;import org.bukkit.inventory.ItemStack;import org.bukkit.inventory.meta.ItemMeta;import org.bukkit.inventory.meta.LeatherArmorMeta;import org.bukkit.inventory.meta.SkullMeta;import org.bukkit.plugin.java.JavaPlugin;import java.util.UUID;public class Main extends JavaPlugin implements Listener
    {
    public static Inventory UI; public static UUID owner;@Overridepublic void onEnable()
    {
    System.out.println(Color.GREEN + "Vanity is enabled!");}
    @Overridepublic void onDisable()
    {
    System.out.println(Color.GREEN + "Vanity is disabled!");}
    @Overridepublic boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
    {
    if(cmd.getName().equalsIgnoreCase("vanity"))
    {
    if(!(sender instanceof Player))
    {
    System.out.println(Color.RED + "Commands can only be ran by players!");}
    Player p = (Player) sender;owner = p.getUniqueId();UI(p);}
    return false;}
    public void UI(Player p)
    {
    UI = Bukkit.createInventory(null, 54, ChatColor.GOLD + "Vanity Menu!");ItemStack gadgets = new ItemStack(Material.ENDER_PEARL);ItemMeta gadgetsM = gadgets.getItemMeta();gadgetsM.setDisplayName(ChatColor.GREEN + "Gadgets");ItemStack hats = new ItemStack(Material.SKULL);SkullMeta hatsM = (SkullMeta) hats.getItemMeta();hatsM.setOwner("Seska_Rotan");hatsM.setDisplayName(ChatColor.GREEN + "Hats");hats.setItemMeta(hatsM);ItemStack morphs = new ItemStack(Material.SADDLE);ItemMeta morphsM = morphs.getItemMeta();morphsM.setDisplayName(ChatColor.GREEN + "Morphs");morphs.setItemMeta(morphsM);ItemStack mounts = new ItemStack(Material.RED_ROSE);ItemMeta mountsM = mounts.getItemMeta();mountsM.setDisplayName(ChatColor.GREEN + "Mounts");mounts.setItemMeta(mountsM);ItemStack trails = new ItemStack(Material.MAGMA_CREAM);ItemMeta trailM = trails.getItemMeta();trailM.setDisplayName(ChatColor.GREEN + "Trails");trails.setItemMeta(trailM);ItemStack pets = new ItemStack(Material.BONE);ItemMeta petM = pets.getItemMeta();petM.setDisplayName(ChatColor.GREEN + "Pets");pets.setItemMeta(petM);ItemStack suits = new ItemStack(Material.LEATHER_CHESTPLATE);LeatherArmorMeta suitM = (LeatherArmorMeta) suits.getItemMeta();suitM.setDisplayName(ChatColor.GREEN + "Suits");suitM.setColor(Color.GREEN);suits.setItemMeta(suitM);ItemStack emote = new ItemStack(Material.SKULL);SkullMeta emoteM = (SkullMeta) emote.getItemMeta();emoteM.setOwner("7eed1a86-983c-4fd3-95d6-1f085372628a");emoteM.setDisplayName(ChatColor.GREEN + "Emotes");emote.setItemMeta(emoteM);UI.setItem(10, gadgets);UI.setItem(12, hats);UI.setItem(14, emote);UI.setItem(16, trails);UI.setItem(18, suits);UI.setItem(20, morphs);UI.setItem(22, mounts);UI.setItem(24, pets);p.openInventory(UI);}
    }
    
    I know the plugincode is sideways, but you should have enough with the first couple lines :)
    Hope you guys have enough information, I can't seem to figure out why it ain't working :(
     
  2. Offline

    I Al Istannen

    @Matthiaantje
    Nice log:
    Code:
    18.09 09:48:42 [Server] INFO Admins: Matthiaantje
    18.09 09:48:42 [Server] INFO CONSOLE issued server command: /list
    18.09 09:48:40 [Server] INFO ... 15 more
    18.09 09:48:40 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at dev.matthiaantje.vanity.Main.onCommand(Main.java:45) ~[?:?]
    18.09 09:48:40 [Server] INFO at dev.matthiaantje.vanity.Main.UI(Main.java:56) ~[?:?]
    18.09 09:48:40 [Server] INFO Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_8_R3.inventory.CraftMetaItem cannot be cast to org.bukkit.inventory.meta.SkullMeta
    18.09 09:48:40 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_91]
    18.09 09:48:40 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_91]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162) [spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot8.jar:git-Spigot-21fe707-e1ebe52]
    18.09 09:48:40 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'vanity' in plugin Vanity v0.1
    18.09 09:48:40 [Server] ERROR null
    18.09 09:48:40 [Server] INFO Matthiaantje issued server command: /vanity
    18.09 09:48:38 [Server] INFO Matthiaantje issued server command: /pl
    18.09 09:48:30 [Server] INFO GroupManager - INFO - Bukkit Permissions Updated!
    18.09 09:48:30 [Server] WARN There is a newer version available: 0.9.9
    18.09 09:48:30 [Server] INFO Key accepted and connection successful.
    18.09 09:48:30 [Server] INFO ViaVersion detected protocol version: 47
    18.09 09:48:30 [Server] INFO No update available!
    18.09 09:48:30 [Server] INFO Checking for updates:
    18.09 09:48:30 [Multicraft] Skipped 6 lines due to rate limit (30/s)
    18.09 09:48:29 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
    18.09 09:48:29 [Server] INFO at net.gravitydevelopment.updater.Updater$UpdateRunnable.run(Updater.java:713) [WirelessRedstone-2.6.3.jar:?]
    18.09 09:48:29 [Server] INFO at net.gravitydevelopment.updater.Updater.access$100(Updater.java:36) [WirelessRedstone-2.6.3.jar:?]
    18.09 09:48:29 [Server] INFO at net.gravitydevelopment.updater.Updater.runUpdater(Updater.java:718) [WirelessRedstone-2.6.3.jar:?]
    18.09 09:48:29 [Server] INFO at net.gravitydevelopment.updater.Updater.read(Updater.java:643) [WirelessRedstone-2.6.3.jar:?]
    18.09 09:48:29 [Server] INFO at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) ~[?:1.8.0_91]
    18.09 09:48:29 [Server] INFO at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) ~[?:1.8.0_91]
    18.09 09:48:29 [Server] INFO at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840) ~[?:1.8.0_91]
    18.09 09:48:29 [Server] INFO java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.curseforge.com/servermods/filesrojectIds=37345
    18.09 09:48:29 [Server] ERROR null
    18.09 09:48:29 [Server] ERROR Please double-check your configuration to ensure it is correct.
    18.09 09:48:29 [Server] ERROR dev.bukkit.org rejected the API key provided in plugins/Updater/config.yml
    18.09 09:48:29 [Server] INFO WorldGuard plugin found. WorldGuard support enabled.
    18.09 09:48:29 [Server] INFO Enabling ArmorStandTools v2.1.4
    18.09 09:48:29 [Server] INFO is enabled!
    18.09 09:48:29 [Server] INFO config.yml loaded.
    18.09 09:48:29 [Server] INFO Enabling RedstoneCommand v3.1.2
    18.09 09:48:29 [Server] INFO WirelessRedstone version 2.6.3 is enabled!
    18.09 09:48:29 [Server] INFO Loading Chunks...
    18.09 09:48:29 [Server] INFO Registering commands...
    18.09 09:48:29 [Server] INFO Using GroupManager for permissions !
    18.09 09:48:29 [Server] INFO Loading Permissions...
    18.09 09:48:29 [Server] INFO WirelessRedstone version 2.6.3 is loading...
    18.09 09:48:28 [Server] INFO Enabling WirelessRedstone v2.6.3
    18.09 09:48:28 [Server] INFO Enabling EssentialsSpawn vTeamCity
    18.09 09:48:28 [Server] INFO Links successfully added to array
    18.09 09:48:28 [Server] INFO Getting Links...
    18.09 09:48:28 [Server] INFO Enabled!
    18.09 09:48:28 [Server] INFO Enabling CCTV_Camera v2.8
    18.09 09:48:28 [Server] INFO Enabling CustomJoinItems v1.5.2
    18.09 09:48:28 [Server] INFO Enabling MyMenu v1.0.4.3
    18.09 09:48:28 [Server] INFO Enabling ViaVersion v0.9.8
    18.09 09:48:28 [Server] INFO Version 4.5.1 is now enabled.
    18.09 09:48:28 [Server] INFO Please download Vault at http://dev.bukkit.org/server-mods/vault/ for Economy and "Permission grant" support.
    18.09 09:48:28 [Server] INFO Unable to load Vault dependency - certain economy and permission features will be disabled
    18.09 09:48:28 [Server] INFO Enabling ServerSigns v4.5.1
    18.09 09:48:28 [Server] INFO Enabling EssentialsChat vTeamCity
    18.09 09:48:28 [Server] INFO Train_Carts version 1.75-SNAPSHOT enabled! (1.004s)
    18.09 09:48:28 [Server] INFO SignLink detected, support for arrival signs added!
    18.09 09:48:28 [Server] INFO Restoring trains and loading nearby chunks...
    18.09 09:48:28 [Server] INFO 0 detector rail regions loaded covering 0 blocks
    18.09 09:48:27 [Server] INFO 45 Trains have been loaded in 4 worlds. (63 Minecarts)
    18.09 09:48:27 [Server] INFO Enabling Train_Carts v1.75-SNAPSHOT
    18.09 09:48:26 [Server] INFO Found 266 heads in the database!
    18.09 09:48:26 [Server] INFO Enabling ElsweyrsHeads v1.1
    18.09 09:48:26 [Server] INFO iDisguise 5.3.6 enabled!
    18.09 09:48:26 [Server] INFO Enabling iDisguise v5.3.6
    18.09 09:48:26 [Server] INFO Infinite Dispensers & Droppers is enabled!
    18.09 09:48:26 [Server] INFO You are using the newest version!
    18.09 09:48:26 [Multicraft] Skipped 88 lines due to rate limit (30/s)
    18.09 09:48:25 [Server] INFO load de Q2
    18.09 09:48:25 [Server] INFO Arena Q2 type: Team
    18.09 09:48:25 [Server] INFO load de Q1
    18.09 09:48:25 [Server] INFO Arena Q1 type: Solo
    18.09 09:48:25 [Server] INFO 2SIZE
    18.09 09:48:25 [Server] INFO Found arena : Q2
    18.09 09:48:25 [Server] INFO Found arena : Q1
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorPurpleHelm.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorPurpleHelm.yml
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorPurpleChestplate.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorPurpleChestplate.yml
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorRedChestplate.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorRedChestplate.yml
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorPurpleLEGGINGS.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorPurpleLEGGINGS.yml
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Armors/ArmorPurpleBoots.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Armors/ArmorPurpleBoots.yml
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Hats/JackOHat.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Hats/JackOHat.yml
    18.09 09:48:25 [Server] ERROR 0 not a valid Material. Example: APPLE
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Hats/duivel.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Hats/duivel.yml
    18.09 09:48:25 [Server] ERROR 0 not a valid Material. Example: APPLE
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Hats/clear.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Hats/clear.yml
    18.09 09:48:25 [Server] ERROR 0 not a valid Material. Example: APPLE
    18.09 09:48:25 [Server] INFO plugins/Quake/Stuff/Hats/Geekpower14.yml found implementation
    18.09 09:48:25 [Server] WARN plugins/Quake/Stuff/Hats/Geekpower14.yml
    18.09 09:48:25 [Server] INFO Enabling Quake v2.4.1
    18.09 09:48:25 [Server] INFO Succesfully loaded 222 gate(s) and 31 group(s)
    18.09 09:48:25 [Multicraft] Skipped 6 lines due to rate limit (30/s)
    18.09 09:48:24 [Server] INFO GroupManager - INFO - Backups will be retained for 24 hours!
    18.09 09:48:24 [Server] INFO GroupManager - INFO - Scheduled Data Saving is set for every 10 minutes!
    18.09 09:48:24 [Server] INFO GroupManager - INFO - Superperms support enabled.
    18.09 09:48:24 [Server] INFO GroupManager - INFO - World Found: world
    18.09 09:48:24 [Server] INFO Enabling GroupManager vPre2.14.1.3 FINAL (Phoenix)
    Nicer main class:
    Code:
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Color;
    import org.bukkit.Material;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.inventory.Inventory;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;
    import org.bukkit.inventory.meta.LeatherArmorMeta;
    import org.bukkit.inventory.meta.SkullMeta;
    import org.bukkit.plugin.java.JavaPlugin;
    
    import java.util.UUID;
    
    public class Main extends JavaPlugin implements Listener {
        public static Inventory UI;
        public static UUID owner;
    
        @Override
        public void onEnable() {
            System.out.println(Color.GREEN + "Vanity is enabled!");
        }
    
        @Override
        public void onDisable() {
            System.out.println(Color.GREEN + "Vanity is disabled!");
        }
    
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if (cmd.getName().equalsIgnoreCase("vanity")) {
                if (!(sender instanceof Player)) {
                    System.out.println(Color.RED + "Commands can only be ran by players!");
                }
                Player p = (Player) sender;
                owner = p.getUniqueId();
                UI(p);
            }
            return false;
        }
    
        public void UI(Player p) {
            UI = Bukkit.createInventory(null, 54, ChatColor.GOLD + "Vanity Menu!");
            ItemStack gadgets = new ItemStack(Material.ENDER_PEARL);
            ItemMeta gadgetsM = gadgets.getItemMeta();
            gadgetsM.setDisplayName(ChatColor.GREEN + "Gadgets");
            ItemStack hats = new ItemStack(Material.SKULL);
            SkullMeta hatsM = (SkullMeta) hats.getItemMeta();
            hatsM.setOwner("Seska_Rotan");
            hatsM.setDisplayName(ChatColor.GREEN + "Hats");
            hats.setItemMeta(hatsM);
            ItemStack morphs = new ItemStack(Material.SADDLE);
            ItemMeta morphsM = morphs.getItemMeta();
            morphsM.setDisplayName(ChatColor.GREEN + "Morphs");
            morphs.setItemMeta(morphsM);
            ItemStack mounts = new ItemStack(Material.RED_ROSE);
            ItemMeta mountsM = mounts.getItemMeta();
            mountsM.setDisplayName(ChatColor.GREEN + "Mounts");
            mounts.setItemMeta(mountsM);
            ItemStack trails = new ItemStack(Material.MAGMA_CREAM);
            ItemMeta trailM = trails.getItemMeta();
            trailM.setDisplayName(ChatColor.GREEN + "Trails");
            trails.setItemMeta(trailM);
            ItemStack pets = new ItemStack(Material.BONE);
            ItemMeta petM = pets.getItemMeta();
            petM.setDisplayName(ChatColor.GREEN + "Pets");
            pets.setItemMeta(petM);
            ItemStack suits = new ItemStack(Material.LEATHER_CHESTPLATE);
            LeatherArmorMeta suitM = (LeatherArmorMeta) suits.getItemMeta();
            suitM.setDisplayName(ChatColor.GREEN + "Suits");
            suitM.setColor(Color.GREEN);
            suits.setItemMeta(suitM);
            ItemStack emote = new ItemStack(Material.SKULL);
            SkullMeta emoteM = (SkullMeta) emote.getItemMeta();
            emoteM.setOwner("7eed1a86-983c-4fd3-95d6-1f085372628a");
            emoteM.setDisplayName(ChatColor.GREEN + "Emotes");
            emote.setItemMeta(emoteM);
            UI.setItem(10, gadgets);
            UI.setItem(12, hats);
            UI.setItem(14, emote);
            UI.setItem(16, trails);
            UI.setItem(18, suits);
            UI.setItem(20, morphs);
            UI.setItem(22, mounts);
            UI.setItem(24, pets);
            p.openInventory(UI);
        }
    }
    The error is this:
    You need to use "SKULL_ITEM", "SKULL" is the placable block.

    Please fix your formatting next time ;)
     
  3. Offline

    Matthiaantje

    Nope, still doesn't work :(
     
  4. Offline

    I Al Istannen

    @Matthiaantje
    New code and error?

    And please "Tahg" me, so I see your post.
    Write "@" and then the name or click on "Tahg User" in the lower right of every post.
     
  5. Offline

    Matthiaantje

    @I Al Istannen
    Nothing is solved, I guess, still the sam error, it ives me a null error in the console... is there something with my plugin.yml maybe?
     
  6. Offline

    I Al Istannen

    @Matthiaantje
    Could you post your updated code? And the new error you get?
    Otherwise I can't help you.

    Despite that, it isn't a null error, it was a ClassCastException. If you are not able to tell the difference, you should consider learning a bit more java before making plugins. It really helps.
     
  7. Offline

    Matthiaantje

    It's stille the same code, only Material.SKULL is now Material.SKULLITEM
     
  8. Offline

    I Al Istannen

    @Matthiaantje
    Tahg me.
    I hope you just missed the underscore between "SKULL" and "ITEM".

    And please show me your code notheless as well as the error.
     
  9. Offline

    Matthiaantje

    @I Al Istannen

    Alright, sooo, there seems to be a problem within this UI- void, (Made a debug message IG)
    here's the class:
    http://pastebin.com/V4Wk567V

    I think the problem is with the small piece of code where I try to get a 3D-Skull, But I only have this...

    code for the skull:
    ItemStack emote = new ItemStack(Material.SKULL);
    SkullMeta emoteM = (SkullMeta) emote.getItemMeta();
    emoteM.setOwner("7eed1a86-983c-4fd3-95d6-1f085372628a");
    emoteM.setDisplayName(ChatColor.GREEN + "Emotes");
    emote.setItemMeta(emoteM);

    Skull =>
    http://minecraft-heads.com/database/miscellaneous/item/537-emoticon-smile

    IS there any possibilitie to get a 3D Skull? If so, does anybody know a good resource?
    (Still the same error)

    Thanks,
    Matthiaantje
     
  10. Offline

    RenditionsRule

    @Matthiaantje

    You still haven't changed it to SKULL_ITEM. They will automatically display as a 3D skull in your inventory.
     
  11. Offline

    Matthiaantje

    Last edited: Sep 18, 2016
  12. Offline

    I Al Istannen

    @Matthiaantje
    You will need to edit the NBT data.

    This is heavy spoonfeeding, but this can't really be done otherwise as it depends on the item structure.

    Your item's NBT tag:
    PHP:
    NBTTagCompound{
        
    map={
            
    SkullOwner=NBTTagCompound{
                
    map={
                    
    Id=NBTTagString{
                        
    string='7eed1a86-983c-4fd3-95d6-1f085372628a'
                    
    },
                    
    Properties=NBTTagCompound{
                        
    map={
                            
    textures=NBTTagList{
                                list=[
                                    
    NBTTagCompound{
                                        
    map={
                                            
    Value=NBTTagString{
                                                
    string='eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTJlOTgxNjVkZWVmNGVkNjIxOTUzOTIxYzFlZjgxN2RjNjM4YWY3MWMxOTM0YTQyODdiNjlkN2EzMWY2YjgifX19'
                                            
    }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                }
            },
            
    display=NBTTagCompound{
                
    map={
                    
    Name=NBTTagString{
                        
    string='Smile'
                    
    }
                }
            }
        }
    }
    We will need to adjust the "Id" and the "Value".
    In code you could use this:

    Code:java
    1. private ItemStack getCustomHead(String uuid, String texture) {
    2. ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    3.  
    4. NBTTagCompound itemRootTag = ItemNBTUtil.getTag(item);
    5.  
    6. NBTTagCompound skullOwnerTag = new NBTTagCompound();
    7. // set the UUID. Must be an invalid one, or it will show the skin of that person
    8. skullOwnerTag.setString("Id", uuid);
    9.  
    10. // the properties tag
    11. NBTTagCompound properties = new NBTTagCompound();
    12. {
    13. // the textures. Is a list.
    14. NBTTagList textures = new NBTTagList();
    15.  
    16. {
    17. // the skin value
    18. NBTTagCompound texturesTag = new NBTTagCompound();
    19. texturesTag.setString("Value", texture);
    20.  
    21. textures.add(texturesTag);
    22. }
    23.  
    24. properties.set("textures", textures);
    25. }
    26. skullOwnerTag.set("Properties", properties);
    27.  
    28. // apply to root tag
    29. itemRootTag.set("SkullOwner", skullOwnerTag);
    30.  
    31. return ItemNBTUtil.setNBTTag(itemRootTag, item);
    32. }

    The curly brackets in the code are just to make it visually more appealing. The scope is irrelevant.

    Now you will notice two things.
    1. There is no ItemNbtUtil
    2. The NBTTagCompound and so on make you dependend on one version (due to the imports). You could use reflection to solve this, but it will make the code unreadable.
    I made that using a collection of Wrappers I wrote for NBT-Tags, to make dealing with them more pleasant.
    You will need to copy the "NBTWrappers" and "ItemNBTUtil" as well as the "ReflectionUtil" to your project.


    Then just pass the method the values you want and you are done.
     
    Matthiaantje likes this.
  13. Offline

    I Al Istannen

    @bwfcwalshy
    Searched for that and couldn't find it... Thanks :p
     
  14. Matthiaantje likes this.
Thread Status:
Not open for further replies.

Share This Page