ModsJava
WGRegionEvents Continued
Minecraft Java mod. Downloads from the MC Java Mods app on Android.
⬇ Download on SpigotDoes your plugin do something when a player enters or exists a region? Are you wanting to use a plugin that depends on WGRegionEvents?
This is a continuation of the helpful API WGRegionEvents. It has been updated to Java 7, Spigot 1.8.8, and WorldGuard 6.1.
I would like to give credit to the original developer for his original API. He wrote it very well. The project has since been abandoned, so I chose to take it over. The original project can be found here: http://dev.bukkit.org/bukkit-plugins/worldguard-region-events/
Example (derived from original post):
What has been done:
This is a continuation of the helpful API WGRegionEvents. It has been updated to Java 7, Spigot 1.8.8, and WorldGuard 6.1.
I would like to give credit to the original developer for his original API. He wrote it very well. The project has since been abandoned, so I chose to take it over. The original project can be found here: http://dev.bukkit.org/bukkit-plugins/worldguard-region-events/
Example (derived from original post):
Code (Text):
import com.mewin.WGRegionEvents.events.RegionEnterEvent;
...
@EventHandler(priority = EventPriority.NORMAL)
public void onRegionEnter(RegionEnterEvent e){
e.getPlayer().sendMessage("You just entered " + e.getRegion().getId());
}
//Or to stop players from escaping jail:
import com.mewin.WGRegionEvents.events.RegionLeaveEvent;
...
@EventHandler(priority = EventPriority.NORMAL)
public void onRegionLeave(RegionLeaveEvent e){
if (e.getRegion().getId().equals("jail") && e.isCancellable()){ //You cannot cancel a region change if the player spawned (eg died) or disconnected.
e.setCancelled(true);
e.getPlayer().sendMessage("You cannot leave the jail!");
}
}
...
@EventHandler(priority = EventPriority.NORMAL)
public void onRegionEnter(RegionEnterEvent e){
e.getPlayer().sendMessage("You just entered " + e.getRegion().getId());
}
//Or to stop players from escaping jail:
import com.mewin.WGRegionEvents.events.RegionLeaveEvent;
...
@EventHandler(priority = EventPriority.NORMAL)
public void onRegionLeave(RegionLeaveEvent e){
if (e.getRegion().getId().equals("jail") && e.isCancellable()){ //You cannot cancel a region change if the player spawned (eg died) or disconnected.
e.setCancelled(true);
e.getPlayer().sendMessage("You cannot leave the jail!");
}
}
What has been done:
- The most recent original code has been rejuvenated with updated dependencies.
- Added onDisable method.
- Added onEnable and onDisable console logs.
- Modified plugin version.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- 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.
WGRegionEvents Continued is a free Minecraft Java mod. Downloaded 9,508 times (via Spigot). Download it and open it directly in the game.