Add API doc to README

pull/4/head
PilzAdam 2012-09-19 17:16:19 +02:00
parent e4f54d11e6
commit 0a795ffe5f
1 changed files with 42 additions and 0 deletions

View File

@ -25,6 +25,48 @@ There is also 1 friendly mob:
- The sheep spawns on grass. You can get wool from it when you rightclick
it and meat if you kill it. Meat can bee cooked in the furnace to eat it.
For developers:
This mod add some functions that you can use in other mods:
1. mobs:register_monster(name, def)
This adds a monster to Minetest that will attack the player
"name" is the name of the monster ("[modname]:[monstername]")
"def" is a table with the following values:
hp_max: same is in minetest.register_entity()
physical: same is in minetest.register_entity()
collisionbox: same is in minetest.register_entity()
visual: same is in minetest.register_entity()
visual_size: same is in minetest.register_entity()
textures: same is in minetest.register_entity()
makes_footstep_sound: same is in minetest.register_entity()
view_range: the range in that the monster will see the player
and follow him
walk_velocity: the velocity when the monster is walking arround
run_velocity: the velocity when the monster is attacking a player
damage: the damage per second
light_resistant: light wont cause damage on day
drop: the drop item of the monster
drop_count: the number of items that are dropped
armor: the armor (integer)(3=lowest; 1=highest)(fleshy group is used)
drawtype: "front" or "side"
2. mobs:register_animal(name, def)
This adds a animal to Minetest that will just walk arround
"name" is the name of the monster ("[modname]:[animalname]")
"def" is the same table as in register_monster but without these values:
view_range
run_velocity
damage
light_resistant
armor
and it also has the field
on_rightclick: its same as in minetest.register_entity()
3. mobs:register_spawn(name, nodes, max_light, min_light)
This function adds the spawning of an animal (without it the
registered animals and monster wont spawn!)
"name" is the name of the animal/monster
"nodes" is a list of nodenames on that the animal/monster can spawn
"max_light" is the maximum of light
"min_light" is the minimum of light
License:
Sourcecode: WTFPL (see below)
Grahpics: WTFPL (see below)