[Help] Using args[1] as a Player?

Discussion in 'Plugin Development' started by XvBaseballkidvX, Oct 18, 2013.

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

    XvBaseballkidvX

    Hello everyone!

    I am currently working on a Crate Plugin and have ran into an issue.
    I want the console to be able to execute a command like /crate give args[1]
    and it would add the crate to args[1] inventory. I have been thinking about a c way to do this (haven't tried it out).

    Idea: Get online players and see if args[1] matches an Online Players name.

    I will test this idea above, and see if it works. If you have any other ideas please share!

    NOTE: I want to avoid using HashMaps/ArrayLists for this.

    Thank you for reading!
    All help is appreciated! :D
     
  2. Offline

    Jogy34

    Bukkit.getPlayer(args[1]);
     
  3. Offline

    XvBaseballkidvX

    JPG2000 likes this.
  4. Offline

    JPG2000

    Use BukkitmgetPlayerExact or else the name may target someone else with an applocable name.
     
Thread Status:
Not open for further replies.

Share This Page