-
Bug
-
Resolution: Duplicate
-
None
-
1.16.5
-
None
-
Unconfirmed
-
(Unassigned)
The bug is reproducible with the following steps:
1. Obtain a command block and put in the following command: {{setblock ~ ~1 ~ minecraft:spawner{MinSpawnDelay: 200s, MaxNearbyEntities: 6s, SpawnData:
, z: 290, x: 14, MaxSpawnDelay: 800s, SpawnCount: 4s, RequiredPlayerRange: 16s, id: "minecraft:mob_spawner", SpawnPotentials: \\\\{Weight: 1, Entity: {id: "minecraft:zombified_piglin"}}, y: 31, SpawnRange: 4s, Delay: 335s}}}
2. Power the command block with a lever or button to set the spawner
3. No mob appears spinning in the spawner and spammed errors appear in the log as attached below.
This issue affects Endermen, Zombie Piglins, Bees, Iron Golems, Polar Bears, and Wolves.
Upon analysis in a fabric environment with yarn mappings, we can see that the cast cast exception is:
Caused by: java.lang.ClassCastException: class net.minecraft.client.world.ClientWorld cannot be cast to class net.minecraft.server.world.ServerWorld (net.minecraft.client.world.ClientWorld and net.minecraft.server.world.ServerWorld are in unnamed module of loader net.fabricmc.loader.launch.knot.KnotClassLoader @26d9b808)Caused by: java.lang.ClassCastException: class net.minecraft.client.world.ClientWorld cannot be cast to class net.minecraft.server.world.ServerWorld (net.minecraft.client.world.ClientWorld and net.minecraft.server.world.ServerWorld are in unnamed module of loader net.fabricmc.loader.launch.knot.KnotClassLoader @26d9b808) at net.minecraft.entity.mob.ZombifiedPiglinEntity.readCustomDataFromTag(ZombifiedPiglinEntity.java:175) ~[minecraft-1.16.4-projectmapped-net.fabricmc.yarn-1.16.4+build.1-v2.jar:?] at net.minecraft.entity.Entity.fromTag(Entity.java:1517)
The relevant code causing this exception seems to be in the readCustomDataFromTag(CompoundTag tag) method in each of the affected entities:
public void readCustomDataFromTag(CompoundTag tag) {
- duplicates
-
MC-189565 Some entities do not render inside of spawners and producing error log spam in console, potentially causing lag
- Resolved