Yet Another World Protector is a server-side protection mod which allows you to protect your creations against various different events/actions of players, mobs and the environment. It was inspired by the forge mod WorldProtector and the WorldGuard plugin.
To handle players entering and leaving regions, a trigger-like system (optimal with events) would be handy.
Beside other things, this system would allow it to display the region name or other messages to the player when entering/leaving a region. It also could be extended to execute commands or do other things.
It can be described in more detail as follows:
There are triggers types: leave, enter, both
A region can have multiple triggers for each of these types.
A trigger invokes an action.
An action is (for now predefined) either:
displaying a text
sending a message to a player
changing the gamemode
executing a command (very general and covers the above-mentioned ones, but they are there for convenience)
...
Actions are executed in an order to ensure consistency.
Additionally there can be defined which affiliations are affected by these triggers
Triggers can be activated and deactivated for easier management
A region owner could define a list of triggers for when a player (with a specific affiliation) enters or leaves a region (or both), which are executed in a given order.
Syntax
The syntax could be the following:
/wp region <dim> <region> add trigger <leave|enter|both><display|send|gamemode|command><input> [order]
/wp region <dim> <region> <enable|disable> trigger <leave|enter|both><display|send|gamemode|command> <input> [order]
Applicable only for Local Regions and Dimensional Regions
Todos
Implement system to track player positions around regions
Implement trigger system to check whether a player is entering/leaving a region
Provide Events for entering/leaving as an API
Implement abstraction for trigger actions to show messages to players, execute commands, etc.
Implement a CLI to manage trigger for regions
...
Update wiki
Definition of Done
[ ] Implemented system to track player positions around regions
[ ] Implemented trigger system to check whether a player is entering/leaving a region
[ ] Implemented abstraction for trigger actions to show messages to players, execute commands, etc.
[ ] Implemented a CLI to manage trigger for regions
Description
To handle players entering and leaving regions, a trigger-like system (optimal with events) would be handy.
Beside other things, this system would allow it to display the region name or other messages to the player when entering/leaving a region. It also could be extended to execute commands or do other things.
It can be described in more detail as follows:
leave
,enter
,both
A region owner could define a list of triggers for when a player (with a specific affiliation) enters or leaves a region (or both), which are executed in a given order.
Syntax
The syntax could be the following:
/wp region <dim> <region> add trigger <leave|enter|both><display|send|gamemode|command><input> [order]
/wp region <dim> <region> <enable|disable> trigger <leave|enter|both><display|send|gamemode|command> <input> [order]
Applicable only for Local Regions and Dimensional Regions
Todos
Definition of Done