
Using blockdata in click event and clicking an entity crashes the server
Closed this issue ยท 13 comments
Skript/Server Version
[09:10:15 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[09:10:15 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[09:10:15 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[09:10:15 INFO]: [Skript] Server Version: git-Purpur-2176 (MC: 1.20.4)
[09:10:15 INFO]: [Skript] Skript Version: 2.11.1 (skriptlang-github)
[09:10:15 INFO]: [Skript] Installed Skript Addons: None
[09:10:15 INFO]: [Skript] Installed dependencies: None
Bug Description
I got this skript
on rightclick:
if player's tool is clock:
set {cords::%player's uuid%} to location at player
broadcast "Set location of missile to %{cords::%player's uuid%}%"
play sound "ui.button.click" with volume 1 and pitch 0 to the player
it works fine but if you click a entity the server explodes
Expected Behavior
Server doesnt throw errors and doesnt crashes
Steps to Reproduce
1.21.1
using latest version of skript using my example
on rightclick:
if player's tool is clock:
set {cords::%player's uuid%} to location at player
broadcast "Set location of missile to %{cords::%player's uuid%}%"
play sound "ui.button.click" with volume 1 and pitch 0 to the player
Errors or Screenshots
[09:36:06] [Server thread/INFO]: Set location of missile to x: -380.38, y: 79.12, z: -299.56, yaw: -86.53, pitch: 55.21 in 'world'
[09:36:06] [Server thread/ERROR]: #!#!
[09:36:06] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[09:36:06] [Server thread/ERROR]: #!#!
[09:36:06] [Server thread/ERROR]: #!#! An unexpected error occurred with Skript. This issue is likely not your fault.
[09:36:06] [Server thread/ERROR]: #!#! Report the issue: https://github.com/SkriptLang/Skript/issues
[09:36:06] [Server thread/ERROR]: #!#!
[09:36:06] [Server thread/ERROR]: #!#! Stack trace:
[09:36:06] [Server thread/ERROR]: #!#! Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R3.block.impl.CraftButtonAbstract cannot be cast to class ch.njol.skript.aliases.ItemType (org.bukkit.craftbukkit.v1_20_R3.block.impl.CraftButtonAbstract is in unnamed module of loader java.net.URLClassLoader @7c469c48; ch.njol.skript.aliases.ItemType is in unnamed module of loader 'Skript-2.11.1.jar' @15eaad27)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.events.EvtClick.lambda$check$1(EvtClick.java:182)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.lang.util.SimpleExpression.check(SimpleExpression.java:148)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.lang.util.SimpleLiteral.check(SimpleLiteral.java:159)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.events.EvtClick.check(EvtClick.java:177)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.SkriptEventHandler.lambda$execute$3(SkriptEventHandler.java:175)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.util.Task.callSync(Task.java:147)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.util.Task.callSync(Task.java:131)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.SkriptEventHandler.execute(SkriptEventHandler.java:174)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:120)
[09:36:06] [Server thread/ERROR]: #!#! at Skript-2.11.1.jar//ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:46)
[09:36:06] [Server thread/ERROR]: #!#! at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77)
[09:36:06] [Server thread/ERROR]: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[09:36:06] [Server thread/ERROR]: #!#! at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
[09:36:06] [Server thread/ERROR]: #!#! at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126)
[09:36:06] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.network.PlayerConnection$4.performInteraction(PlayerConnection.java:2794)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.network.PlayerConnection$4.a(PlayerConnection.java:2844)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.game.PacketPlayInUseEntity$d.a(PacketPlayInUseEntity.java:129)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.game.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:80)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2783)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.game.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:67)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.game.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:12)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$ensureRunningOnSameThread$0(PlayerConnectionUtils.java:54)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.TickTask.run(TickTask.java:18)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.util.thread.IAsyncTaskHandler.d(IAsyncTaskHandler.java:149)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(IAsyncTaskHandlerReentrant.java:24)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1498)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.util.thread.IAsyncTaskHandler.x(IAsyncTaskHandler.java:123)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.bl(MinecraftServer.java:1475)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1398)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.util.thread.IAsyncTaskHandler.c(IAsyncTaskHandler.java:133)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.w_(MinecraftServer.java:1376)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1265)
[09:36:06] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323)
[09:36:06] [Server thread/ERROR]: #!#! at java.base/java.lang.Thread.run(Thread.java:1583)
[09:36:06] [Server thread/ERROR]: #!#!
[09:36:06] [Server thread/ERROR]: #!#! Skript: 2.11.1 (latest)
[09:36:06] [Server thread/ERROR]: #!#! Flavor: skriptlang-github
[09:36:06] [Server thread/ERROR]: #!#! Date: 13:14:03.650447100
[09:36:06] [Server thread/ERROR]: #!#! Bukkit: 1.20.4-R0.1-SNAPSHOT
[09:36:06] [Server thread/ERROR]: #!#! Minecraft: 1.20.4
[09:36:06] [Server thread/ERROR]: #!#! Java: 21.0.7 (OpenJDK 64-Bit Server VM 21.0.7+6-LTS)
[09:36:06] [Server thread/ERROR]: #!#! OS: Linux aarch64 6.8.0-1016-oracle
[09:36:06] [Server thread/ERROR]: #!#!
[09:36:06] [Server thread/ERROR]: #!#! Server platform: Paper
[09:36:06] [Server thread/ERROR]: #!#!
[09:36:06] [Server thread/ERROR]: #!#! Current node: null
[09:36:06] [Server thread/ERROR]: #!#! Current item: null
[09:36:06] [Server thread/ERROR]: #!#! Thread: Server thread
[09:36:06] [Server thread/ERROR]: #!#! Language: english
[09:36:06] [Server thread/ERROR]: #!#! Link parse mode: DISABLED
[09:36:06] [Server thread/ERROR]: #!#! End of Error.
[09:36:06] [Server thread/ERROR]: #!#!
[09:36:16] [Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - git-Purpur-2176 (MC: 1.20.4) ---
[09:36:16] [Watchdog Thread/ERROR]: The server has not responded for 10 seconds! Creating thread dump
[09:36:16] [Watchdog Thread/ERROR]: ------------------------------
[09:36:16] [Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Purpur!):
[09:36:16] [Watchdog Thread/ERROR]: Ticking entity: minecraft:player, entity class: net.minecraft.server.level.EntityPlayer
[09:36:16] [Watchdog Thread/ERROR]: Entity status: removed: false, valid: true, alive: true, is passenger: false
[09:36:16] [Watchdog Thread/ERROR]: Entity UUID: 713638fd-80ba-4fc8-98f8-57b910c4aac2
[09:36:16] [Watchdog Thread/ERROR]: Position: world: 'world' at location (-380.37650858352185, 79.12368118184708, -299.56017459160927)
[09:36:16] [Watchdog Thread/ERROR]: Velocity: (0.0, 0.0, 0.0) (in blocks per tick)
[09:36:16] [Watchdog Thread/ERROR]: Entity AABB: AABB[-380.6765085954428, 79.12368118184708, -299.8601746035302] -> [-380.0765085716009, 80.92368113416336, -299.26017457968834]
[09:36:16] [Watchdog Thread/ERROR]: Total packets processed on the main thread for all players: 1155
[09:36:16] [Watchdog Thread/ERROR]: ------------------------------
[09:36:16] [Watchdog Thread/ERROR]: Current Thread: Server thread
[09:36:16] [Watchdog Thread/ERROR]: PID: 36 | Suspended: false | Native: false | State: WAITING
[09:36:16] [Watchdog Thread/ERROR]: Stack:
[09:36:16] [Watchdog Thread/ERROR]: [email protected]/java.lang.Object.wait0(Native Method)
[09:36:16] [Watchdog Thread/ERROR]: [email protected]/java.lang.Object.wait(Object.java:366)
[09:36:16] [Watchdog Thread/ERROR]: org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftFuture.get(CraftFuture.java:53)
[09:36:16] [Watchdog Thread/ERROR]: org.bukkit.craftbukkit.v1_20_R3.scheduler.CraftFuture.get(CraftFuture.java:40)
[09:36:16] [Watchdog Thread/ERROR]: Skript-2.11.1.jar//ch.njol.skript.util.Task.callSync(Task.java:156)
[09:36:16] [Watchdog Thread/ERROR]: Skript-2.11.1.jar//ch.njol.skript.util.Task.callSync(Task.java:131)
[09:36:16] [Watchdog Thread/ERROR]: Skript-2.11.1.jar//ch.njol.skript.SkriptEventHandler.execute(SkriptEventHandler.java:174)
[09:36:16] [Watchdog Thread/ERROR]: Skript-2.11.1.jar//ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:120)
[09:36:16] [Watchdog Thread/ERROR]: Skript-2.11.1.jar//ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:46)
[09:36:16] [Watchdog Thread/ERROR]: Skript-2.11.1.jar//ch.njol.skript.SkriptEventHandler$PriorityListener$$Lambda/0x00000048022593e8.execute(Unknown Source)
[09:36:16] [Watchdog Thread/ERROR]: co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77)
[09:36:16] [Watchdog Thread/ERROR]: org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[09:36:16] [Watchdog Thread/ERROR]: io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
[09:36:16] [Watchdog Thread/ERROR]: io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126)
[09:36:16] [Watchdog Thread/ERROR]: org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.network.ServerGamePacketListenerImpl$4.performInteraction(ServerGamePacketListenerImpl.java:2794)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.network.ServerGamePacketListenerImpl$4.a(ServerGamePacketListenerImpl.java:2844)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.network.protocol.game.ServerboundInteractPacket$InteractionAction.dispatch(ServerboundInteractPacket.java:129)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.network.protocol.game.ServerboundInteractPacket.dispatch(ServerboundInteractPacket.java:80)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.network.ServerGamePacketListenerImpl.handleInteract(ServerGamePacketListenerImpl.java:2783)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.network.protocol.game.ServerboundInteractPacket.handle(ServerboundInteractPacket.java:67)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.network.protocol.game.ServerboundInteractPacket.handle(ServerboundInteractPacket.java:12)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:54)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.network.protocol.PlayerConnectionUtils$$Lambda/0x0000004802656598.run(Unknown Source)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.TickTask.run(TickTask.java:18)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1498)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:123)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1475)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1398)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:133)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1376)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1265)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323)
[09:36:16] [Watchdog Thread/ERROR]: net.minecraft.server.MinecraftServer$$Lambda/0x0000004801afe938.run(Unknown Source)
[09:36:16] [Watchdog Thread/ERROR]: [email protected]/java.lang.Thread.runWith(Thread.java:1596)
[09:36:16] [Watchdog Thread/ERROR]: [email protected]/java.lang.Thread.run(Thread.java:1583)
[09:36:16] [Watchdog Thread/ERROR]: ------------------------------
[09:36:16] [Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.
Cannot replicate on Purpur 1.21.1 (user version) (user stated 1.21.1, error read 1.20.4) either.
Cannot replicate on Purpur 1.20.4 (actual user version) either
Is there any other code except this active? Since I can't reproduce your issue with only this snippet
on rightclick on stone_button[powered=false]:
loop all blocks in radius 2 around event-block:
if loop-block is dispenser:
cancel event
loop all items in loop-block:
if slot 1 of loop-block is lightning_rod:
broadcast "check 1"
if slot 4 of loop-block is tnt:
broadcast "check 2"
if slot 7 of loop-block is blast_furnace:
broadcast "check 3"
broadcast "Complete"
wait 1 seconds
create explosion with force 5 at {cords::%player's uuid%}
stop
Try disabling all scripts except the one you sent earlier, does the issue still persist?
Try disabling all scripts except the one you sent earlier, does the issue still persist?
I disabled the last skript i sent you and it works now for some reason that skript is causing the issues
What's the indentation like? The code you sent got unindented, please post it in a code block :D
on rightclick on stone_button[powered=false]:
loop all blocks in radius 2 around event-block:
if loop-block is dispenser:
cancel event
loop all items in loop-block:
if slot 1 of loop-block is lightning_rod:
broadcast "check 1"
if slot 4 of loop-block is tnt:
broadcast "check 2"
if slot 7 of loop-block is blast_furnace:
broadcast "check 3"
broadcast "Complete"
wait 1 seconds
create explosion with force 5 at {cords::%player's uuid%}
stop
on rightclick on stone_button[]:
broadcast 1
also crashes (ty @erenkarakal )