- Баллы
- 76
- Имя в Minecraft
- _MasterCapeXD_
Вообщем, плагин должен так работать:
Плагин проверяет блок, на который кликаешь, если это голова, то голова удаляется, а игроку пишет сообщение и выдает ему 5 монеток.
Вот ошибка консоли:
Вот код класса:
Плагин проверяет блок, на который кликаешь, если это голова, то голова удаляется, а игроку пишет сообщение и выдает ему 5 монеток.
Вот ошибка консоли:
[14:15:48] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to Lobby v1.0
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:228) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:195) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:191) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1203) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInArmAnimation.a(PacketPlayInArmAnimation.java:18) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInArmAnimation.a(PacketPlayInArmAnimation.java:1) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_111]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:772) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:711) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:614) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
Caused by: java.lang.NullPointerException
at master.cape.lobby.HappyEvent.onClickHead(HappyEvent.java:24) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
... 18 more
[14:16:06] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to Lobby v1.0
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:228) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerInteractManager.interact(PlayerInteractManager.java:463) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:762) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:52) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_111]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:772) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:711) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:614) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
Caused by: java.lang.NullPointerException
at master.cape.lobby.HappyEvent.onClickHead(HappyEvent.java:29) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
... 17 more
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:228) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:195) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:191) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1203) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInArmAnimation.a(PacketPlayInArmAnimation.java:18) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInArmAnimation.a(PacketPlayInArmAnimation.java:1) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_111]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:772) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:711) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:614) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
Caused by: java.lang.NullPointerException
at master.cape.lobby.HappyEvent.onClickHead(HappyEvent.java:24) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
... 18 more
[14:16:06] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to Lobby v1.0
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:228) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerInteractManager.interact(PlayerInteractManager.java:463) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:762) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:52) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_111]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:772) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:711) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:614) [lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
Caused by: java.lang.NullPointerException
at master.cape.lobby.HappyEvent.onClickHead(HappyEvent.java:29) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[lobby1.jar:git-PaperSpigot-0d986bb-18fbb24]
... 17 more
Вот код класса:
Код:
package master.cape.lobby;
import org.bukkit.entity.Player;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
public class HappyEvent implements Listener
{
public static Economy econ;
@EventHandler
public void onClickHead(PlayerInteractEvent e)
{
Player clicker = (Player) e.getPlayer();
Location loc = e.getClickedBlock().getLocation();
if(e.getClickedBlock().getType() == Material.SKULL)
{
EconomyResponse r = econ.depositPlayer(clicker, 5.00);
if(r.transactionSuccess())
{
e.getClickedBlock().setType(Material.AIR);
clicker.playSound(loc, Sound.ITEM_PICKUP, 1, 1);
clicker.sendMessage(ChatColor.WHITE+"Вы нашли голову и получили"+ChatColor.AQUA+" 5 "+ChatColor.WHITE+"монеток!");
}
}
}
}