No Enum constant for category
JustCharl opened this issue ยท 2 comments
Version: 1.21.1-10.0.2
Minecraft Version: Neoforge - 21.1.80
^ This has also happened on earlier and later versions of Neoforge and the mod.
I wanted to make the max hostile mob and creature spawn rates to be increased (to increase difficulty at night and to make the days feel more fuller), however, when copying the code from the wiki and slightly tweaking, when in-game, it's stating the below:
JSON error in 'spawner.json': check log for details (No enum constant net.minecraft.world.entity.MobCategory.monster)
JSON error in 'spawner.json': check log for details (No enum constant net.minecraft.world.entity.MobCategory.creature)
The below is the InControl spawner.json file, which when input into the validator, states "success".
[
{
"mobsfrombiome": "monster",
"persecond": 0.5,
"attempts": 20,
"amount": {
"minimum": 2,
"maximum": 5
},
"conditions": {
"dimension": "minecraft:overworld",
"maxhostile": 200
}
},
{
"mobsfrombiome": "creature",
"persecond": 0.5,
"attempts": 20,
"amount": {
"minimum": 2,
"maximum": 5
},
"conditions": {
"dimension": "minecraft:overworld",
"maxpeaceful": 125
}
}
]
The full relative section of the log for the hostile mob section, for example, is below:
[04Dec2024 15:26:16.029] [Server thread/ERROR] [incontrol/]: JSON error in 'spawner.json': check log for details (No enum constant net.minecraft.world.entity.MobCategory.monster)
[04Dec2024 15:26:16.029] [Server thread/ERROR] [incontrol/]: Error parsing 'spawner.json'
java.lang.IllegalArgumentException: No enum constant net.minecraft.world.entity.MobCategory.monster
at java.base/java.lang.Enum.valueOf(Unknown Source) ~[?:?]
at TRANSFORMER/[email protected]/net.minecraft.world.entity.MobCategory.valueOf(MobCategory.java:6) ~[client-1.21.1-20240808.144430-srg.jar%23699!/:?]
at TRANSFORMER/[email protected]/mcjty.incontrol.spawner.SpawnerRule.parse(SpawnerRule.java:172) ~[incontrol-1.21-10.0.2.jar%23934!/:1.21-10.0.2]
at TRANSFORMER/[email protected]/mcjty.incontrol.spawner.SpawnerParser.readRules(SpawnerParser.java:23) ~[incontrol-1.21-10.0.2.jar%23934!/:1.21-10.0.2]
at TRANSFORMER/[email protected]/mcjty.incontrol.spawner.SpawnerSystem.reloadRules(SpawnerSystem.java:49) ~[incontrol-1.21-10.0.2.jar%23934!/:1.21-10.0.2]
at TRANSFORMER/[email protected]/mcjty.incontrol.ForgeEventHandlers.tryLoadRules(ForgeEventHandlers.java:58) ~[incontrol-1.21-10.0.2.jar%23934!/:1.21-10.0.2]
at TRANSFORMER/[email protected]/mcjty.incontrol.ForgeEventHandlers.onLevelLoad(ForgeEventHandlers.java:50) ~[incontrol-1.21-10.0.2.jar%23934!/:1.21-10.0.2]
at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:350) ~[bus-8.0.2.jar%23109!/:?]
at MC-BOOTSTRAP/net.neoforged.bus/net.neoforged.bus.EventBus.post(EventBus.java:315) ~[bus-8.0.2.jar%23109!/:?]
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.createLevels(MinecraftServer.java:375) ~[client-1.21.1-20240808.144430-srg.jar%23699!/:?]
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:337) ~[client-1.21.1-20240808.144430-srg.jar%23699!/:?]
at TRANSFORMER/[email protected]/net.minecraft.client.server.IntegratedServer.initServer(IntegratedServer.java:77) ~[client-1.21.1-20240808.144430-srg.jar%23699!/:?]
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:670) ~[client-1.21.1-20240808.144430-srg.jar%23699!/:?]
at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:267) ~[client-1.21.1-20240808.144430-srg.jar%23699!/:?]
at java.base/java.lang.Thread.run(Unknown Source) [?:?]