preciousstones api

Discussion in 'Spigot Plugin Development' started by JoKillerPT, Jun 11, 2018.

  1. im making a title when players entry on the region but need only send the message on entry, not across the all of the region

    that its i do to send the title
    Code (Java):
    @EventHandler
        public void onMove(PlayerMoveEvent e) {
            Player p1 = e.getPlayer();
            Block b1 = p1.getLocation().getBlock().getRelative(BlockFace.DOWN);
            Location loc = b1.getLocation();
            FieldFlag f1 = FieldFlag.ALL;
            FieldFlag f2 = FieldFlag.PREVENT_PVP;
           
           
            if (PreciousStones.API().isFieldProtectingArea(f1, loc) == true) {
                if (PreciousStones.API().flagAppliesToPlayer(p1, f2, loc) == false) {
                    p1.sendTitle("" ,ChatColor.GREEN + "Entering in a Region, PvP is " + ChatColor.RED + ChatColor.BOLD + "ON" );
                    return;
                }else {
                    p1.sendTitle("", ChatColor.GREEN + "Entering in a Region, PvP is " + ChatColor.GREEN + ChatColor.BOLD + "OFF" );
                }
            }
        }
    the api https://github.com/marcelo-mason/PreciousStones/wiki/Developers-API