Solved [Help] Couple Questions

Discussion in 'Plugin Development' started by billman555555, Aug 29, 2013.

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

    billman555555

    Hi i am trying to make a plugin and need some help with some stuff.
    I will update this thread when i need more help.

    1. How do you set creative flying on for players.
    2.How do you make players unable to talk to players in different teams.
    3. Why does Bukkit.broadcastMessage("[Shout]" + player.getName() + args) give me [Shout] *player* [javaLang@27563037]

    I will post more later, thanks for the help.
     
  2. billman555555
    1. use the setFlying(boolean) method in Player class.
    Code:
    somePlayer.setFlying(true/false);
    2. Use AsyncPlayerChatEvent (or PlayerChatEvent), loop through your teams, and remove enemy team players as recipient.
    3. chasechocolate already answered your question here.
     
  3. Offline

    billman555555

    Thanks!

    Assist When i do this:
    Code:
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
      if(cmd.getName().equalsIgnoreCase("fly")) {
      Player player = (Player) sender;
      player.setFlying(true);
      return true;
      }
      return false;
        }
    
    And then do /fly in game it gives me an Error.

    EDIT: Never mind i forgot this:
    Code:
    player.setAllowFlight(true);
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
Thread Status:
Not open for further replies.

Share This Page