IllegalArgumentException when Creating `MERCHANT` Inventory Type
AkotoWeed opened this issue · 2 comments
Skript/Server Version
[18:48:25 INFO]: ==============[ Skript+ Info ]==============
[18:48:25 INFO]: Server Version: 1.21.4-15-bb76819 (MC: 1.21.4)
[18:48:25 INFO]: [✔] Skript (2.9.5) (skriptlang-github)
[18:48:25 INFO]:
[18:48:25 INFO]: Addons [16]
[18:48:25 INFO]: [?] Floodgate-Skript (2.3)
[18:48:25 INFO]: [?] skript-gui (1.3)
[18:48:25 INFO]: [?] Skellett (2.0.10)
[18:48:25 INFO]: [?] skript-yaml (1.5)
[18:48:25 INFO]: [?] skRayFall (1.9.28)
[18:48:25 INFO]: [?] skript-simple-voice-chat (1.0.1)
[18:48:25 INFO]: [✔] SkriptPlus (1.0.0)
[18:48:25 INFO]: [✔] SkBee (3.6.1)
[18:48:25 INFO]: [?] SkCord (2.2-RELEASE)
[18:48:25 INFO]: [?] Skent (3.3.1)
[18:48:25 INFO]: [?] skript-placeholders (1.7.0)
[18:48:25 INFO]: [?] DiSky (4.19.0)
[18:48:25 INFO]: [?] skUtilities (0.9.2)
[18:48:25 INFO]: [✔] skript-reflect (2.5.1)
[18:48:25 INFO]: [?] skript-worldedit (1.1.2)
[18:48:25 INFO]: [?] SkQuery (4.1.10)
[18:48:25 INFO]:
[18:48:25 INFO]: Dependencies [2]
[18:48:25 INFO]: [✔] Vault (1.7.3-b131)
[18:48:25 INFO]: [?] WorldGuard (7.0.13-SNAPSHOT+2317-ca22e3d)
Bug Description
The bug occurs when attempting to create a MERCHANT
inventory using Skript. When executing a line of code to set a variable to a MERCHANT
inventory type, the server throws an IllegalArgumentException
with the message: InventoryType.MERCHANT cannot be used to create an inventory
. This behavior prevents the intended functionality of custom GUIs resembling merchant inventories.
Expected Behavior
The script was supposed to create a custom GUI using a MERCHANT
inventory type. This GUI was intended to function as a custom trader menu with specific items and interactions defined by the script. Instead, the server throws an error, and the inventory is not created.
Steps to Reproduce
-
Create a Skript file (e.g.,
Händler.sk
) and include the following code:command /testmerchant: trigger: set {_gui} to inventory of type "merchant inventory" named "§4§lH§6§lħe§lN§2§lD§9§lL§5§lE§d§lR §4❥ §d§lMENÜ" open {_gui} to player
-
Reload the script using
/skript reload Händler.sk
in the server console or in-game. -
Run the command
/testmerchant
in-game. -
Observe the server console for the following error:
java.lang.IllegalArgumentException: InventoryType.MERCHANT cannot be used to create a inventory
-
No inventory is created, and the error stops further execution of the script.
Errors or Screenshots
[18:46:22] [Server thread/ERROR]: #!#! Thread: Server thread
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! Language: german
[18:46:22] [Server thread/ERROR]: #!#! Link parse mode: DISABLED
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! End of Error.
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! Something went horribly wrong with Skript.
[18:46:22] [Server thread/ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[18:46:22] [Server thread/ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[18:46:22] [Server thread/ERROR]: #!#! Here is full list of them:
[18:46:22] [Server thread/ERROR]: #!#! skript-placeholders v1.7.0 (https://github.com/APickledWalrus/skript-placeholders) skRayFall v1.9.28 (https://sk.rayfall.net/) skript-simple-voice-chat v1.0.1 SkBee v3.6.1 (https://github.com/ShaneBeee/SkBee) Skellett v2.0.10 (https://forums.skunity.com/resources/skellett.24/) skript-worldedit v1.1.2 DiscordSRV v1.29.0 (https://github.com/DiscordSRV/DiscordSRV) Skent v3.3.1 SkCord v2.2-RELEASE skript-reflect v2.5.1 (https://github.com/SkriptLang/skript-reflect) skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui) DiSky v4.19.0 ProAntiTab v1.9.0 skUtilities v0.9.2 (https://tim740.github.io/) skript-yaml v1.5 Floodgate-Skript v2.3 SkQuery v4.1.10
[18:46:22] [Server thread/ERROR]: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
[18:46:22] [Server thread/ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[18:46:22] [Server thread/ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[18:46:22] [Server thread/ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[18:46:22] [Server thread/ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[18:46:22] [Server thread/ERROR]: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! Stack trace:
[18:46:22] [Server thread/ERROR]: #!#! java.lang.IllegalArgumentException: InventoryType.MERCHANT cannot be used to create a inventory
[18:46:22] [Server thread/ERROR]: #!#! at com.google.common.base.Preconditions.checkArgument(Preconditions.java:218)
[18:46:22] [Server thread/ERROR]: #!#! at org.bukkit.craftbukkit.CraftServer.createInventory(CraftServer.java:2432)
[18:46:22] [Server thread/ERROR]: #!#! at org.bukkit.Bukkit.createInventory(Bukkit.java:1869)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.expressions.ExprNamed$1.get(ExprNamed.java:80)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.util.Getter.convert(Getter.java:49)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//org.skriptlang.skript.lang.converter.Converters.convert(Converters.java:501)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//org.skriptlang.skript.lang.converter.Converters.convertUnsafe(Converters.java:565)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.registrations.Converters.convertUnsafe(Converters.java:203)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.expressions.base.PropertyExpression.get(PropertyExpression.java:119)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.expressions.ExprNamed.get(ExprNamed.java:75)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.expressions.base.PropertyExpression.get(PropertyExpression.java:88)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:97)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.effects.EffChange.execute(EffChange.java:284)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.lang.Effect.run(Effect.java:49)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:88)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:52)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.SkriptEventHandler.lambda$execute$2(SkriptEventHandler.java:183)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.SkriptEventHandler.lambda$execute$3(SkriptEventHandler.java:194)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.util.Task.callSync(Task.java:164)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.util.Task.callSync(Task.java:148)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.SkriptEventHandler.execute(SkriptEventHandler.java:192)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:138)
[18:46:22] [Server thread/ERROR]: #!#! at Skript.jar//ch.njol.skript.SkriptEventHandler$PriorityListener.lambda$new$0(SkriptEventHandler.java:64)
[18:46:22] [Server thread/ERROR]: #!#! at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
[18:46:22] [Server thread/ERROR]: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[18:46:22] [Server thread/ERROR]: #!#! at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54)
[18:46:22] [Server thread/ERROR]: #!#! at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131)
[18:46:22] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.network.ServerGamePacketListenerImpl$3.performInteraction(ServerGamePacketListenerImpl.java:2888)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.network.ServerGamePacketListenerImpl$3.onInteraction(ServerGamePacketListenerImpl.java:2939)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.game.ServerboundInteractPacket$InteractionAction.dispatch(ServerboundInteractPacket.java:138)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.game.ServerboundInteractPacket.dispatch(ServerboundInteractPacket.java:89)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.network.ServerGamePacketListenerImpl.handleInteract(ServerGamePacketListenerImpl.java:2877)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.game.ServerboundInteractPacket.handle(ServerboundInteractPacket.java:76)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.game.ServerboundInteractPacket.handle(ServerboundInteractPacket.java:14)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:55)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.TickTask.run(TickTask.java:18)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:154)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1579)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:207)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:128)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1556)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1549)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:138)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1500)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1510)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1346)
[18:46:22] [Server thread/ERROR]: #!#! at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:341)
[18:46:22] [Server thread/ERROR]: #!#! at java.base/java.lang.Thread.run(Thread.java:1583)
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! Version Information:
[18:46:22] [Server thread/ERROR]: #!#! Skript: 2.9.5 (latest)
[18:46:22] [Server thread/ERROR]: #!#! Flavor: skriptlang-github
[18:46:22] [Server thread/ERROR]: #!#! Date: 19:09:25.858356200
[18:46:22] [Server thread/ERROR]: #!#! Bukkit: 1.21.4-R0.1-SNAPSHOT
[18:46:22] [Server thread/ERROR]: #!#! Minecraft: 1.21.4
[18:46:22] [Server thread/ERROR]: #!#! Java: 21.0.3 (Java HotSpot(TM) 64-Bit Server VM 21.0.3+7-LTS-152)
[18:46:22] [Server thread/ERROR]: #!#! OS: Linux amd64 6.1.0-28-cloud-amd64
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! Server platform: Paper
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! Current node: null
[18:46:22] [Server thread/ERROR]: #!#! Current item: set {_gui} (as java.lang.Object) to [[inventorytype:merchant inventory]] named "§4§lH§6§lħe§lN§2§lD§9§lL§5§lE§d§lR §4❥ §d§lMENÜ"
[18:46:22] [Server thread/ERROR]: #!#! Current trigger: right click on entity (rightclick on [[entitydata:entity]]) (Händler.sk, line 48)
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! Thread: Server thread
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! Language: german
[18:46:22] [Server thread/ERROR]: #!#! Link parse mode: DISABLED
[18:46:22] [Server thread/ERROR]: #!#!
[18:46:22] [Server thread/ERROR]: #!#! End of Error.
[18:46:22] [Server thread/ERROR]: #!#! ****
Other
no
Agreement
- I have read the guidelines above and affirm I am following them with this report.