1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-11-07 18:55:23 +01:00

show mob repellent area when punched using vizlib (thx SwissalpS)

This commit is contained in:
tenplus1
2025-11-07 07:45:59 +00:00
parent db8fab6615
commit 59ae6c6923
3 changed files with 10 additions and 2 deletions

View File

@@ -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({

View File

@@ -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

View File

@@ -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