mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 02:00:21 +01:00
added nametag setting to mob registry
This commit is contained in:
parent
d28c410095
commit
80cf1ddb1c
9
api.lua
9
api.lua
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
-- Mobs Api (1st September 2017)
|
-- Mobs Api (5th September 2017)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20170901"
|
mobs.version = "20170905"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -2443,6 +2443,11 @@ local mob_activate = function(self, staticdata, def, dtime)
|
|||||||
self.visual_size = vis_size
|
self.visual_size = vis_size
|
||||||
self.standing_in = ""
|
self.standing_in = ""
|
||||||
|
|
||||||
|
-- check existing nametag
|
||||||
|
if not self.nametag then
|
||||||
|
self.nametag = def.nametag
|
||||||
|
end
|
||||||
|
|
||||||
-- set anything changed above
|
-- set anything changed above
|
||||||
self.object:set_properties(self)
|
self.object:set_properties(self)
|
||||||
set_yaw(self.object, (random(0, 360) - 180) / 180 * pi)
|
set_yaw(self.object, (random(0, 360) - 180) / 180 * pi)
|
||||||
|
1
api.txt
1
api.txt
@ -30,6 +30,7 @@ This functions registers a new mob as a Minetest entity.
|
|||||||
'specific_attack' has a table of entity names that monsters can attack {"player", "mobs_animal:chicken"}
|
'specific_attack' has a table of entity names that monsters can attack {"player", "mobs_animal:chicken"}
|
||||||
'hp_min' minimum health
|
'hp_min' minimum health
|
||||||
'hp_max' maximum health (mob health is randomly selected between both)
|
'hp_max' maximum health (mob health is randomly selected between both)
|
||||||
|
'nametag' string containing name of mob to display above entity
|
||||||
'physical' same is in minetest.register_entity()
|
'physical' same is in minetest.register_entity()
|
||||||
'collisionbox' same is in minetest.register_entity()
|
'collisionbox' same is in minetest.register_entity()
|
||||||
'visual' same is in minetest.register_entity()
|
'visual' same is in minetest.register_entity()
|
||||||
|
Loading…
Reference in New Issue
Block a user