mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-16 07:20:31 +01:00
Poulet domesticable
Faire que les poulets soient domesticable/tamed comme les moutons/vaches (mais avec 4 wheat et non 8, le clique droit pose problème car déjà utilisé)
This commit is contained in:
parent
a0a7485ae4
commit
19a74cfee4
|
@ -41,15 +41,33 @@ mobs:register_mob("mobs:chicken", {
|
||||||
},
|
},
|
||||||
follow = "farming:wheat",
|
follow = "farming:wheat",
|
||||||
view_range = 8,
|
view_range = 8,
|
||||||
on_rightclick = function(self, clicker)
|
|
||||||
if clicker:is_player() and clicker:get_inventory() then
|
|
||||||
clicker:get_inventory():add_item("main", "mobs:chicken")
|
|
||||||
self.object:remove()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
sounds = {
|
sounds = {
|
||||||
random = "mobs_chicken",
|
random = "mobs_chicken",
|
||||||
},
|
},
|
||||||
|
on_rightclick = function(self, clicker)
|
||||||
|
local tool = clicker:get_wielded_item()
|
||||||
|
if tool:get_name() == "farming:wheat" then
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
tool:take_item(1)
|
||||||
|
clicker:set_wielded_item(tool)
|
||||||
|
end
|
||||||
|
self.food = (self.food or 0) + 1
|
||||||
|
if self.food >= 4 then
|
||||||
|
-- I dont know what do you want she make
|
||||||
|
self.food = 0
|
||||||
|
self.tamed = true
|
||||||
|
minetest.sound_play("mobs_chicken", {object = self.object,gain = 1.0,max_hear_distance = 32,loop = false,})
|
||||||
|
end
|
||||||
|
return tool
|
||||||
|
else
|
||||||
|
if clicker:is_player() and clicker:get_inventory() then
|
||||||
|
clicker:get_inventory():add_item("main", "mobs:chicken")
|
||||||
|
self.object:remove()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end,
|
||||||
jump = true,
|
jump = true,
|
||||||
step = 1,
|
step = 1,
|
||||||
blood_texture = "mobs_blood.png",
|
blood_texture = "mobs_blood.png",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user