Solved Why isnt that working?

Discussion in 'Plugin Development' started by MCWarmup, Sep 26, 2015.

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

    MCWarmup

    im gonna create a little plugin for a friend but i my replace method isnt working

    Code:
                                hearts = hearts.replace("[HEALTH]", (Damageable) p).getHealth ();
    it will give me that: http://prntscr.com/8knabx

    can anyone help me?
     
  2. Offline

    boomboompower

    char is a single character. (A Letter)
     
  3. Offline

    MexMaster

    @MCWarmup
    you can just replace a string with another string. The type of (Damageable) p).getHealth() is double.
    Just replace
    Code:
    ((Damageable) p).getHealth()
    with
    Code:
    "" + ((Damageable) p).getHealth()
    or
    Code:
    String.valueOf(((Damageable) p).getHealth())
    But the first attempt is faster.
     
  4. Offline

    MCWarmup

    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page