tutorial:entity
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:entity [2020/06/11 20:22] – add source link draylar | tutorial:entity [2020/08/12 14:26] – add link to villager activites emmanuelmess | ||
---|---|---|---|
Line 19: | Line 19: | ||
The two generic entity classes that come after '' | The two generic entity classes that come after '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
- | '' | + | '' |
for pathfinding favor, and various AI tasks require this to operate. | for pathfinding favor, and various AI tasks require this to operate. | ||
- | In this tutorial, we will look at creating a cube entity that extends '' | + | In this tutorial, we will look at creating a cube entity that extends '' |
This entity will have a model & texture. Movement and mechanics will be covered in a future tutorial. | This entity will have a model & texture. Movement and mechanics will be covered in a future tutorial. | ||
===== Creating & Registering an Entity ===== | ===== Creating & Registering an Entity ===== | ||
- | Create a class that extends '' | + | Create a class that extends '' |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
/* | /* | ||
- | * Our Cube Entity extends | + | * Our Cube Entity extends |
* | * | ||
* LivingEntity has health and can deal damage. | * LivingEntity has health and can deal damage. | ||
* MobEntity has movement controls and AI capabilities. | * MobEntity has movement controls and AI capabilities. | ||
- | | + | |
*/ | */ | ||
- | public class CubeEntity extends | + | public class CubeEntity extends |
- | public CubeEntity(EntityType<? | + | public CubeEntity(EntityType<? |
super(entityType, | super(entityType, | ||
} | } | ||
Line 256: | Line 256: | ||
You can spawn your entity by typing ''/ | You can spawn your entity by typing ''/ | ||
{{https:// | {{https:// | ||
+ | |||
+ | ===== Adding tasks & activities ===== | ||
+ | |||
+ | To add activities see [[: | ||
tutorial/entity.txt · Last modified: 2023/09/13 20:30 by nebelnidas