Search code examples
javaminecraftbukkit

Error in Spigot when Joining with colored shutdown message


I have a colored shutdown and restart message in Spigot 1.8

spigot.yml:
  restart: "\xa7bServer wird neu gestartet"

bukkit.yml:
  shutdown-message: "\xa7bServer wurde geschlossen!"

Using "\xa7b ..." is the only working way to colorize the messages. \u00a7b §b and $b don´t work.

As soon as a player joines I get an error in the console:

[12:50:26 ERROR]: Could not pass event PlayerJoinEvent to First_Plugin v1.0
org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:305) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.PlayerList.onPlayerJoin(PlayerList.java:272) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.PlayerList.a(PlayerList.java:156) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.LoginListener.b(LoginListener.java:109) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.LoginListener.c(LoginListener.java:41) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.NetworkManager.a(NetworkManager.java:159) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.ServerConnection.c(ServerConnection.java:82) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:800) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot.jar:git-Spigot-c3c767f-33d5de3]
        at java.base/java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.IllegalArgumentException: Invalid page number 1/0
        at org.bukkit.craftbukkit.v1_8_R1.inventory.CraftMetaBook.setPage(CraftMetaBook.java:213) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
        at de.prog_kid.first_plugin.listeners.JoinListener.handlePlayerJoin(JoinListener.java:47) ~[?:?]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
        at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[spigot.jar:git-Spigot-c3c767f-33d5de3]
        ... 14 more
[12:50:26 INFO]: Flatuss[/127.0.0.1:51052] logged in with entity id 29 at ([world] 0.5, 66.0, 0.5)

It´s a local server so I can´t test multiple players. Playing and joining works normaly.

What does the error mean and how can I fix it?


Solution

  • You can see here why it caused an error

    Caused by: java.lang.IllegalArgumentException: Invalid page number 1/0
    

    And here where the error is in this case it's in your JoinListener.java in line 47

    at de.prog_kid.first_plugin.listeners.JoinListener.handlePlayerJoin(JoinListener.java:47)