summaryrefslogtreecommitdiff
path: root/cow.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-02-21 15:23:03 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2017-02-21 15:23:03 +0000
commitf7b9339dfc61f5f8b92acc031f797f788d901941 (patch)
tree240d3cdbf1fe1ebe9102f6cf29b5e94faff76b07 /cow.lua
parent08924ee1a3c575e8645d0158738cf96758cbb4d7 (diff)
animals spawn on different grasses if ethereal detected
Diffstat (limited to 'cow.lua')
-rw-r--r--cow.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/cow.lua b/cow.lua
index 301a5f1..bf41a3d 100644
--- a/cow.lua
+++ b/cow.lua
@@ -1,6 +1,7 @@
local S = mobs.intllib
+
-- Cow by Krupnovpavel (additional texture by JurajVajda)
mobs:register_mob("mobs_animal:cow", {
@@ -97,9 +98,16 @@ mobs:register_mob("mobs_animal:cow", {
end,
})
+
+local spawn_on = "default:dirt_with_grass"
+
+if minetest.get_modpath("ethereal") then
+ spawn_on = "ethereal:green_dirt"
+end
+
mobs:spawn({
name = "mobs_animal:cow",
- nodes = {"default:dirt_with_grass", "ethereal:green_dirt"},
+ nodes = {spawn_on},
min_light = 10,
chance = 15000,
min_height = 0,
@@ -107,10 +115,12 @@ mobs:spawn({
day_toggle = true,
})
+
mobs:register_egg("mobs_animal:cow", S("Cow"), "default_grass.png", 1)
--- compatibility
-mobs:alias_mob("mobs:cow", "mobs_animal:cow")
+
+mobs:alias_mob("mobs:cow", "mobs_animal:cow") -- compatibility
+
-- bucket of milk
minetest.register_craftitem(":mobs:bucket_milk", {