aboutsummaryrefslogtreecommitdiff
path: root/src/onload
diff options
context:
space:
mode:
Diffstat (limited to 'src/onload')
-rw-r--r--src/onload/villager_protection.lua7
1 files changed, 7 insertions, 0 deletions
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