jmc icon indicating copy to clipboard operation
jmc copied to clipboard

Adding multiple timers to a single target causes problems

Open w00tyd00d opened this issue 11 months ago • 0 comments

Describe the bug

The Timer.add() allows the user to add multiple timers to a single entity, which causes buggy and unintended behavior.

image

In __load__.mcfunction:

image

In __private__/timer_add/main.mcfunction:

image

To Reproduce

  1. 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.

w00tyd00d avatar Mar 30 '24 13:03 w00tyd00d