Dynamic Row in Sidebar

Discussion in 'Plugin Development' started by baenisaa, May 17, 2021.

  1. Offline


    I'm currently working on a library for my Server and to be able to create a sidebar later really easily.
    My issue is not really a Spigot issue but Java in general.
    I have a method called `addDynamicRow(String... content)` to add a dynamic row to my sidebar which then will loop through all Strings given in the params. If there is only one String defined, it will just refresh that one. So far so good.
    My issue is pretty logical, I just did a mistake of thought.
    If I call the method like `addDynamicRow("Online: "+cloudServer.getOnlineCount())`, the row is technically refreshing but the value is of course not as the method `getOnlineCount` will just run once before passing the information/result to the `addDynamicRow`-method. So logically I need the parameter to run later within the `addDynamicRow`-method but is that even possible in some way? Any ideas?

    Thanks in advance.

Share This Page