Line 45:
Line 45:
After creating and configuring the entity type builder, it must be built. This requires the modid and name of the entity type. For an entity type with the name "example_monster" in the mod "examplemod", this would look like <code>builder.build("examplemod:example_monster")</code>.
After creating and configuring the entity type builder, it must be built. This requires the modid and name of the entity type. For an entity type with the name "example_monster" in the mod "examplemod", this would look like <code>builder.build("examplemod:example_monster")</code>.
−
=== Tying It Together ===
+
===Tying It Together===
−
Given the above information, a basic EntityType might look like the following:
+
Given the above information, a basic EntityType might look like the following:{{Tabs/Code Snippets
−
{{Tabs/Code Snippets
|java=EntityType.Builder.of(ExampleMonsterEntity::new, MobCategory.MONSTER)
|java=EntityType.Builder.of(ExampleMonsterEntity::new, MobCategory.MONSTER)
.sized(1.0F, 2.0F)
.sized(1.0F, 2.0F)
Line 53:
Line 52:
.updateInterval(1)
.updateInterval(1)
.build("examplemod:example_monster")
.build("examplemod:example_monster")
−
}}
+
}}To function, this example requires that an entity class of the name <code>ExampleMonsterEntity</code> exist along with the entity type being [[Registration|registered]].
−
To function, this example requires that an entity class of the name <code>ExampleMonsterEntity</code> exist along with the entity type being [[Registration|registered]].
== Entity Class ==
== Entity Class ==