WorldGuard Region Events
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!"); } }
Still waiting for a reply please :)
@der_mewin
Any idea what would be causing this issue then?
@AnorZaken
I had to move to another hoster, you can find the javadoc on http://mewin.bplaced.net/javadoc now.
Um, is the javadoc temporarily offline or is there some bigger issue?
When this plugin is installed, the syncChunkLoad timings go insane. Check the timings report here. When i remove WGRegionEvents, all is normal.
ummmm, no folder or configure file was generated, the plugin shows in the /plugins menu, but no help available.
Hi,
I'm using The latest CraftBukkit Beta build and Minecraft 1.6.2, and when i installed this plugin (It's required for RegionJukebox) the plugin did not generate any config file in the plugins folder, it didn't show up when I typed /help, and it has no commands for it appearing. I am using the latest version of this plugin, Bukkit, and Minecraft.
If anyone can, please tell me what I'm doing wrong, or how I can fix this.
@rtainc
Thank you :)
Why do all you people HAVE to have an updated version?! Why not test it and see that it works PERFECT FINE with 1.6.2?
Please 1.6.2 ! Thanks
Please update this amazing plugin to Bukkit 1.6.1!
Thanks! :)
@wbmasterchief
Does WorldGuard work correctly?
What?
14:02:42 [SEVERE] Could not load 'plugins\WGRegionEvents.jar' in folder 'plugins' org.bukkit.plugin.UnknownDependencyException: WorldGuard at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:195) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugins(CraftServer.java:239) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.<init(CraftServer.java:217) at net.minecraft.server.v1_5_R3.PlayerList.<init(PlayerList.java:55) at net.minecraft.server.v1_5_R3.DedicatedPlayerList.<init(SourceFile:11) at net.minecraft.server.v1_5_R3.DedicatedServer.init(DedicatedServer.java:106) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:382) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
Works all fine, why he should update?
Please, update this plugin ! :'(
I am using Spigot (which is built off of bukkit) and I guess this plugin isn't functional with it? it keeps locking up the server. Is there any way you could fix this?
Or is it TagAPI causing the issues?
@daancrafter1234
Could you please add a smaller picture? :)
@der_mewin
Thank you very much sir. Like your creations on bukkit.org *Respect*
@daancrafter1234
You have to add WorldGuard and WorldEdit as libraries, too. Then you have to import ProtectedRegion.
In the RegionLeaveEvent example i see "e.getRegion().getId()", but when i try to type .getId() it doesn't do anything but giving me an error: "The method getRegion() from the type RegionEvent refers to the missing type ProtectedRegion". Anyone got a solution? thank you