Update mobkit_api.txt

master
TheTermos 2019-10-27 19:52:23 +01:00 committed by GitHub
parent 1eb151dc14
commit abe1273141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 deletions

View File

@ -196,7 +196,7 @@ minetest.register_entity("mod:name",{
-- optional mobkit props
-- or used by built in behaviors
physics = [function user defined] -- optional, overrides built in physics
animation = {
[name]={range={x=[num],y=[num]},speed=[num],loop=[bool]}, -- single
@ -223,10 +223,10 @@ minetest.register_entity("mod:name",{
Some frequently used entity fields to be accessed directly for convenience
self.dtime - dtime as passed to on_step
self.hp - hitpoints
self.isonground - true if pos.y remains unchanged for 2 consecutive steps
self.isinliquid - true if the node at foot level is drawtype=='liquid'
self.dtime -- max(dtime as passed to on_step,0.5) - limit of 0.05 to prevent jerkines on long steps.
self.hp -- hitpoints
self.isonground -- true if pos.y remains unchanged for 2 consecutive steps
self.isinliquid -- true if the node at foot level is drawtype=='liquid'
------------
2. Reference
@ -234,6 +234,10 @@ Some frequently used entity fields to be accessed directly for convenience
2.1 Utility Functions
function mobkit.minmax(v,m)
-- v,n: numbers
-- returns v trimmed to <-m,m> range
function mobkit.get_terrain_height(pos,steps)
-- recursively search for walkable surface at pos.
-- steps (optional) is how far from pos it gives up, expressed in nodes, default 3