diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-06-16 15:37:24 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-06-16 15:37:24 +0200 |
commit | 5e4f32b0b24a79ee6398a42f203e8fd669d207fb (patch) | |
tree | 46a7c8eedc7cfd7357ef37dac36ff1da0e7ca885 /src/onload | |
parent | 64220b7a3f5f3145f7e9457e0c0bfbb15e8c6c76 (diff) | |
download | skycraft-5e4f32b0b24a79ee6398a42f203e8fd669d207fb.tar.xz |
Villager Protection
Diffstat (limited to 'src/onload')
-rw-r--r-- | src/onload/villager_protection.lua | 7 |
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 |