summaryrefslogtreecommitdiff
path: root/rat.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-10-09 09:12:50 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-10-09 09:12:50 +0100
commit752ab3db982daaae449b0ed080b31368807c980f (patch)
tree8cb151e3713923d6f15da96345739989fdae45e4 /rat.lua
parente6d9611c2e87b0ae4508aa149b95d4fe562cf7d6 (diff)
Added on_spawn example
Diffstat (limited to 'rat.lua')
-rw-r--r--rat.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/rat.lua b/rat.lua
index d76e151..9f4e1ef 100644
--- a/rat.lua
+++ b/rat.lua
@@ -57,7 +57,18 @@ mobs:register_mob("mobs_animal:rat", {
]]
})
-mobs:register_spawn("mobs_animal:rat", {"default:stone"}, 20, 5, 15000, 2, 0)
+--mobs:register_spawn("mobs_animal:rat", {"default:stone"}, 20, 5, 15000, 2, 0)
+
+local function rat_spawn(self, pos)
+ print (self:get_luaentity().name, pos.x, pos.y, pos.z)
+end
+
+mobs:spawn({
+ name = "mobs_animal:rat",
+ nodes = {"default:stone"},
+ max_height = 0,
+-- on_spawn = rat_spawn,
+})
mobs:register_egg("mobs_animal:rat", S("Rat"), "mobs_rat_inventory.png", 0)