How Do I Check The Int That Someone Writes In Chat?

Discussion in 'Plugin Development' started by MCnumi, Aug 31, 2015.

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

    MCnumi

    Hi There,
    I am kind of new to Bukkit (as you can see) and was wondering
    how I can check if a player put a number into chat.
    (Any number at all.)
     
  2. Online

    timtower Administrator Administrator Moderator

    @MCnumi New to Bukkit, new to java or both?
    The classes that are numbers have a parse method, it will try to parse the string input, and will throw a numberformatexception when it isn't a number
     
    bwfcwalshy likes this.
  3. Offline

    MCnumi

    Actually both.
    But I want it to only continue if the message is a number....
     
  4. @MCnumi Please learn Java, even basic Java before learning Bukkit. Bukkit is an api developed in Java, Java knowledge is a must have.

    As Tim said, it will throw an exception if it isn't. So simply do what you want it to do if it isn't and if it is continue with whatever you want to do.
     
  5. Offline

    MCnumi

    I really am working hard to learn Java. I have 2 books I am learning off of and taking a course online.
    I just want to know how to check if it is a integer.

    Also this is a forum, am I in the wrong place to ask questions?
    (if not then could you point me to the questions forum >.>)
     
  6. iv ben looken 4 the ans 2 dis 4 ages i found it here
     
  7. Offline

    MCnumi

    Alright, I'm genuinely done with this Bukkit plugin.
    Not because it is hard, but because the people are just really discouraging.
    All I asked for was an answer I could understand and got shut down by three people.
    Not the first time.
     
    ChipDev likes this.
  8. @MCnumi We have given you the answer. Also given you a suggestion.
     
  9. Offline

    MCnumi

    Yea, thanks for that answer. I did write that I was new to Java right?
    Please lock thread, I will just ask my friend how to do it.
     
  10. Locked upon request.
     
Thread Status:
Not open for further replies.

Share This Page