TL;DR: look at the example script and copy paste the important lines into your own script.

What is a Yeroc% Skip?

Sometimes in scripts for maps, you want to teleport the player, or give them items, or set variables which allow them to progress further. Sometimes, this happens after a delay: commonly, a back-and-forth dialogue script concludes with the player being teleported away to a new room.

However, this enables an exploit, usually known as a “yeroc%” run (after Mouthwest, formerly known as Yeroc424, who popularised it). During the execution of a dialogue script, the player can /kill to reset their timer, and when the script concludes they will be teleported, essentially beginning halfway through the map with a zero second timer.

While this is against the rules, it’s usually good for mapmakers to guard against this anyway. I thought I’d make it even easier, with a namespace appropriately named yerocpatch. Everything has guards and checks in place, so you don’t have to worry about messing up players if they join another map mid-execution.

Example Script

This is how you would use it in your own scripts.

# put this at the start of your script, just below things like cooldowns@define Int yeroc_check = yerocpatch::setup(player)# most of your script goes here, for example some dialogue@player NPC: Hi! I'm a placeholder NPC created for dialogue demonstration purposes.@delay 80@player NPC: And that was a four second delay during which you could have reset your timer!# add this section before you do anything with the player: it checks if the player's run is still valid@var yeroc_check = yerocpatch::verify(player, yeroc_check, "default")# terminates the script if the run is invalid (verification codes 0, 1, 2, 3), so the teleport doesn't run@if yeroc_check < 4    @return@fi# do the possibly skip-enabling thing, like a teleport@bypass /execute in minecraft:theta run teleport @s 1234 56 789

Verification Codes

You may have noticed a reference to verification code 4 in the conditional statement. The full list of codes is as follows:

Advanced Usage

At any point in your script before verification, you can use the line @var yerocpatch::invalidate(player, yeroc_check) to make sure the verification fails. This is useful in conditional branches, to terminate scripts (eg. if the player walks back into an area they shouldn’t, even if this doesn’t reset their timer).

You may also use @var yerocpatch::terminate(player, "your-map-code-here") in any other script to invalidate every ongoing check in your map.

In the verification stage, you may replace “default” with any string. The flags inside will determine the verification behaviour.

The namespace will only work on maps which have timers attached: this does not generally include maps on Board. It will not throw errors if you use the scripts, but simply not invalidate timers or kill players. If you want to test the behaviour of your scripts, ask an admin to move your map to another area which has timers (like the Valley).