Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
[21:27:37 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[21:27:37 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[21:27:37 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[21:27:37 INFO]: [Skript] Server Version: git-Paper-58 (MC: 1.20.1)
[21:27:37 INFO]: [Skript] Skript Version: 2.7.0-beta3 (skriptlang-github)
[21:27:37 INFO]: [Skript] Installed Skript Addons:
[21:27:37 INFO]: [Skript] - SkQuery v4.1.9
[21:27:37 INFO]: [Skript] - SkBee v2.13.0 (https://github.com/ShaneBeee/SkBee)
[21:27:37 INFO]: [Skript] Installed dependencies:
[21:27:37 INFO]: [Skript] - WorldGuard v7.0.9-beta1+2249-223b80c
Bug Description
Using a "loop entities" loop within an on chat event completely ignores said loop:
The following is my code. Everything runs smoothly, but everything between the "loop all entities in radius 12 around player:" and "kill loop-entity" lines does not run at all and returns a big red error in the console. The script loads with no errors.
on chat:
{correctanswer.%player%} is set
set {_l} to location of player
set {_corr} to 1 if (message) parsed as a number = round({correctanswer.%player%})
set {_corr} to 1 if (message) in uppercase = {correctanswer.%player%} in uppercase
set {_corr} to 1 if message = "%{correctanswer.%player%}%"
if {_corr} = 1:
send title "" with subtitle "&6&lGood job!" to player for 3 seconds with fadein 0 second and fadeout 0 second
clear {correctanswer.%player%}
playSoundAtPlayer("entity.player.levelup",player,0.5)
#defuseBomb(player)
**loop all entities in radius 12 around player:
broadcast "%loop-entity%"
metadata tag "summontype" of loop-entity contains "bomb"
broadcast "bomb found"
kill loop-entity**
wait 1 second
loop randInt(4,12) times:
set {_r} to randInt(1,4)
drop {redlucky} at player if {_r} = 1
drop {aqualucky} at player if {_r} = 2
drop {greenlucky} at player if {_r} = 3
drop {orangelucky} at player if {_r} = 4
wait 1 tick
playSoundAtPlayer("entity.item.pickup",player,0.25)
Expected Behavior
I'm expecting the code to loop all the armor stands, check if their metadata tag "summontype" contains "bomb"; broadcast at every step, and kill the looped armor stand if so.
Steps to Reproduce
Put a loop entities loop around the player, within an "on chat": condition. Tried this on Paper & Purpur 1.20.1 with Skript 2.7.0-beta3.
Errors or Screenshots
21:13:08 ERROR: Thread Async Chat Thread - #184 failed main thread check: getNearbyEntities
java.lang.Throwable: null
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[purpur-1.20.1.jar:git-Purpur-1995]
at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1087) ~[purpur-1.20.1.jar:git-Purpur-1995]
at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1077) ~[purpur-1.20.1.jar:git-Purpur-1995]
at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1068) ~[purpur-1.20.1.jar:git-Purpur-1995]
at ch.njol.skript.expressions.ExprEntities.iterator(ExprEntities.java:171) ~[Skript-2.7.0-beta3 (2).jar:?]
at ch.njol.skript.sections.SecLoop.walk(SecLoop.java:134) ~[Skript-2.7.0-beta3 (2).jar:?]
at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90) ~[Skript-2.7.0-beta3 (2).jar:?]
at ch.njol.skript.lang.Trigger.execute(Trigger.java:52) ~[Skript-2.7.0-beta3 (2).jar:?]
at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:146) ~[Skript-2.7.0-beta3 (2).jar:?]
at ch.njol.skript.SkriptEventHandler.access$000(SkriptEventHandler.java:50) ~[Skript-2.7.0-beta3 (2).jar:?]
at ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:63) ~[Skript-2.7.0-beta3 (2).jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:git-Purpur-1995]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.1.jar:git-Purpur-1995]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.1.jar:git-Purpur-1995]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.adventure.ChatProcessor.post(ChatProcessor.java:414) ~[purpur-1.20.1.jar:git-Purpur-1995]
at io.papermc.paper.adventure.ChatProcessor.process(ChatProcessor.java:100) ~[purpur-1.20.1.jar:git-Purpur-1995]
at net.minecraft.server.network.ServerGamePacketListenerImpl.chat(ServerGamePacketListenerImpl.java:2497) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.broadcastChatMessage(ServerGamePacketListenerImpl.java:2653) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChat$18(ServerGamePacketListenerImpl.java:2325) ~[?:?]
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
21:13:08 ERROR: #!#! Something went horribly wrong with Skript.
21:13:08 ERROR: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
21:13:08 ERROR: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
21:13:08 ERROR: #!#! Here is full list of them:
21:13:08 ERROR: #!#! SkBee v2.13.0 (https://github.com/ShaneBeee/SkBee) SkQuery v4.1.9
21:13:08 ERROR: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
21:13:08 ERROR: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
21:13:08 ERROR: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
21:13:08 ERROR: #!#! In that case, you will be given instruction on how should you report it.
21:13:08 ERROR: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
21:13:08 ERROR: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
21:13:08 ERROR: #!#! Stack trace:
21:13:08 ERROR: #!#! java.lang.IllegalStateException: Asynchronous getNearbyEntities!
21:13:08 ERROR: #!#! at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:16)
21:13:08 ERROR: #!#! at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1087)
21:13:08 ERROR: #!#! at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1077)
21:13:08 ERROR: #!#! at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1068)
21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.expressions.ExprEntities.iterator(ExprEntities.java:171)
21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.sections.SecLoop.walk(SecLoop.java:134)
21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90)
21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:52)
21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:146)
21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.SkriptEventHandler.access$000(SkriptEventHandler.java:50)
21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:63)
21:13:08 ERROR: #!#! at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77)
21:13:08 ERROR: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
21:13:08 ERROR: #!#! at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
21:13:08 ERROR: #!#! at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126)
21:13:08 ERROR: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617)
21:13:08 ERROR: #!#! at io.papermc.paper.adventure.ChatProcessor.post(ChatProcessor.java:414)
21:13:08 ERROR: #!#! at io.papermc.paper.adventure.ChatProcessor.process(ChatProcessor.java:100)
21:13:08 ERROR: #!#! at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:2497)
21:13:08 ERROR: #!#! at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:2653)
21:13:08 ERROR: #!#! at net.minecraft.server.network.PlayerConnection.lambda$handleChat$18(PlayerConnection.java:2325)
21:13:08 ERROR: #!#! at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
21:13:08 ERROR: #!#! at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
21:13:08 ERROR: #!#! at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
21:13:08 ERROR: #!#! at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
21:13:08 ERROR: #!#! at java.base/java.lang.Thread.run(Thread.java:833)
21:13:08 ERROR: #!#! Current node: null
21:13:08 ERROR: #!#! Current item: loop all entities of type [[entitydata:entity]] in radius [[long:12]] around (the player >> ch.njol.skript.classes.data.DefaultConverters$$Lambda$7305/0x000000080209f820@5508e898: ConverterInfo{from=interface org.bukkit.entity.Entity,to=class org.bukkit.Location,converter=ch.njol.skript.classes.data.DefaultConverters$$Lambda$7305/0x000000080209f820@5508e898,flag=4})
21:13:08 ERROR: #!#! Current trigger: chat (simple event) (blockitems/greenitems.sk, line 224)
The on chat event is asynchronous and thus you cannot use any world related synatxes within the on chat event. There is currently a pull request to synchronize.
Skript/Server Version
Bug Description
Using a "loop entities" loop within an on chat event completely ignores said loop: The following is my code. Everything runs smoothly, but everything between the "loop all entities in radius 12 around player:" and "kill loop-entity" lines does not run at all and returns a big red error in the console. The script loads with no errors.
Expected Behavior
I'm expecting the code to loop all the armor stands, check if their metadata tag "summontype" contains "bomb"; broadcast at every step, and kill the looped armor stand if so.
Steps to Reproduce
Put a loop entities loop around the player, within an "on chat": condition. Tried this on Paper & Purpur 1.20.1 with Skript 2.7.0-beta3.
Errors or Screenshots
21:13:08 ERROR: Thread Async Chat Thread - #184 failed main thread check: getNearbyEntities java.lang.Throwable: null at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[purpur-1.20.1.jar:git-Purpur-1995] at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1087) ~[purpur-1.20.1.jar:git-Purpur-1995] at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1077) ~[purpur-1.20.1.jar:git-Purpur-1995] at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1068) ~[purpur-1.20.1.jar:git-Purpur-1995] at ch.njol.skript.expressions.ExprEntities.iterator(ExprEntities.java:171) ~[Skript-2.7.0-beta3 (2).jar:?] at ch.njol.skript.sections.SecLoop.walk(SecLoop.java:134) ~[Skript-2.7.0-beta3 (2).jar:?] at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90) ~[Skript-2.7.0-beta3 (2).jar:?] at ch.njol.skript.lang.Trigger.execute(Trigger.java:52) ~[Skript-2.7.0-beta3 (2).jar:?] at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:146) ~[Skript-2.7.0-beta3 (2).jar:?] at ch.njol.skript.SkriptEventHandler.access$000(SkriptEventHandler.java:50) ~[Skript-2.7.0-beta3 (2).jar:?] at ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:63) ~[Skript-2.7.0-beta3 (2).jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:git-Purpur-1995] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.1.jar:git-Purpur-1995] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.1.jar:git-Purpur-1995] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.adventure.ChatProcessor.post(ChatProcessor.java:414) ~[purpur-1.20.1.jar:git-Purpur-1995] at io.papermc.paper.adventure.ChatProcessor.process(ChatProcessor.java:100) ~[purpur-1.20.1.jar:git-Purpur-1995] at net.minecraft.server.network.ServerGamePacketListenerImpl.chat(ServerGamePacketListenerImpl.java:2497) ~[?:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.broadcastChatMessage(ServerGamePacketListenerImpl.java:2653) ~[?:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChat$18(ServerGamePacketListenerImpl.java:2325) ~[?:?] at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?] at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:833) ~[?:?]
21:13:08 ERROR: #!#! [Skript] Severe Error:
21:13:08 ERROR: #!#! Something went horribly wrong with Skript. 21:13:08 ERROR: #!#! This issue is NOT your fault! You probably can't fix it yourself, either. 21:13:08 ERROR: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons). 21:13:08 ERROR: #!#! Here is full list of them: 21:13:08 ERROR: #!#! SkBee v2.13.0 (https://github.com/ShaneBeee/SkBee) SkQuery v4.1.9 21:13:08 ERROR: #!#! We could not identify which of those are specially related, so this might also be Skript issue. 21:13:08 ERROR: #!#! You should try disabling those plugins one by one, trying to find which one causes it. 21:13:08 ERROR: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue. 21:13:08 ERROR: #!#! In that case, you will be given instruction on how should you report it. 21:13:08 ERROR: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin. 21:13:08 ERROR: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
21:13:08 ERROR: #!#! Stack trace: 21:13:08 ERROR: #!#! java.lang.IllegalStateException: Asynchronous getNearbyEntities! 21:13:08 ERROR: #!#! at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:16) 21:13:08 ERROR: #!#! at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1087) 21:13:08 ERROR: #!#! at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1077) 21:13:08 ERROR: #!#! at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.getNearbyEntities(CraftWorld.java:1068) 21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.expressions.ExprEntities.iterator(ExprEntities.java:171) 21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.sections.SecLoop.walk(SecLoop.java:134) 21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:90) 21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:52) 21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:146) 21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.SkriptEventHandler.access$000(SkriptEventHandler.java:50) 21:13:08 ERROR: #!#! at Skript-2.7.0-beta3 (2).jar//ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:63) 21:13:08 ERROR: #!#! at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) 21:13:08 ERROR: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) 21:13:08 ERROR: #!#! at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) 21:13:08 ERROR: #!#! at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) 21:13:08 ERROR: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) 21:13:08 ERROR: #!#! at io.papermc.paper.adventure.ChatProcessor.post(ChatProcessor.java:414) 21:13:08 ERROR: #!#! at io.papermc.paper.adventure.ChatProcessor.process(ChatProcessor.java:100) 21:13:08 ERROR: #!#! at net.minecraft.server.network.PlayerConnection.chat(PlayerConnection.java:2497) 21:13:08 ERROR: #!#! at net.minecraft.server.network.PlayerConnection.b(PlayerConnection.java:2653) 21:13:08 ERROR: #!#! at net.minecraft.server.network.PlayerConnection.lambda$handleChat$18(PlayerConnection.java:2325) 21:13:08 ERROR: #!#! at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) 21:13:08 ERROR: #!#! at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) 21:13:08 ERROR: #!#! at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) 21:13:08 ERROR: #!#! at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) 21:13:08 ERROR: #!#! at java.base/java.lang.Thread.run(Thread.java:833)
21:13:08 ERROR: #!#! Version Information: 21:13:08 ERROR: #!#! Skript: 2.7.0-beta3 (latest) 21:13:08 ERROR: #!#! Flavor: skriptlang-github 21:13:08 ERROR: #!#! Date: 03:18:03.366646700 21:13:08 ERROR: #!#! Bukkit: 1.20.1-R0.1-SNAPSHOT 21:13:08 ERROR: #!#! Minecraft: 1.20.1 21:13:08 ERROR: #!#! Java: 18.0.2 (OpenJDK 64-Bit Server VM 18.0.2+9-61) 21:13:08 ERROR: #!#! OS: Linux amd64 5.10.0-21-amd64
21:13:08 ERROR: #!#! Server platform: Paper
21:13:08 ERROR: #!#! Current node: null 21:13:08 ERROR: #!#! Current item: loop all entities of type [[entitydata:entity]] in radius [[long:12]] around (the player >> ch.njol.skript.classes.data.DefaultConverters$$Lambda$7305/0x000000080209f820@5508e898: ConverterInfo{from=interface org.bukkit.entity.Entity,to=class org.bukkit.Location,converter=ch.njol.skript.classes.data.DefaultConverters$$Lambda$7305/0x000000080209f820@5508e898,flag=4}) 21:13:08 ERROR: #!#! Current trigger: chat (simple event) (blockitems/greenitems.sk, line 224)
21:13:08 ERROR: #!#! Thread: Async Chat Thread - #184
21:13:08 ERROR: #!#! Language: english 21:13:08 ERROR: #!#! Link parse mode: DISABLED
21:13:08 ERROR: #!#! End of Error.
Other
Please update me if this gets fixed, a large chunk of my script doesn't work because of this and i've been looking for solutions to this all day...
Agreement