KubeJS-Mods / KubeJS

https://kubejs.com
GNU Lesser General Public License v3.0
305 stars 89 forks source link

Passing Array into Ingredient.of disconnects players instantly upon join #867

Open MundM2007 opened 2 months ago

MundM2007 commented 2 months ago

Minecraft Version

1.20.1

KubeJS Version

kubejs-forge-2001.6.5-build.14.jar

Rhino Version

rhino-forge-2001.2.2-build.18.jar

Architectury Version

architectury-9.2.14-forge.jar

Forge/Fabric Version

47.3.1

Describe your issue

When using this code

ServerEvents.recipes(event => {
   Ingredient.of(["kubejs:iron_hammer","kubejs:steel_hammer"])
})

(the items are custom damagable items created with kjs, idk if it also happens with other items) on a server, players are instantly disconnected. On Singelplayer this code works without problem, even in a recipe. the only error given in the log is this one and only logged throught the Connectivity Mod

[24Jun2024 11:37:52.652] [Netty Client IO #1/WARN] [com.connectivity.Connectivity/]: Packet data:
{
  "f_132075_": "translation{key='disconnect.genericReason', args=[Internal Exception: io.netty.handler.codec.DecoderException: com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonArray; at path $]}"
}

this is the error message given to the players: image

Crash report/logs

No response

MundM2007 commented 2 months ago

replacing the Ingredient.of with InputItem.of fixes this