If you have any issues, please message me first before leaving a review. (Scroll down for more info)
WorldGuard Region Events allows modders to trigger function if a player enters or leaves a region. It adds four events that you can use to trigger your functions: RegionEnterEvent, RegionEnteredEvent, RegionLeaveEvent and RegionLeftEvent. They can be used just as any other Bukkit event (for more information look here.)
The RegionEnteredEvent and RegionLeftEvent are triggered a short time after a player entered/left a region so you cannot cancel them, but use the to check the flags of the regions the player is in.
Example
If you don't want to create a plugin ignore this.
To send a player a text whenever he enters a region:
If you don't want to create a plugin ignore this.
To send a player a text whenever he enters a region:
Code (Text):
import com.mewin.WGRegionEvents.events.RegionEnterEvent;
@EventHandler
public void onRegionEnter(RegionEnterEvent e)
{
e.getPlayer().sendMessage("You just entered " + e.getRegion().getId());
}
@EventHandler
public void onRegionEnter(RegionEnterEvent e)
{
e.getPlayer().sendMessage("You just entered " + e.getRegion().getId());
}
Code (Text):
import com.mewin.WGRegionEvents.events.RegionLeaveEvent
@EventHandler
public void onRegionLeave(RegionLeaveEvent e)
{
if (e.getRegion().getId().equals("jail") && e.isCancellable()) // you cannot cancel the event if the player left the region because he died
{
e.setCancelled(true);
e.getPlayer().sendMessage("You cannot leave the jail!");
}
}
@EventHandler
public void onRegionLeave(RegionLeaveEvent e)
{
if (e.getRegion().getId().equals("jail") && e.isCancellable()) // you cannot cancel the event if the player left the region because he died
{
e.setCancelled(true);
e.getPlayer().sendMessage("You cannot leave the jail!");
}
}
- No permission

Problems?
If you have problems with this plugin use the Discussion tab if you're having an issue which you don't think is a bug.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.8, 1.9, 1.10
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
WorldGuard Region Events is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10. Downloaded 23,640 times (via Spigot). Download it and open it directly in the game.