1 --License for code WTFPL and otherwise stated in readmes
4 local MP
= minetest
.get_modpath(minetest
.get_current_modname())
5 local S
, NS
= dofile(MP
.."/intllib.lua")
7 mobs
:register_mob("mobs_mc:bat", {
12 collisionbox
= {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
14 mesh
= "mobs_mc_bat.b3d",
18 visual_size
= {x
=1, y
=1},
20 random = "mobs_rat", -- TODO: This sound is supposed to be very high-pitched and scary
25 -- TODO: Hang upside down
36 -- TODO: Less ugly death animation
57 --[[ If the game has been launched between the 20th of October and the 3rd of November system time,
58 -- the maximum spawn light level is increased. ]]
59 local date = os
.date("*t")
61 if (date.month
== 10 and date.day
>= 20) or (date.month
== 11 and date.day
<= 3) then
67 -- Spawn on solid blocks at or below Sea level and the selected light level
68 mobs
:spawn_specific("mobs_mc:bat", mobs_mc
.spawn
.solid
, {"air"}, 0, maxlight
, 20, 5000, 2, mobs_mc
.spawn_height
.overworld_min
, mobs_mc
.spawn_height
.water
-1)
72 mobs
:register_egg("mobs_mc:bat", S("Bat"), "mobs_mc_spawn_icon_bat.png", 0)
75 if minetest
.settings
:get_bool("log_mods") then
76 minetest
.log("action", "MC Bat loaded")