Portion of code only works part of the time

Started by sc3d on

Topic category: Help with modding (Java Edition)

Last seen on 16:40, 18. Aug 2024
Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Portion of code only works part of the time
Sat, 08/17/2024 - 23:42 (edited)

This is the code I need help with. It is activated via a block break.

The code of the program

The random function and sound always work. The teleporting mechanism, however, only works about 40% of the time. It is not because I am being teleported to the same place; you can tell when that happens. I have tried:
 

  • Using a random double instead of int
  • Setting a higher minimum Y position

Please let me know if you have a solution. Thank you!

Edited by sc3d on Sat, 08/17/2024 - 23:42