SkriptLang / skript-reflect

Powerful reflection utilities for Skript.
MIT License
65 stars 20 forks source link

BlockBreakEvent not working correctly #32

Closed altruiis closed 3 years ago

altruiis commented 3 years ago

Describe the bug I have a BlockBreakEvent that should add to a variable everytime the block is broken and the person is in a town. However, sometimes it adds two to the variable despite only breaking the block once. Some ores don't even work at all.

Code: https://hastebin.com/uracawofut.sql

To reproduce

  1. Install skript-reflect and Skript
  2. Write the event pasted above
  3. Some ores add to the variable twice, some not at all.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots image Iron ore does it twice, lapis does it once (which is how they should all function) and gold ore does not even function whatsoever.

Server information

Additional context Add any other context about the problem here.

TPGamesNL commented 3 years ago

Can you add a broadcast at the top of the trigger, to debug

altruiis commented 3 years ago

Can you add a broadcast at the top of the trigger, to debug

image Lapis still does it once, so it works properly for that block image Iron ore only broadcasts once, but it adds to the variable twice? image Gold ore does not add to the variable, but it still broadcasts the message. image Coal ore broadcasts once and then adds to the variable three times, but none of them broadcast twice, they all broadcast once.

TPGamesNL commented 3 years ago

I recommend using else if's instead of if's if you chain them like that

altruiis commented 3 years ago

Weird, it seems to be working now when I haven't modified the file at all. All ores only add to the variable once. No clue what the issue was but I guess I can close this now. Thank you!

TPGamesNL commented 3 years ago

You're welcome :D