WorldGuardEvents
This plugin is an API for developers used for adding multiple events related to WorldGuard.
This plugin is similar to WGRegionEvents but he is updated for Spigot 1.13+ and WorldGuard 7.0+ and will only support newest version.
Prerequisite:
- Spigot >= 1.13
- WorldGuard >= 7.0
- Java >= 8
Events:
RegionEnterEvent
/**
* Get the player involved in this event
* @return the player
*/
Player getPlayer ( ) ;
/**
* Get the region involved in this event
* @return the region
*/
ProtectedRegion getRegion ( ) ;
/**
* The reason of this event
* @return the reason
*/
Reason getReason ( ) ;
/**
* Define if this event is cancellable or not
* @return true if cancellable false if not
*/
boolean isCancellable ( ) ;
/**
* Define if this event is cancelled
* @return true if cancelled false if not
*/
boolean isCancelled ( ) ;
/**
* Define if this event need to be cancelled or not
* @param cancelled cancel the event
*/
void setCancelled ( boolean cancelled ) ;RegionLeaveEvent
/**
* Get the player involved in this event
* @return the player
*/
Player getPlayer ( ) ;
/**
* Get the region involved in this event
* @return the region
*/
ProtectedRegion getRegion ( ) ;
/**
* The reason of this event
* @return the reason
*/
Reason getReason ( ) ;
/**
* Define if this event is cancellable or not
* @return true if cancellable false if not
*/
boolean isCancellable ( ) ;
/**
* Define if this event is cancelled
* @return true if cancelled false if not
*/
boolean isCancelled ( ) ;
/**
* Define if this event need to be cancelled or not
* @param cancelled cancel the event
*/
void setCancelled ( boolean cancelled ) ;
Example:
@EventHandler
public void onRegionEnter ( RegionEnterEvent e )
{
if ( e. getRegion ( ) . getId ( ) . equalsIgnoreCase ( "restricted_area" ) && e. isCancellable ( ) )
{
e. setCancelled ( true ) ;
}
}
@EventHandler
public void onRegionLeave ( RegionLeaveEvent e )
{
e. getPlayer ( ) . sendTitle ( "You leaved : " + e. getRegion ( ) . getId ( ) , "" , 5 , 5 , 5 ) ;
}
If you have any feedback, suggestion or bug please tell me !
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta