Jump to content

addItem fehler bei Data


nitan
 Share

Recommended Posts

Hallo ich habe ein script geschrieben das unten ich ein kleiner teil davon er macht auch das was er soll er kopiert die items doch bekomme ich immer eine fehlermeldung in der console:

17:58:09 [SEVERE] nullorg.bukkit.command.CommandException: Unhandled exception executing command 'vk'in plugin warenhaus v0.1        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)        at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServer.java:523)        at net.minecraft.server.v1_5_R3.PlayerConnection.handleCommand(PlayerConnection.java:971)        at net.minecraft.server.v1_5_R3.PlayerConnection.chat(PlayerConnection.java:889)        at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:846)        at net.minecraft.server.v1_5_R3.Packet3Chat.handle(Packet3Chat.java:44)        at net.minecraft.server.v1_5_R3.NetworkManager.b(NetworkManager.java:292)        at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:115)        at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)        at net.minecraft.server.v1_5_R3.DedicatedServerConnection.b(SourceFile:30)        at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:581)        at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)        at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)Caused by: java.lang.ArrayIndexOutOfBoundsException: 1        at me.nitan.warenhaus.warenhaus.onCommand(warenhaus.java:89)        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)        ... 15 more>

srcipt:

Player p = (Player) sender;int Anzahl = p.getItemInHand().getAmount();int Material = p.getItemInHand().getTypeId();byte xData = p.getItemInHand().getData().getData();short Haltbarkeit = p.getItemInHand().getDurability();ItemStack item =new ItemStack(Material, Anzahl, Haltbarkeit, xData);p.getInventory().addItem(item);
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...
B
B