aboutsummaryrefslogtreecommitdiff
path: root/src/main/wither_spawn.lua
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-06-09 17:44:13 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-06-09 17:44:13 +0200
commit00cd9d750f2ee5ce954426251ab97bb304d2e2a6 (patch)
tree3cbcc8738bbf56ffee295f94862376315b49163e /src/main/wither_spawn.lua
parent7cc0e9d41ffdd8dc873aff2fe0501b617322d490 (diff)
downloadskycraft-00cd9d750f2ee5ce954426251ab97bb304d2e2a6.tar.xz
Added Missing Files
Diffstat (limited to 'src/main/wither_spawn.lua')
-rw-r--r--src/main/wither_spawn.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/wither_spawn.lua b/src/main/wither_spawn.lua
new file mode 100644
index 0000000..e52a732
--- /dev/null
+++ b/src/main/wither_spawn.lua
@@ -0,0 +1,21 @@
+local dim = {"x", "z"}
+
+for _, d in pairs(dim) do
+ skycraft.load_schem("wither_spawn_" .. d)
+end
+
+minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
+ if newnode.name == "mcl_heads:wither_skeleton" then
+ for _, d in pairs(dim) do
+ for i = 0, 2 do
+ local p = vector.add(pos, {x = 0, y = -2, z = 0, [d] = -i})
+ local schemname = "wither_spawn_" .. d
+ if skycraft.check_schem(p, schemname) then
+ skycraft.remove_schem(p, schemname)
+ minetest.add_entity(vector.add(p, {x = 0, y = 1, z = 0, [d] = 1}), "mobs_mc:wither")
+ end
+ end
+ end
+ end
+end)
+