help-me pls

Discussion in 'Plugin Development' started by yLucasxz, Feb 11, 2021.

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

    yLucasxz

    Code:
    [17:20:04 ERROR]: Could not pass event AsyncPlayerChatEvent to lChat v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PlayerConnection.chat(PlayerConnection.java:1084) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1022) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PacketPlayInChat$1.run(PacketPlayInChat.java:39) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_282]
            at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_282]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_282]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_282]
            at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
    Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to org.bukkit.entity.Entity
            at lchat.events.LocalChat.Local(LocalChat.java:21) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_282]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_282]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_282]
            at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_282]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            ... 11 more
    
     
  2. Offline

    Strahan

    ...we're not psychic. You need to post code.

    That said, it says right there you are trying to cast an ArrayList to Entity. I assume you have retrieved a Collection of Entities, not an Entity so you need to iterate that rather than cast it.
     
    Kars likes this.
Thread Status:
Not open for further replies.

Share This Page