diff --git a/crafts.lua b/crafts.lua index 7b4a408..2cba9da 100644 --- a/crafts.lua +++ b/crafts.lua @@ -207,7 +207,14 @@ core.register_node("mobs:mob_repellent", { tiles = {"mobs_repellent.png"}, is_ground_content = false, groups = {handy = 1, cracky = 3}, - sounds = mobs.node_sound_stone_defaults() + sounds = mobs.node_sound_stone_defaults(), + on_punch = function(pos, node, player, pointed_thing) + + if minetest.get_modpath("vizlib") and player + and player:get_wielded_item():get_name() == "" then + vizlib.draw_cube(pos, 16.5, {color = "#6f1a1a", player = player}) + end + end }) core.register_craft({ diff --git a/mod.conf b/mod.conf index f6353e8..99a9327 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = mobs description = Adds a mob api for mods to add animals or monsters etc. -optional_depends = default, tnt, invisibility, lucky_block, cmi, toolranks, pathfinder, player_api, mtobjid, visual_harm_1ndicators, mcl_sounds, mesecons +optional_depends = default, tnt, invisibility, lucky_block, cmi, toolranks, pathfinder, player_api, mtobjid, visual_harm_1ndicators, mcl_sounds, mesecons, vizlib min_minetest_version = 5.0 diff --git a/readme.MD b/readme.MD index da27a32..65fb2bf 100644 --- a/readme.MD +++ b/readme.MD @@ -34,6 +34,7 @@ https://forum.minetest.net/viewtopic.php?f=11&t=9917 * Fixed fall damage check when riding mob * Calculate damage before do_punch function called * Add function to check for dropped items and for mob to do something with them +* Add vizlib support to draw mob repellent area when punched ### Version 1.61