WorldGuard Region Events (Updated) icon

WorldGuard Region Events (Updated) -----

WorldGuard Region Events Updated API




  • Fixed Citizens bug
  • Added 1.20 support
----------, Nov 30, 2023

- Fixed Citizens bug
- Added 1.19 support
----------, Jun 26, 2022

- Added Citizens as soft-dependent
- Added additional !=null queries
- Fixed when MoveEvent was already canceled by another plugin
----------, Feb 3, 2022

fixed Citizens bug
----------, Jan 28, 2022

Added method getPlayersInRegion
Documentation: https://reloadedgen.net/wgregionevents/
----------, Jan 26, 2022

Fixed version compatibility
----------, Jan 10, 2022

Fixed a bug that did not trigger the RegionLeftEvent.
----------, Jan 9, 2022

The package name has changed from de.netzkronehd.wgregionevents to de.netzkronehd.wgregionevents .

All the methods has stayed the same, it's just a backend update.
----------, Nov 27, 2021

I fixed bugs where some events weren't fired. This was the case with teleporting.
----------, May 19, 2021

I fixed a NullPointerException at the method event.getFrom()
----------, Jan 26, 2021

There are 2 more methods in the Events:

-
Code (Text):
event.getTo()
-
Code (Text):
event.getFrom()

I think that's self-explanatory
----------, Jan 25, 2021

There are 2 more methods in the Events:

-
Code (Text):
event.getTo()
-
Code (Text):
event.getFrom()
I think that's self-explanatory
----------, Jan 24, 2021

Code (Text):
package de.netzkronehd.WGRegionEvents;

import java.util.Map;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;

import com.sk89q.worldguard.protection.ApplicableRegionSet;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;

import de.netzkronehd.WGRegionEvents.api.SimpleWorldGuardAPI;

public class Example extends JavaPlugin {
   
    private static Example instance;
    private SimpleWorldGuardAPI simpleWorldGuardApi;
   
   
    @Override
    public void onEnable() {
        instance = this;
       
        simpleWorldGuardApi = new SimpleWorldGuardAPI();  
       
       
//        Getting a region by id (unperformant)
        ProtectedRegion spawn = simpleWorldGuardApi.getRegion("spawn");
        if (spawn != null) {
            spawn.getOwners().getUniqueIds();
        }
       
//        Getting a region by id and world
        ProtectedRegion pvp = simpleWorldGuardApi.getRegion("pvp", Bukkit.getWorld("world"));
        if (pvp != null) {
            pvp.getFlags();
        }
       
//        Getting all regions (unperformant)
        Map<String, ProtectedRegion> allRegions = simpleWorldGuardApi.getRegions();
        ProtectedRegion spawn2 = allRegions.get("spawn2");
        if (spawn2 != null) {
            spawn2.getType();
        }
       
//        Getting all regions on a Location
        ApplicableRegionSet localRegions = simpleWorldGuardApi.getRegions(new Location(Bukkit.getWorld("world"), 102, 147, 2002));
        for(ProtectedRegion rg : localRegions) {
            if(rg.getId().equalsIgnoreCase("spawn")) {
               
            }
        }
       
//        Getting all regions in a World
        Map<String, ProtectedRegion> worldRegions = simpleWorldGuardApi.getRegions(Bukkit.getWorld("world"));
        for(ProtectedRegion rg : worldRegions.values()) {
            rg.getId();
        }
       
    }
   
   
    public SimpleWorldGuardAPI getSimpleWorldGuardApi() {
        return simpleWorldGuardApi;
    }
   
    public static Example getInstance() {
        return instance;
    }
}
 
----------, Dec 19, 2020

Resource Information
Author:
----------
Total Downloads: 5,060
First Release: Oct 10, 2018
Last Update: Nov 30, 2023
Category: ---------------
All-Time Rating:
9 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings