]> git.lizzy.rs Git - skycraft.git/blobdiff - src/onload/villager_protection.lua
Villager Protection
[skycraft.git] / src / onload / villager_protection.lua
diff --git a/src/onload/villager_protection.lua b/src/onload/villager_protection.lua
new file mode 100644 (file)
index 0000000..3e0a5f7
--- /dev/null
@@ -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