register

static void register(EntityType<? extends LivingEntity> type, DefaultAttributeContainer.Builder builder)

Registers a default attribute for a type of living entity.

It can be used in a fashion similar to this:

	EntityAttributeRegistry.INSTANCE.register(type, LivingEntity.createLivingAttributes());
	

If a registration overrides another, a debug log message will be emitted. Existing registrationscan be checked at hasDefinitionFor.

For convenience, this can also be done on the FabricEntityTypeBuilder to simplify the building process.

See also

net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder.Living

FabricEntityTypeBuilder.Living#defaultAttributes(Supplier)

Parameters

type

the entity type

builder

the builder that creates the default attribute

Sources

jvm source
Link copied to clipboard