summaryrefslogtreecommitdiff
path: root/cow.lua
diff options
context:
space:
mode:
Diffstat (limited to 'cow.lua')
-rw-r--r--cow.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/cow.lua b/cow.lua
index 02e6f0b..301a5f1 100644
--- a/cow.lua
+++ b/cow.lua
@@ -59,6 +59,7 @@ mobs:register_mob("mobs_animal:cow", {
end
local tool = clicker:get_wielded_item()
+ local name = clicker:get_player_name()
-- milk cow with empty bucket
if tool:get_name() == "bucket:bucket_empty" then
@@ -69,8 +70,8 @@ mobs:register_mob("mobs_animal:cow", {
end
if self.gotten == true then
- minetest.chat_send_player(clicker:get_player_name(),
- S("Cow already milked!"))
+ minetest.chat_send_player(name,
+ S("Cow already milked!"))
return
end
@@ -91,6 +92,7 @@ mobs:register_mob("mobs_animal:cow", {
return
end
+ mobs:protect(self, clicker)
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
})