Set player stat

Discussion in 'Plugin Development' started by AlpacaKyle, Mar 5, 2020.

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

    AlpacaKyle

    Hello! I am developing a server, and I need to be able to set player stats e.g. totalBatsKilled so that I can use that variable for other code. Please help!
     
  2. Offline

    Sensevx

    I haven't tried it but I think this will do it.

    Player#setStatistic(@NotNull Statistic statistic,@NotNull EntityType entityType,int newValue)
     
    Last edited: Mar 6, 2020
  3. Offline

    AlpacaKyle

    I tried this and looked it up, and this is what I found: p.setStatistic(Statistic statistic, EntityType entityType, int newValue); Can you please help me understand what to change all of these values to?

    I got it to work, thanks!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Mar 6, 2020
  4. Offline

    Machine Maker

    Please mark this thread as Solved if your issue had been resolved.
     
  5. Offline

    AlpacaKyle

    how do i mark it?
     
  6. Offline

    KarimAKL

    @AlpacaKyle Scroll up to the top of this page, then to the right you shoud see some text that says "Thread Tools", press that and change the title, you should be able to set the title prefix to solved.
     
Thread Status:
Not open for further replies.

Share This Page