mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-26 10:40:37 +01:00
Re-added npc taming system (for 4 diamonds)
This commit is contained in:
parent
c8353dd2fb
commit
2df3b7828c
@ -87,7 +87,14 @@ mobs:register_mob("mobs:npc", {
|
|||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
pos.y = pos.y + 0.5
|
pos.y = pos.y + 0.5
|
||||||
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
|
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
|
||||||
else
|
elsif item:get_name() == "default:diamond" then
|
||||||
|
self.diamond_count = (self.diamond_count or 0)
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
item:take_item()
|
||||||
|
clicker:set_wielded_item(item)
|
||||||
|
end
|
||||||
|
if self.diamond_count < 4 then return end
|
||||||
|
|
||||||
if self.owner == "" then
|
if self.owner == "" then
|
||||||
self.owner = clicker:get_player_name()
|
self.owner = clicker:get_player_name()
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user