This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorial:entity [2021/09/26 13:19] skullition Add clarification for EntityRendererRegistry.register |
tutorial:entity [2022/01/11 16:31] (current) simplycmd Clarify why you wouldn't use WaterCreatureEntity for fish as well |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Creating an Entity ===== | ===== Creating an Entity ===== | ||
- | //The source code for this project can be found [[https://github.com/Draylar/entity-testing|here]] on the entity branch.// | + | //The source code for this project can be found [[https://github.com/Draylar/entity-testing/tree/entity|here]].// |
Entities are a movable object in a world with logic attached to them. A few examples include: | Entities are a movable object in a world with logic attached to them. A few examples include: | ||
Line 10: | Line 10: | ||
Living Entities are Entities that have health and can deal damage. | Living Entities are Entities that have health and can deal damage. | ||
There are various classes that branch off `LivingEntity` for different purposes, including: | There are various classes that branch off `LivingEntity` for different purposes, including: | ||
- | * ''HostileEntity'' for Zombies, Creepers, and Skeletons | + | * ''HostileEntity'' for Zombies, Creepers and Skeletons |
- | * ''AnimalEntity'' for Sheep, Cows, and Pigs | + | * ''AnimalEntity'' for Sheep, Cows and Pigs |
* ''WaterCreatureEntity'' for things that swim | * ''WaterCreatureEntity'' for things that swim | ||
- | * ''FishEntity'' for fishies | + | * ''FishEntity'' for fishies (use instead of ''WaterCreatureEntity'' for schooling behavior) |
- | What you extend depends on your needs and goals are. | + | What you extend depends on what your needs and goals are. |
As you get further down the chain, the entity logic becomes more specific and curated to certain tasks. | As you get further down the chain, the entity logic becomes more specific and curated to certain tasks. | ||
The two generic entity classes that come after ''LivingEntity'' are: | The two generic entity classes that come after ''LivingEntity'' are: |