areas icon indicating copy to clipboard operation
areas copied to clipboard

Protection against entity placement

Open CLtheman1 opened this issue 3 years ago • 2 comments

Protecting areas from players being able to place entities in them should be something that this mod includes.

Note: This should include protection against the placement of entities from APercy's mods. I was told this was gonna be tricky.

CLtheman1 avatar Mar 13 '22 18:03 CLtheman1

Please specify the API function to overwrite. Protection mods have no control about entity placement and rely on calls from (or to) the mob mod's API.

SmallJoker avatar Mar 25 '22 21:03 SmallJoker

Copy pasting my opinion here from another protection mod:

This should be done by doing minetest.is_protected(pos, name) on mod that is placing, digging, building, whatever. Protector mods should not allow or prevent any specific actions by themselves.

Minetest engine documentation for protection check:

  • minetest.is_protected(pos, name): returns boolean
    • Returning true restricts the player name from modifying (i.e. digging, placing) the node at position pos.
    • name will be "" for non-players or unknown players.

@CLtheman1 have you tried to open issue about this in APercy's mods issue tracker? If not yet I would recommend doing that even if implementation would end up into protection mod(s).

This should include protection against the placement of entities from APercy's mods. I was told this was gonna be tricky.

This should be fairly simple thing to implement in mod that adds those entities but implementing and maintaining it in protection mod will be tricky and fragile.

S-S-X avatar Jun 02 '22 23:06 S-S-X