diff --git a/chat.lua b/chat.lua index 2cec9b2..f34908a 100644 --- a/chat.lua +++ b/chat.lua @@ -235,3 +235,31 @@ minetest.register_chatcommand("flatten", { vm:update_map() end, }) + + +minetest.register_chatcommand("sleep", { + params = "", + description = "Sleep on the ground", + privs = {}, + func = function(player_name, param) + local player = minetest.get_player_by_name(player_name) + if not (player and beds) then + return + end + + local pos = player:getpos() + if not pos then + return + end + pos = vector.round(pos) + + beds.on_rightclick(pos, player) + + local hp = player:get_hp() + if hp and type(hp) == 'number' then + player:set_hp(hp - 1) + end + + minetest.chat_send_player(player_name, 'You\'d sleep better in a bed.') + end, +}) diff --git a/mobs.lua b/mobs.lua index 97bf992..ed34263 100644 --- a/mobs.lua +++ b/mobs.lua @@ -617,8 +617,8 @@ if minetest.registered_entities["mobs_monster:spider"] then m.collisionbox = {-0.32, -0.0, -0.25, 0.25, 0.25, 0.25} m.visual_size = {x = 1.5, y = 1.5} m.drops = { - {name = "mobs:meat_raw", chance = 2, min = 1, max = 1}, - {name = "farming:cotton", chance = 2, min = 1, max = 2}, + {name = "mobs:meat_raw", chance = 2, min = 1, max = 4}, + {name = "farming:cotton", chance = 2, min = 1, max = 4}, } m.do_custom = function(self) if not (self and fun_caves.custom_ready(self)) then