Living Entities cannot be spawned unless they exist in a final ImmutableMap [1.16 builds]
JSJBDEV opened this issue ยท 6 comments
A LivingEntity cannot be spawned and results in an error like this https://hastebin.com/uwizotumay.css (this entity extends PigEntity) It has been deduced that the reason this is is because in newer version every MC mob has been added to an immutableMap DEFAULT_ATTRIBUTE_REGISTRY = ImmutableMap.builder().put(EntityType.ARMOR_STAND, LivingEntity.createLivingAttributes().build()).put...
in net\minecraft\entity\attribute\DefaultAttributeRegistry.java
to register it default Attributes on spawn, as my entity doesnt exist in this list, a nullPointer is thrown and thus it doesnt spawn.
From what I can see this means you MUST use a Mixin to register mobs correctly for them to spawn, so it would preferable if there was a direct way to add entries to this map.
[B0undaryBreaker reccommened I file this here, conversation happened on the Fabric discord]
FabricDefaultAttributeRegistry
is already a thing, does this not cover what your after?
Can't say I knew that existed, no one else mentioned it either, Ill see if it works for that, I will say, I was following the old tutorial on the fabric website.