Trying to schedule a function to make a loop.

Goal: I need a an action bar to be displayed constantly once the function display_bank_balance is run.

Contents of function:

execute as @s run title @s actionbar {"text":"Bank Balance: ","color":"gold","extra":[{"score":{"name":"@s","objective":"bank"},"color":"green"}]

schedule function home:display_bank_balance 1s

This is what I currently have. It does not work how I want it too. Heres what happens when it runs. It runs twice as @s (me), then it continues to run but as the server, therefore not displaying the actionbar to me. What does the issue appear to be and how can I fix it?

What I've tried doing:

  • I added execute as @s run in front of schedule function justin:display_bank_balance 1s, but it does the same thing except it stops looping after 3 times.
  • I removed all execute as @s run from the commands, but it still does the same thing.

More info:

  • I'm in 1.20.1 java
  • The function above is being called from another function w/ function home:display_bank_balance
Continue to help post