Help With Teams

Discussion in 'Plugin Development' started by thatdubstepgamer, Sep 27, 2013.

Thread Status:
Not open for further replies.
  1. Hello I need help on a new plugin im creating whenever I do /enter it never works and I do have it registered in the plugin.yml
    1. if(commandLabel.equalsIgnoreCase("enter")){
    3. if(players <= 0){
    5. int blueX = this.getConfig().getInt("Blue" + ".X");
    6. int blueY = this.getConfig().getInt("Blue" + ".Y");
    7. int blueZ = this.getConfig().getInt("Blue" + ".Z");
    8. int blueYaw = this.getConfig().getInt("Blue" + ".Yaw");
    9. int bluePitch = this.getConfig().getInt("Blue" + ".Pitch");
    10. Object world = this.getConfig().get("Blue" + ".World");
    11. Location blue = new Location((World) world, blueX, blueY, blueZ, blueYaw, bluePitch);
    12. player.teleport(blue);
    13. player.sendMessage(ChatColor.GRAY+"You have joined the blue team!");
    14. if(players <= 1){
    15. int redX = this.getConfig().getInt("Red" + ".X");
    16. int redY = this.getConfig().getInt("Red" + ".Y");
    17. int redZ = this.getConfig().getInt("Red" + ".Z");
    18. int redYaw = this.getConfig().getInt("Red" + ".Yaw");
    19. int redPitch = this.getConfig().getInt("Red" + ".Pitch");
    20. Object world1 = this.getConfig().get("Red" + ".World");
    21. Location red = new Location((World) world1, redX, redY, redZ, redYaw, redPitch);
    22. player.teleport(red);
    23. player.sendMessage(ChatColor.GRAY+"You have joined the red team!");
    24. }
    25. }
  2. Offline


    Define "it never works". You might also consider posting more code, as you're referencing variables there that are declared earlier, which is useful information if someone wants to help you. Posting your plugin.yml might help as well.
  3. When I run /enter nothing happens
  4. For helping you out: please provide your full CommandExecutor and the onEnable part where you set this executor to be the executor for the /enter command.
    JPG2000 likes this.
  5. Offline


    thatdubstepgamer This thread is kind of old, but you can't just say "it never works". Show us a stack strace, your onEnable etc.

    Also, something I would like to point out. That "Battlefield 3" plugin of "yours" isn't exactly yours. Every time you needed a new feature, you created a thread on it, then just copied the code.

    And one more thing. In your code, you make a variable named world, yet its not even a world object. Its just an Object variable?
Thread Status:
Not open for further replies.

Share This Page