Skip to content

Tag contains throws stack trace when comparing against another type #7452

@ShaneBeee

Description

@ShaneBeee

Skript/Server Version

[Skript] Server Version: 1.21.4-113-8e80d4e (MC: 1.21.4)
[Skript] Skript Version: 2.10.0 (skriptlang-github)
[Skript] Installed Skript Addons: 
[Skript]  - skript-reflect v2.5.1 (https://github.com/SkriptLang/skript-reflect)
[Skript]  - SkBee v3.8.0 (https://github.com/ShaneBeee/SkBee)
[Skript]  - SkBriggy v1.4.3 (https://github.com/ShaneBeee/SkBriggy)
[Skript] Installed dependencies: 
[Skript]  - Vault v1.7.3-b131

Bug Description

When checking if an item tag, contains an entity, a stack trace is thrown.
Obviously one shouldn't be doing this, but ya know...

Expected Behavior

No errors.

Steps to Reproduce

simple code:

on load:
	spawn a sheep at spawn of world "world":
		set {_e} to entity

	if {_e} is tagged as item tag "minecraft:logs":

Errors or Screenshots

stack trace:

[00:36:20 ERROR]: #!#! 
[00:36:20 ERROR]: #!#! [Skript] Severe Error:
[00:36:20 ERROR]: #!#! 
[00:36:20 ERROR]: #!#! An unexpected error occurred with Skript. This issue is likely not your fault.
[00:36:20 ERROR]: #!#! You are using some plugins that alter how Skript works (addons).
[00:36:20 ERROR]: #!#! Full list of addons:
[00:36:20 ERROR]: #!#! SkBriggy v1.4.3 (https://github.com/ShaneBeee/SkBriggy)
[00:36:20 ERROR]: #!#! SkBee v3.8.0 (https://github.com/ShaneBeee/SkBee)
[00:36:20 ERROR]: #!#! skript-reflect v2.5.1 (https://github.com/SkriptLang/skript-reflect)
[00:36:20 ERROR]: #!#! CorePlugin v1.0.0 (https://github.com/ShaneBeee/CorePlugin)
[00:36:20 ERROR]: #!#! We could not identify related addons, it might also be a Skript issue.
[00:36:20 ERROR]: #!#! Try temporarily removing the listed plugins one by one to identify the cause.
[00:36:20 ERROR]: #!#! If removing a plugin resolves the issue, please report the problem to the plugin developer.
[00:36:20 ERROR]: #!#! 
[00:36:20 ERROR]: #!#! Stack trace:
[00:36:20 ERROR]: #!#! Caused by: java.lang.ClassCastException: class org.bukkit.entity.EntityType cannot be cast to class org.bukkit.Material (org.bukkit.entity.EntityType and org.bukkit.Material are in unnamed module of loader java.net.URLClassLoader @5bcab519)
[00:36:20 ERROR]: #!#!     at org.bukkit.craftbukkit.tag.CraftItemTag.isTagged(CraftItemTag.java:11)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//org.skriptlang.skript.bukkit.tags.elements.CondIsTagged.isTagged(CondIsTagged.java:87)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//org.skriptlang.skript.bukkit.tags.elements.CondIsTagged.lambda$check$0(CondIsTagged.java:67)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.lang.util.SimpleExpression.check(SimpleExpression.java:148)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.lang.Variable.check(Variable.java:742)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//org.skriptlang.skript.bukkit.tags.elements.CondIsTagged.check(CondIsTagged.java:60)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.lang.Condition.evaluate(Condition.java:78)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.lang.Condition.evaluate(Condition.java:23)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//org.skriptlang.skript.lang.condition.Conditional.evaluate(Conditional.java:45)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//org.skriptlang.skript.lang.condition.Conditional.evaluateAnd(Conditional.java:105)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//org.skriptlang.skript.lang.condition.CompoundConditional.evaluate(CompoundConditional.java:85)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//org.skriptlang.skript.lang.condition.CompoundConditional.evaluate(CompoundConditional.java:68)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.sections.SecConditional.checkConditions(SecConditional.java:400)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.sections.SecConditional.walk(SecConditional.java:288)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:67)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:33)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.events.EvtScript.runTrigger(EvtScript.java:70)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.events.EvtScript.postLoad(EvtScript.java:43)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.structures.StructEvent.postLoad(StructEvent.java:73)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.ScriptLoader.lambda$loadScripts$10(ScriptLoader.java:567)
[00:36:20 ERROR]: #!#!     at java.base/java.util.ArrayList.removeIf(ArrayList.java:1756)
[00:36:20 ERROR]: #!#!     at java.base/java.util.ArrayList.removeIf(ArrayList.java:1744)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.ScriptLoader.lambda$loadScripts$14(ScriptLoader.java:558)
[00:36:20 ERROR]: #!#!     at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684)
[00:36:20 ERROR]: #!#!     at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662)
[00:36:20 ERROR]: #!#!     at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2200)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:486)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:428)
[00:36:20 ERROR]: #!#!     at Skript-2.10.0.jar//ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:187)
[00:36:20 ERROR]: #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[00:36:20 ERROR]: #!#!     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165)
[00:36:20 ERROR]: #!#!     at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1016)
[00:36:20 ERROR]: #!#!     at org.bukkit.craftbukkit.CraftServer.dispatchServerCommand(CraftServer.java:1001)
[00:36:20 ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:478)
[00:36:20 ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.tickConnection(DedicatedServer.java:428)
[00:36:20 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1738)
[00:36:20 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1529)
[00:36:20 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1251)
[00:36:20 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310)
[00:36:20 ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:1570)
[00:36:20 ERROR]: #!#! 
[00:36:20 ERROR]: #!#! Skript: 2.10.0 (unknown)
[00:36:20 ERROR]: #!#!     Flavor: skriptlang-github
[00:36:20 ERROR]: #!#!     Date: 17:18:40.825111800
[00:36:20 ERROR]: #!#! Bukkit: 1.21.4-R0.1-SNAPSHOT
[00:36:20 ERROR]: #!#! Minecraft: 1.21.4
[00:36:20 ERROR]: #!#! Java: 22.0.2 (OpenJDK 64-Bit Server VM 22.0.2+9)
[00:36:20 ERROR]: #!#! OS: Mac OS X aarch64 15.2
[00:36:20 ERROR]: #!#! 
[00:36:20 ERROR]: #!#! Server platform: Paper
[00:36:20 ERROR]: #!#! 
[00:36:20 ERROR]: #!#! Current node: on load: (test.sk, line 2)
[00:36:20 ERROR]: #!#! Current item: if {_e} (as java.lang.Object) is  tagged as  item tag "minecraft:logs"
[00:36:20 ERROR]: #!#! Current trigger: load (script load) (test.sk, line 2)
[00:36:20 ERROR]: #!#! Thread: Server thread
[00:36:20 ERROR]: #!#! Language: english
[00:36:20 ERROR]: #!#! Link parse mode: DISABLED
[00:36:20 ERROR]: #!#! End of Error.
[00:36:20 ERROR]: #!#! 

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.

Metadata

Metadata

Assignees

Labels

bugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.completedThe issue has been fully resolved and the change will be in the next Skript update.patch-readyA PR/issue that has been approved and is ready to be merged/closed for the next patch version.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions