« Back to search

Mod

Player Visibility Api

by erov · score 4.1 · license: MIT

Player Visibility Api

Download latest release

Easily manage player visibility in a similar way to area protection

library multiplayer

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.