aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-11-12 17:49:41 +0100
committerparamat <mat.gregory@virginmedia.com>2016-11-15 23:08:34 +0000
commit8e61c1dfd9c07abbea82b3acecf729c118d95793 (patch)
tree84e77fd4211c94d9fb9f9f26fec00cb09d7898a8 /doc
parentbc3980e1d69ca9f848f80eb7386525fa4fb326cd (diff)
downloadminetest-8e61c1dfd9c07abbea82b3acecf729c118d95793.tar.gz
minetest-8e61c1dfd9c07abbea82b3acecf729c118d95793.tar.bz2
minetest-8e61c1dfd9c07abbea82b3acecf729c118d95793.zip
Lua_api.txt: Naming convention for custom item/entity fields
Custom (non-engine) field names of items and entities are allowed. This is now documented in lua_api.txt. Field names beginning with an underscore are now reserved for mod use, the engine must not introduce any fields beginning with an underscore.
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 7d552c980..2164bfc5e 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -3529,8 +3529,9 @@ Definition tables
-- ^ Called sometimes; the string returned is passed to on_activate when
-- the entity is re-activated from static state
- -- Also you can define arbitrary member variables here
- myvariable = whatever,
+ -- Also you can define arbitrary member variables here (see item definition for
+ -- more info)
+ _custom_field = whatever,
}
### ABM (ActiveBlockModifier) definition (`register_abm`)
@@ -3646,6 +3647,12 @@ Definition tables
end
^ The user may be any ObjectRef or nil.
]]
+ _custom_field = whatever,
+ --[[
+ ^ Add your own custom fields. By convention, all custom field names
+ should start with `_` to avoid naming collisions with future engine
+ usage.
+ ]]
}
### Tile definition