-
Type:
Bug
-
Resolution: Invalid
-
Priority:
Minor
-
None
-
Affects Version/s: None
-
4466-Spigot-aa90801-0f147ef (MC: 1.21.5) (Implementing API version 1.21.5-R0.1-SNAPSHOT)
-
Yes
I am unable to get the new Cow variants but I am able to get the Chicken and Pig variants. Calling Cow.getVariant() throws the following exception:
java.lang.NoSuchMethodError: 'org.bukkit.entity.Cow$Variant org.bukkit.entity.AbstractCow.getVariant()'
Additionally, the .getVariant() method on wolf, chicken, and pig now return a CraftVariant which appears to be different behavior than mobs that already had variants such as axolotl which just returns an enum.
The attached plugin has the following code in it's onEnable() method and no other code:
World world = Bukkit.getWorld("world"); Axolotl axolotl = (Axolotl) world.spawnEntity(new Location(world, 0, 100, 0), EntityType.AXOLOTL); System.out.println("Axolotl variant: " + axolotl.getVariant()); Wolf wolf = (Wolf) world.spawnEntity(new Location(world, 0, 100, 0), EntityType.WOLF); System.out.println("Wolf variant: " + wolf.getVariant()); Chicken chicken = (Chicken) world.spawnEntity(new Location(world, 0, 100, 0), EntityType.CHICKEN); System.out.println("Chicken variant: " + chicken.getVariant()); Pig pig = (Pig) world.spawnEntity(new Location(world, 0, 100, 0), EntityType.PIG); System.out.println("Pig variant: " + pig.getVariant()); Cow cow = (Cow) world.spawnEntity(new Location(world, 0, 100, 0), EntityType.COW); System.out.println("Cow variant: " + cow.getVariant());
I'm not sure what the expected behavior is, but in 1.21.4, the above code for the wolf prints out `Wolf variant: minecraft:snowy`. In 1.21.5 - similar to chicken and pig - it prints out a lot more:
Wolf variant: CraftVariant{key=minecraft:snowy, handle=Reference{ResourceKey[minecraft:wolf_variant / minecraft:snowy]=WolfVariant[assetInfo=a[wild=ClientAsset[id=minecraft:entity/wolf/wolf_snowy, texturePath=minecraft:textures/entity/wolf/wolf_snowy.png], tame=ClientAsset[id=minecraft:entity/wolf/wolf_snowy_tame, texturePath=minecraft:textures/entity/wolf/wolf_snowy_tame.png], angry=ClientAsset[id=minecraft:entity/wolf/wolf_snowy_angry, texturePath=minecraft:textures/entity/wolf/wolf_snowy_angry.png]], spawnConditions=SpawnPrioritySelectors[selectors=[a[condition=Optional[BiomeCheck[requiredBiomes=DirectSet[[Reference{ResourceKey[minecraft:worldgen/biome / minecraft:grove]=net.minecraft.world.level.biome.BiomeBase@14fbc379}]]]], priority=1]]]]}}
There seems to be inconsistency between how the different mobs return their variants.