Описание
# Cobblemon TP-Pastures
Prevents pastured Pokémon from being recalled to the PC when they wander too far away. Instead, they are teleported back near their [Pasture Block](https://wiki.cobblemon.com/index.php/Pasture_Block).
The mod includes a configurable teleport radius, safe landing detection, fall damage protection, optional complete damage immunity for pastured Pokémon, and debug notifications. It is available for both Fabric and NeoForge on Minecraft 1.21.1.
## Server-side
This mod works in both singleplayer and multiplayer.
For multiplayer servers, this is a **server-side mod**, so it only needs to be installed on the server. Download the Fabric or NeoForge version that matches your server’s mod loader.
## Why should you use it?
- Prevents your Pasture Block from suddenly becoming almost empty because Pokémon wandered too far away.
- Removes the need to trap your Pokémon with fences just to stop them from being recalled.
- Protects Pokémon from fall damage caused by teleporting them back to their Pasture Block.
- Can optionally make all Pokémon assigned to a Pasture Block completely immune to damage.
- Improves compatibility with [Cobbleworkers](https://modrinth.com/mod/cobbleworkers), allowing it to work more reliably.
- Lets you use pastured Pokémon more freely for decoration, zoos, safaris, farms, and similar builds.
~~You may also want to use [Cobblemon: SafePastures](https://modrinth.com/mod/cobblemon-safepastures), which protects your Pokémon from damage.~~
SafePastures is no longer necessary for damage protection because TP-Pastures now includes an `invulnerablePasturedPokemon` option. Enable this option if you want Pokémon assigned to a Pasture Block to be completely immune to damage.
*Cobblemon 1.8.0 attempted to address pastured Pokémon despawning or running away, but Pokémon can still be recalled to the PC after leaving their allowed area. TP-Pastures is therefore still useful/necessary to prevent this.*
## Dependencies
All versions require:
- [Cobblemon](https://modrinth.com/mod/cobblemon) 1.7.1+ (1.8.0 tested)
Fabric version:
- [Fabric Loader](https://fabricmc.net/) 0.18.4+
- [Fabric API](https://modrinth.com/mod/fabric-api) 0.116.8+
NeoForge version:
- [NeoForge](https://neoforged.net/) 21.1+
## Configuration
The config file is located here:
`...\config\cobblemon_tp_pastures.json`
For this mod to work correctly, `maxPastureRadius` must be set **lower** than Cobblemon’s own `pastureMaxWanderDistance` value.
Cobblemon’s value can usually be found here:
`...\config\cobblemon\main.json`
Cobblemon 1.8.0 changed the default `pastureMaxWanderDistance` from `64` to `32`. Because of this, TP-Pastures now uses `maxPastureRadius: 28` by default.
### Updating from an older version
Existing config files are preserved when updating the mod. If your config still contains `maxPastureRadius: 54`, you should manually change it to `28` when using Cobblemon’s new default radius of `32`.
### Using a larger pasture radius
If you want your Pokémon to roam farther than 32 blocks, you must increase both values:
- `pastureMaxWanderDistance` in Cobblemon’s config
- `maxPastureRadius` in TP-Pastures’ config
Always keep TP-Pastures’ `maxPastureRadius` lower than Cobblemon’s `pastureMaxWanderDistance`.
For example, to use the previous Cobblemon distance again, you could configure:
- Cobblemon: `pastureMaxWanderDistance: 64`
- TP-Pastures: `maxPastureRadius: 54`
### Important note for modpacks
Some modpacks change Cobblemon’s `pastureMaxWanderDistance`.
If your modpack changes this value, make sure TP-Pastures’ `maxPastureRadius` is still lower than it. Otherwise, Cobblemon may recall the Pokémon before TP-Pastures can teleport it back.
## Default config
```json
{
"_maxPastureRadius_info": "Max roam distance in blocks from the pasture block center before a Pokémon is teleported back. Measured horizontally by default (see useHorizontalDistanceOnly). Default: 28 (For best results make sure it is slightly lower than \"pastureMaxWanderDistance\" from Cobblemon's config).",
"maxPastureRadius": 28,
"_useHorizontalDistanceOnly_info": "If true, only horizontal (X/Z) distance is checked, ignoring height. Good for pastures near cliffs or multi-level farms. If false, full 3D sphere distance is used. Default: false.",
"useHorizontalDistanceOnly": false,
"_candidateTeleportAttempts_info": "How many random positions around the pasture block are tried when searching for a safe landing spot (solid ground + clear headroom). Higher values reduce the chance of landing inside a block, at a tiny performance cost. Default: 24.",
"candidateTeleportAttempts": 24,
"_fallbackYOffset_info": "If no safe position is found after candidateTeleportAttempts tries, the Pokémon is placed this many blocks directly above the pasture block as a last resort. Default: 1.5.",
"fallbackYOffset": 1.5,
"_debugLogging_info": "If true, nearby players see a chat message whenever a Pokémon is teleported back (e.g. 'Pikachu left tether box → (x, y, z)'). Default: false.",
"debugLogging": false,
"_serverLogging_info": "If true, teleport events are written to the server log. Disable this if the log spam is unwanted. Default: false.",
"serverLogging": false,
"_preventTeleportFallDamage_info": "If true, a Pokémon teleported back by TP-Pastures takes no fall damage from that teleport. Protection lasts until it lands. Default: true.",
"preventTeleportFallDamage": true,
"_invulnerablePasturedPokemon_info": "If true, Pokémon currently assigned to a Pasture Block cannot take any damage. Default: false.",
"invulnerablePasturedPokemon": false
}
```
## Support / Bug Reports
I currently do not use a dedicated platform for support or bug reports.
If you need help or want to report an issue, you can contact me on Discord:
`@datibrr`