Minecraft WorldGuard Region Events mod 2024 download
logo
minecraft mod WorldGuard Region Events

WorldGuard Region Events

Game Version: 1.9
Total Downloads: 41,796
Updated: Apr 27, 2016
Created: Oct 19, 2012
Download WorldGuard Region EventsDownload Earlier Versions

Earlier Versions

Name Size Uploaded Game Version Downloads
WorldGuard Region Events 1.2.1 release 13.02 KB Apr 27, 2016 1.9 14,270 download WorldGuard Region Events WorldGuard Region Events 1.2.1 releaseDownload
WorldGuard Region Events 1.2 release 23.26 KB Feb 1, 2013 1.4.7 24,254 download WorldGuard Region Events WorldGuard Region Events 1.2 releaseDownload
WorldGuard Region Events 1.1 release 23.26 KB Nov 20, 2012 CB 1.4.5-R0.1 2,035 download WorldGuard Region Events WorldGuard Region Events 1.1 releaseDownload
WorldGuard Region Events 1.0 beta 14.57 KB Oct 19, 2012 CB 1.3.2-R2.0 1,237 download WorldGuard Region Events WorldGuard Region Events 1.0 betaDownload

Description

Share this:

Description

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.

The JavaDoc of WGRegionEvents can be found here.

Example

If you don't want to create a plugin ignore this

To send a player a text whenever he enters a region:

import com.mewin.WGRegionEvents.events.RegionEnterEvent;
...

@EventHandler
public void onRegionEnter(RegionEnterEvent e)
{
  e.getPlayer().sendMessage("You just entered " + e.getRegion().getId());
}

Or to quit players from escaping from jail:

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!");
  }
}

Comments

Add a comment