player_visibility_api 🔗
Provides an abstraction for player object observers. Makes it work similar to Luanti's core protection API. In that, mods are encouraged to override the existing function while making a false condition call the old function.
So you would establish conditions for player visibility by first making a local copy of the pv_api.is_visible
,
then replace the function with a function that checks your desired conditions and either returns false or the
result of the old function. That way, much like core.is_protected
, multiple mods can take advantage.
I hope this will be useful for mods that do things like let players block other players.