Spigot WorldGuard Events 1.14.4-R0

Easy way to get per-player region entry/departure events.

  1. Weby submitted a new resource:

    WorldGuard Events - Easy way to get per-player region entry/departure events.

    Read more about this resource...
     
  2. Weby updated WorldGuard Events with a new update entry:

    Using WorldGuard's API instead of PlayerMoveEvent

    Read the rest of this update entry...
     
  3. Exactly what I was looking for!
     
  4. Would it be possible to not log NPC's (Citizens) entering regions as this treats them as real players. This leads to multiple errors in my plugins when asking for the Unique ID.
     
  5. I will need logs of the errors, as well as the versions of both this plugin and Citizen's.
     
  6. The errors want to tell me that the problem is with my plugins as it throws a NullPointerException. I've checked it and the NullPointerException came from Player#getUniqueId() which is not possible with normal players. When Citizens is not installed, there are no errors. Maybe you could run a check like specified in the Citizens API:
    Code (Text):
    boolean isCitizensNPC = entity.hasMetadata("NPC");
     
  7. Please give me the logs, as your explanation is worth pretty much nothing...
     
  8. Code (Text):
    [19:29:38] [Server thread/ERROR]: Could not pass event RegionEnteredEvent to WizardingIdentities v1.0
    org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:308) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.raidstone.wgevents.Listeners.changeRegions(Listeners.java:94) ~[?:?]
        at net.raidstone.wgevents.Entry.onCrossBoundary(Entry.java:42) ~[?:?]
        at com.sk89q.worldguard.session.Session.testMoveTo(Session.java:208) ~[?:?]
        at com.sk89q.worldguard.session.Session.testMoveTo(Session.java:168) ~[?:?]
        at com.sk89q.worldguard.bukkit.listener.WorldGuardPlayerListener.onPlayerTeleport(WorldGuardPlayerListener.java:419) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:304) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer.teleport(CraftPlayer.java:599) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity.teleport(CraftEntity.java:288) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.citizensnpcs.npc.CitizensNPC.spawn(CitizensNPC.java:233) ~[?:?]
        at net.citizensnpcs.npc.CitizensNPC.spawn(CitizensNPC.java:190) ~[?:?]
        at net.citizensnpcs.EventListen.spawn(EventListen.java:608) ~[?:?]
        at net.citizensnpcs.EventListen.respawnAllFromCoord(EventListen.java:578) ~[?:?]
        at net.citizensnpcs.EventListen.onChunkLoad(EventListen.java:144) ~[?:?]
        at jdk.internal.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:304) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.Chunk.addEntities(Chunk.java:803) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:1560) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.MinecraftServer.postToMainThread(MinecraftServer.java:1569) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:106) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.PlayerChunk.<init>(PlayerChunk.java:46) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.PlayerChunkMap.c(PlayerChunkMap.java:206) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.PlayerChunkMap.addPlayer(PlayerChunkMap.java:261) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.PlayerList.a(PlayerList.java:287) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.PlayerList.onPlayerJoin(PlayerList.java:385) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.PlayerList.a(PlayerList.java:163) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.LoginListener.b(LoginListener.java:150) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.LoginListener.Y_(LoginListener.java:54) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.NetworkManager.a(NetworkManager.java:231) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.ServerConnection.c(ServerConnection.java:120) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:998) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:835) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:733) [spigot.jar:git-Spigot-f6a273b-a639ae4]
        at java.lang.Thread.run(Thread.java:834) [?:?]
    Caused by: java.lang.NullPointerException
        at com.christophe6.wizardingidentities.playerdata.FileFetcher.getBloodStatus(FileFetcher.java:34) ~[?:?]
        at com.christophe6.wizardingidentities.WorldGuardEvents.onRegionEnter(WorldGuardEvents.java:24) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:304) ~[spigot.jar:git-Spigot-f6a273b-a639ae4]
        ... 50 more
     
    As you can see this proves that Citizens NPC's activities when spawning are logged in your plugin.
     
  9. Well, it just proves that your plugin has a nullpointer exception on line 34 of FileFetcher.java...

    Nothing to do with my plugin.

    I can help you troubleshoot if (in private conversation) if you wish, but I see nothing that has anything to do with this plugin.
     
  10. Thats the point. It throws a NullPointerException because your plugin throws all your events for not real players (NPC) and normal players. I can do a lot of checks on my side but I feel like it should be fixed in this plugin as it’s not meant to throw events for NPC’s
     
  11. Sorry, I don't think I will.