Having problems with command args

Discussion in 'Plugin Development' started by tyler15555, Feb 26, 2012.

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

    tyler15555

    Hi, I've been trying to add a argument to my command by following the plugin tutorial on the bukkit wiki however whenever I type player.getWorld().getPlayer(args[0]) I get an error that getPlayer is undefined for type "World". Here is my code:
    Code:
    Player player = (Player) sender;
    Player target = player.getWorld().getPlayer(args[0]);
    Thank you for reading this,

    -Tyler
     
  2. Offline

    desup

    Try:
    Code:
    Player target = player.getServer().getPlayer(args[0]);
     
  3. Offline

    tyler15555

    Thank you, this fixed it :)
     
Thread Status:
Not open for further replies.

Share This Page