Repository navigation
1.20.1 Tasks
Version: This guide applies to Minecraft 1.20.1 (Forge).
A worker runs one task at a time. Start and stop tasks from the command screen or with /ratworker task. A running task keeps its state through world reloads.
All numbers below are defaults. Each task has a [tasks.<id>] section in the server config and can be tuned from a datapack too, see Configuration and Datapacks.
| Task | Id | Learned | Food / water cost | XP rate | Upgrade branches |
|---|---|---|---|---|---|
| Follow | ratworker:follow |
known by every worker | x1.0 | x1.0 | hunger, thirst |
| Hold position | ratworker:stay |
known by every worker | idle rate | x0.5 | hunger, thirst |
| Turn crank | ratworker:crank |
manual + 30 XP | x1.5 | x1.5 | hunger, thirst, speed |
| Farm | ratworker:farm |
manual + 40 XP | x1.0 / x1.2 | x1.5 | hunger, thirst, speed |
Walks behind you. It starts moving when you are more than 5 blocks away (range) and stops at 2.5 (stopDistance). If you get more than 24 blocks ahead (teleportDistance), or the path fails, it teleports next to you. It does not follow you into another dimension.
Stands on the block where you started it. If it gets pushed more than 1.5 blocks away (range) it walks back; if it cannot get back it stops with a reason. Uses food and water at the idle rate.
Needs Create. The worker walks to the nearest Create hand crank within 16 blocks (range) and turns it by holding right-click on it, like a player does.
- A crank spins for 10 ticks after each click. By default the worker clicks every 16 ticks (
holdInterval), so the crank turns in bursts. The speed branch lowers the interval by 2 ticks per level down to 4 (minHoldInterval), where it turns without pauses. -
reverse = 1makes it hold sneak too, which turns the crank the other way. - Turning a crank is hard work. Besides the x1.5 cost, the effort Create charges for each turn is passed on to the worker (see Needs & Supply).
- It stops with a reason when the crank is removed, cannot be reached, or the interaction is refused (for example in a claimed chunk where the owner has no rights).
- Other hold-to-use blocks with a block entity can be added to the block tag
ratworker:crank_targets.
Works a square field of radius 6 (range) around the block where you started it, from 2 blocks below to 2 above.
- Harvests ripe crops (any crop block at full age), picks up the drops and replants the same seed.
- Plants empty farmland with seeds from its inventory.
- With a hoe in its inventory and
till = 1, tills dirt and grass next to existing farmland or water, so the field grows from what you prepared instead of tilling the whole square. - Acts every 20 ticks (
actionCooldown), slower when hungry or thirsty, faster with the speed branch. - When 16 produce items pile up (
depositAt), or it runs out of seeds and the supply has some, it walks to its supply container, stores the harvest and spare seeds (it keeps one stack of seeds) and takes new seeds. - It checks the field a few blocks per tick, never all at once. When there is nothing to do it looks again every 5 seconds.
A task stops on its own, with a reason shown in chat and in the command screen, when:
- food or water reaches zero ("Too hungry to work");
- the path fails several times in a row or the worker gets stuck;
- the target is gone (crank removed) or the action is refused;
- the server limit of active workers is reached (only when starting).
A task pauses (and resumes by itself) while the owner is offline, unless the server allows offline work.
Rat Worker is released under the MIT license. Author: Stefano Manca.
Guides & Reference
Scripting & Mod API
Version Overviews