Help with regions

Discussion in 'Plugin Development' started by raupy, Sep 12, 2011.

Thread Status:
Not open for further replies.
  1. Offline


    Hello, first my listener source:
    package me.raupy.regionChat;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.player.PlayerChatEvent;
    import org.bukkit.event.player.PlayerListener;
    import org.bukkit.util.Vector;
    import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
    public class RegionChatPlayerListener extends PlayerListener {
        public static RegionChat plugi;
        public RegionChatPlayerListener(RegionChat instance) {
            plugi = instance;
        public void onPlayerChat(PlayerChatEvent event) {
            Player player = event.getPlayer();
            boolean canbuild = plugi.getWorldGuard().canBuild(player,
                    player.getLocation().getBlock().getRelative(0, -1, 0));
            if (canbuild == false) {
                        + "[RegionChat]"
                        + ChatColor.RED
                        + plugi.getFileManager().readString(
            } else {
    If you are in a worldguard region where you can't build, you can't chat. That works.
    But I want to make in in specifiy regions, which are saved in my plugins/RegionChat/config.yml file. With saved I mean, the saved WorldGuard regionnames. But it doesn't work for me, whatever I try. Please help me.

    ~ raupy
Thread Status:
Not open for further replies.

Share This Page