jmc
jmc copied to clipboard
Adding multiple timers to a single target causes problems
Describe the bug
The Timer.add()
allows the user to add multiple timers to a single entity, which causes buggy and unintended behavior.
In __load__.mcfunction
:
In __private__/timer_add/main.mcfunction
:
To Reproduce
- Use
Timer.add()
to add a timer to the same target twice
Expected behavior
Should probably throw an exception, telling the user the timer already existed prior and should use Timer.set()
instead.
Desktop
- Windows 10
Additional context
Timer.add()
also adds an additional scoreboard to the datapack, even when the scoreboard has already been created. This only occurs in the first instance of using the scoreboard within a Timer.add()
call, so it seems Timer
properly caches previously scoreboard its created but doesn't recognize scoreboards created by other means.