aboutsummaryrefslogtreecommitdiff
path: root/src/onload
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-06-16 15:37:24 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-06-16 15:37:24 +0200
commit5e4f32b0b24a79ee6398a42f203e8fd669d207fb (patch)
tree46a7c8eedc7cfd7357ef37dac36ff1da0e7ca885 /src/onload
parent64220b7a3f5f3145f7e9457e0c0bfbb15e8c6c76 (diff)
downloadskycraft-5e4f32b0b24a79ee6398a42f203e8fd669d207fb.tar.xz
Villager Protection
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