From 5e4f32b0b24a79ee6398a42f203e8fd669d207fb Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Tue, 16 Jun 2020 15:37:24 +0200 Subject: Villager Protection --- src/onload/villager_protection.lua | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/onload/villager_protection.lua (limited to 'src/onload/villager_protection.lua') diff --git a/src/onload/villager_protection.lua b/src/onload/villager_protection.lua new file mode 100644 index 0000000..3e0a5f7 --- /dev/null +++ b/src/onload/villager_protection.lua @@ -0,0 +1,7 @@ +minetest.registered_entities["mobs_mc:villager"].on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir) + if puncher:get_wielded_item():get_name() ~= "skycraft:god_stick" then + minetest.chat_send_player(puncher:get_player_name(), minetest.colorize("#FF6737", "Hey! Sorry, you can't hit that here!")) + else + self.object:remove() + end +end -- cgit v1.2.3