Modding:Entity Behaviors: Difference between revisions
(→All Behaviors: add placeholders for the remaining behaviors) |
(→All Behaviors: typo) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 85: | Line 85: | ||
| | | | ||
| | | | ||
* villager | |||
| | | | ||
| | | Server | ||
|- | |- | ||
| [[Modding:Entity_Behavior_aimingaccuracy|aimingaccuracy]] | | [[Modding:Entity_Behavior_aimingaccuracy|aimingaccuracy]] | ||
Line 99: | Line 100: | ||
| | | | ||
| | | | ||
* deer | |||
* animals with horns | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_armorstandinventory|armorstandinventory]] | | [[Modding:Entity_Behavior_armorstandinventory|armorstandinventory]] | ||
| | | | ||
| | | | ||
* armorstand | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_bodytemperature|bodytemperature]] | | [[Modding:Entity_Behavior_bodytemperature|bodytemperature]] | ||
| | | | ||
| | | | ||
* player | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_boss|boss]] | | [[Modding:Entity_Behavior_boss|boss]] | ||
| | | | ||
| | | | ||
* eidolon-immobolized | |||
| | | | ||
| | | Client | ||
|- | |- | ||
| [[Modding:Entity_Behavior_breathe|breathe]] | | [[Modding:Entity_Behavior_breathe|breathe]] | ||
Line 140: | Line 146: | ||
| | | | ||
| | | | ||
* erel | |||
* locust-hacked | |||
* mechhelper | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_controlledphysics|controlledphysics]] | | [[Modding:Entity_Behavior_controlledphysics|controlledphysics]] | ||
Line 154: | Line 163: | ||
| | | | ||
| | | | ||
* libraryresonator | |||
* trader | |||
* villager | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_deaddecay|deaddecay]] | | [[Modding:Entity_Behavior_deaddecay|deaddecay]] | ||
| | | | ||
| | | | ||
* animals | |||
| | | | ||
| | | Server | ||
|- | |- | ||
| [[Modding:Entity_Behavior_despawn|despawn]] | | [[Modding:Entity_Behavior_despawn|despawn]] | ||
Line 177: | Line 190: | ||
| | | | ||
| | | | ||
* player | |||
| | | | ||
| | | Client | ||
|- | |- | ||
| [[Modding:Entity_Behavior_emotionstates|emotionstates]] | | [[Modding:Entity_Behavior_emotionstates|emotionstates]] | ||
Line 192: | Line 206: | ||
| | | | ||
| | | | ||
* player | |||
* playerbot | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_floatupwhenstuck|floatupwhenstuck]] | | [[Modding:Entity_Behavior_floatupwhenstuck|floatupwhenstuck]] | ||
Line 218: | Line 234: | ||
| | | | ||
| | | | ||
* wolf | |||
* harvestable animals | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_health|health]] | | [[Modding:Entity_Behavior_health|health]] | ||
Line 236: | Line 254: | ||
| | | | ||
| | | | ||
* boat | |||
| | | | ||
| | | Client | ||
|- | |- | ||
| [[Modding:Entity_Behavior_hunger|hunger]] | | [[Modding:Entity_Behavior_hunger|hunger]] | ||
Line 257: | Line 276: | ||
| | | | ||
| | | | ||
* player | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_interpolateposition|interpolateposition]] | | [[Modding:Entity_Behavior_interpolateposition|interpolateposition]] | ||
Line 270: | Line 290: | ||
| | | | ||
| | | | ||
* goal | |||
* sheep-bighorn-female | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_mortallywoundable|mortallywoundable]] | | [[Modding:Entity_Behavior_mortallywoundable|mortallywoundable]] | ||
| | | | ||
| | | | ||
* elk-tamed | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_mouthinventory|mouthinventory]] | | [[Modding:Entity_Behavior_mouthinventory|mouthinventory]] | ||
| | | | ||
| | | | ||
* racoon | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_multiply|multiply]] | | [[Modding:Entity_Behavior_multiply|multiply]] | ||
Line 306: | Line 330: | ||
| | | | ||
| | | | ||
* chicken-hen | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_nametag|nametag]] | | [[Modding:Entity_Behavior_nametag|nametag]] | ||
Line 325: | Line 350: | ||
| | | | ||
| | | | ||
* erel | |||
* mechhelper | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_passivephysics|passivephysics]] | | [[Modding:Entity_Behavior_passivephysics|passivephysics]] | ||
Line 344: | Line 371: | ||
| | | | ||
| | | | ||
* boat | |||
* boat-construction | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_pettable|pettable]] | | [[Modding:Entity_Behavior_pettable|pettable]] | ||
| | | | ||
| | | | ||
* chicken | |||
* farm animals | |||
* fox | |||
* wolf | |||
| | | | ||
| | | Server | ||
|- | |- | ||
| [[Modding:Entity_Behavior_placeblock|placeblock]] | | [[Modding:Entity_Behavior_placeblock|placeblock]] | ||
Line 366: | Line 399: | ||
| | | | ||
| | | | ||
* player | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_playerphysics|playerphysics]] | | [[Modding:Entity_Behavior_playerphysics|playerphysics]] | ||
Line 382: | Line 416: | ||
* most entities | * most entities | ||
| | | | ||
movable = true<br/> | |||
| Universal | | Universal | ||
|- | |- | ||
Line 388: | Line 422: | ||
| | | | ||
| | | | ||
* eidolon-immobilized | |||
* trader | |||
* villager | |||
| | | | ||
| | | Server | ||
|- | |- | ||
| [[Modding:Entity_Behavior_rideable|rideable]] | | [[Modding:Entity_Behavior_rideable|rideable]] | ||
| | | | ||
| | | | ||
* elk-tamed | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_rideableaccessories|rideableaccessories]] | | [[Modding:Entity_Behavior_rideableaccessories|rideableaccessories]] | ||
| | | | ||
| | | | ||
* boat | |||
* elk-tamed | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_ropetieable|ropetieable]] | | [[Modding:Entity_Behavior_ropetieable|ropetieable]] | ||
| | | | ||
| | | | ||
* elk-tamed | |||
* farm animals | |||
* wolf | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_seatable|seatable]] | | [[Modding:Entity_Behavior_seatable|seatable]] | ||
| | | | ||
| | | | ||
* boat | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_selectionboxes|selectionboxes]] | | [[Modding:Entity_Behavior_selectionboxes|selectionboxes]] | ||
| | | | ||
| | | | ||
* boat | |||
* boat-construction | |||
* elk-tamed | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_seraphinventory|seraphinventory]] | | [[Modding:Entity_Behavior_seraphinventory|seraphinventory]] | ||
| | | | ||
| | | | ||
* armorstand-aged | |||
* playerbot | |||
| | | | ||
| | | Universal | ||
|- | |- | ||
| [[Modding:Entity_Behavior_taskai|taskai]] | | [[Modding:Entity_Behavior_taskai|taskai]] | ||
Line 446: | Line 495: | ||
| | | | ||
| | | | ||
* villager | |||
| | | | ||
| | | Both | ||
|} | |} |
Latest revision as of 05:53, 6 October 2024
Using Entity Behaviors
Inside the entity json file, entity behaviors can be added to the client section, server section, or both. For example, here is the controlledphysics behavior from deer.json
, added to both the client and server sections. This shows the pre-1.20 style of including the behavior on both sides. Note that the properties are added directly to the behavior object, instead of in a properties object like with blocks and items. Also note that the builtin entity behavior names are all lower case, unlike block and collectible behaviors.
client: {
...
behaviors: [
...
{
code: "controlledphysics",
"stepHeightByType": {
"deer-pampas-*": 2.1251,
"deer-pudu-*": 2.1251,
"deer-redbrocket-*": 2.1251,
"*": 3.1251
}
},
...
],
...
},
server: {
...
behaviors: [
...
{
code: "controlledphysics",
"stepHeightByType": {
"deer-pampas-*": 2.1251,
"deer-pudu-*": 2.1251,
"deer-redbrocket-*": 2.1251,
"*": 3.1251
}
},
...
],
...
},
In 1.20, the behaviorConfigs section was added. For behaviors that added to both sections, the properties may be specified in the behaviorConfigs section to avoid duplicating the properties in both the client and server section. Here is the above example using behaviorConfigs.
behaviorConfigs: {
"controlledphysics": {
"stepHeightByType": {
"deer-pampas-*": 2.1251,
"deer-pudu-*": 2.1251,
"deer-redbrocket-*": 2.1251,
"*": 3.1251
}
},
...
},
client: {
...
behaviors: [
...
{ code: "controlledphysics" },
...
],
...
},
server: {
...
behaviors: [
...
{ code: "controlledphysics" },
...
],
...
},
All Behaviors
Here is a table containing all the entity behaviors of the base game. Of course mods can, and are encouraged to add new behaviors.
Behavior Name | Explanation | Example entities | Properties | Side |
---|---|---|---|---|
activitydriven |
|
Server | ||
aimingaccuracy | Adds aiming inaccuracy when sprinting, jumping, etc. |
|
Universal | |
antlergrowth |
|
Universal | ||
armorstandinventory |
|
Universal | ||
bodytemperature |
|
Universal | ||
boss |
|
Client | ||
breathe | The entity will need to breathe and therefore suffocate in other blocks (for example sand). |
|
Universal | |
collectitems | The entity collections items laying around on the ground. |
|
Server | |
commandable |
|
Universal | ||
controlledphysics | Add physics to the entity. |
|
stepHeight = 0.6 |
Universal |
conversable |
|
Universal | ||
deaddecay |
|
Server | ||
despawn | The entity will despawn under given circumstances. |
|
minPlayerDistance |
Universal |
drunktyping |
|
Client | ||
emotionstates | Adds emotion states with a given chance. As an example, it can be used to make an animal "hungry" (aggressive) and "saturated" (passive). |
|
states |
Server |
extraskinnable |
|
Universal | ||
floatupwhenstuck | Float up the entity if it gets stuck in a block. |
|
onlyWhenDead = false |
Universal |
grow | The entity will grow and eventually turn into one of its adults. |
|
hoursToGrow = 96 |
Server |
harvestable |
|
Universal | ||
health | Applies custom health to the entity. Means the entity can be hurt as well. |
|
currenthealth = 20 |
Server |
hidewatersurface |
|
Client | ||
hunger | Adds saturation and hunger, the entity needs to eat in order to stay alive. |
|
currentsaturation = 1200 maxsaturation = 1200 saturationlossdelay = 60 * 24 currentfruitLevel = 0 currentvegetableLevel = 0 currentgrainLevel = 0 currentproteinLevel = 0 currentdairyLevel = 0 |
Server |
idleanimations |
|
Universal | ||
interpolateposition | Interpolates entity position and rotate. Smooths out the animations. It's a visual effect, therefore not available on server side. |
|
Client | |
milkable |
|
Universal | ||
mortallywoundable |
|
Universal | ||
mouthinventory |
|
Universal | ||
multiply | A pack of wolves for example grows in size over time (new babies are born). When installed on the client side, it shows portions eaten info text. |
|
pregnancyDays = 3.0 |
Universal |
multiplybase |
|
Universal | ||
nametag | Adds a name tag to the entity which will be displayed above the entity. |
|
renderRange = 99 |
Universal |
openablecontainer |
|
Universal | ||
passivephysics | Adds physics to the entity. |
|
waterDragFactor = 1 |
Universal |
passivephysicsmultibox |
|
Universal | ||
pettable |
|
Server | ||
placeblock | The entity will place one of the given block codes from time to time. |
|
minHourDelay = 8 * 24 |
Server |
playerinventory |
|
Universal | ||
playerphysics | Makes an entity controllable by a player. Because this inherits from controlledphysics, do not add both to an entity. |
|
stepHeight = 0.6 |
Universal |
repulseagents | Pushes other entities back. |
|
movable = true |
Universal |
reviveondeath |
|
Server | ||
rideable |
|
Universal | ||
rideableaccessories |
|
Universal | ||
ropetieable |
|
Universal | ||
seatable |
|
Universal | ||
selectionboxes |
|
Universal | ||
seraphinventory |
|
Universal | ||
taskai | Allows you to specify tasks. |
|
aitasks |
Server |
tiredness | The entity will get tired over time. When it is sufficiently tired, it may sleep in a bed. |
|
currenttiredness = 0 |
Universal |
villagerinventory |
|
Both |