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!"); } }
-
View User Profile
-
Send Message
Posted Oct 10, 2020Please add:
Needed to add it by myself
-
View User Profile
-
Send Message
Posted Mar 1, 2019Anyone interested with an 1.13 version :
https://www.spigotmc.org/resources/worldguard-events.65176/
-
View User Profile
-
Send Message
Posted Dec 13, 2018-
View User Profile
-
Send Message
Posted Oct 5, 2018I noticed this was updated in 2016 is it being continued or do we use SpencerRyanC's "WGRegionEvents-Continued"?
Found this error in 1.13.1 - https://pastebin.com/4sSwMhU2
-
View User Profile
-
Send Message
Posted Dec 21, 2015ATTENTION ATTENTION ATTENTION ATTENTION
I have continued the project on Spigot! https://www.spigotmc.org/resources/wgregionevents-continued.15946/
ATTENTION ATTENTION ATTENTION ATTENTION
-
View User Profile
-
Send Message
Posted Jun 23, 2015@Keyman1986
It breaks it even in the old WG6.0. :(
-
View User Profile
-
Send Message
Posted Jun 23, 2015Could someone recompile this for Spigot 1.8.7 and fix the "enderpearl deny" flag that's been broken since forever? Please!
-
View User Profile
-
Send Message
Posted Jun 23, 2015This plugin is having problems with the new WG 6.1. It allows denied enderpearl flags.
-
View User Profile
-
Send Message
Posted May 23, 2015@Peter234
Works for me
-
View User Profile
-
Send Message
Posted Mar 29, 2015Any chance on a 1.8 update?
-
View User Profile
-
Send Message
Posted Jan 22, 2015Uhh, maybe this will be a better way of showing/explaining it.
I have two test Regions defined;
TestParent(Blue with a priority of 5) & a Greeting Flag.
TestChild(Red with a priority of 10) & a Greeting Flag.
I also have added (for debug purposes e.getPlayer().sendMessage("§aYou just entered " + e.getRegion().getId()); (in green)
When walking through the area I get TestParents Greeting + Debug TestParents THEN TestChilds Greeting + Debug TestChild AND FINALLY TestParents Greeting.
The issue is, the region event isn't fired again when entering from the child to the parent which we kind of need for our transitioning tiltes to work.
Any ideas? Ill leave two images below, one of the area and one of the text. Thanks guys!
Test Area: http://i.gyazo.com/cc962da1c61cb944ea6cd3bf2ffa655e.png
Region Text: http://i.gyazo.com/c6eb204612288dc06a72e0a2f8b86deb.png
-
View User Profile
-
Send Message
Posted Jan 21, 2015-Snip- Explained it better above.
http://i.gyazo.com/ffcd2845203b0ab4fe233c8868ad6b39.png
-
View User Profile
-
Send Message
Posted Jan 10, 2015@woutwoot
Thank you very much!
-
View User Profile
-
Send Message
Posted Jan 6, 2015@LaughNgamez
I've made an update (recompile) for this plugin that works with WorldGuard 6 and Bukkit 1.8 You can download development builds of this update at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk: WGRegionEvents
-
View User Profile
-
Send Message
Posted Dec 18, 2014Please add support for World Guard 6.0
-
View User Profile
-
Send Message
Posted Dec 5, 2014@liadm97
@der_mewin
You are using WorldGuard 6 aren't you? WorldGuard Region Events 1.2 is not compatible.
-
View User Profile
-
Send Message
Posted Dec 4, 2014@liadm97
Good God. Why can you not just Pastebin your errors? It doesn't take more than 1 click extra, literally! Pastebin.com
-
View User Profile
-
Send Message
Posted Sep 29, 2014I need help; I'm writing a plugin using those events so when you enter region you loose certain permissions (only while in that region)
I was up until 7am reading javadocs; nothing! I use essentials_groupmanager and while in a region I need two Permissions disabled
griefprevention.claims griefprevention.createclaims
Please help, my event's code: http://pastebin.com/7yMJPg1g
Thanks!
-
View User Profile
-
Send Message
Posted Jul 8, 2014@TheDroneWolf
I agree with you, would love to see this plugin integrated or updated :)
-
View User Profile
-
Send Message
Posted Jul 4, 2014@NathanWolf
Btw, you should fork my repository again and edit the current master-branch. When I created the test-branch I somehow broke the networking and it cannot be merged into master again ;) .