Cobblemon TP-Pastures
防止牧场中的宝可梦在游荡过远时被收回电脑。取而代之的是,它们会被传送回 Pasture Block 附近。
该模组包含自动半径配置、安全着陆检测、摔落伤害保护、可配置的无敌状态、危险状态移除、可选的传送特效以及管理命令。
它适用于 Minecraft 1.21.1 的 Fabric 和 NeoForge。
服务端
本模组既支持单人游戏也支持多人游戏。
对于多人服务器,这是一个服务端模组,因此只需安装在服务器上即可。下载与服务器加载器匹配的版本(Fabric 或 NeoForge)。
为什么要使用它?
- 防止你的 Pasture Block 因为宝可梦游荡过远而突然变得几乎空空如也。
- 无需为了阻止宝可梦被收回而用栅栏将它们困住。
- 根据 Cobblemon 的配置自动调整传送半径。
- 保护宝可梦免受因被传回而产生的摔落伤害。
- 通过可配置的黑白名单保护牧场中的宝可梦免受伤害。
- 传送后移除火焰、溺水和冰冻状态。
- 提高与 Cobbleworkers 的兼容性,使其工作更加可靠。
- 让你更自由地使用牧场中的宝可梦进行装饰、动物园、狩猎旅行、农场等建筑。
你可能还想使用 Cobblemon: SafePastures,它可以保护你的宝可梦免受伤害。
SafePastures 不再需要用于伤害保护,因为 TP-Pastures 现在已为分配给 Pasture Block 的宝可梦提供了可配置的伤害免疫功能。
Cobblemon 1.8.0 曾试图解决牧场宝可梦消失或逃跑的问题,但宝可梦离开允许区域后仍可能被收回电脑。因此 TP-Pastures 对于防止这种行为仍然有用。
依赖项
所有版本都需要:
Fabric 版本:
NeoForge 版本:
配置
配置文件位于此处:
...\config\cobblemon_tp_pastures.json
自动半径配置
默认情况下,TP-Pastures 会自动读取 Cobblemon 的 pastureMaxWanderDistance 设置,并减去配置的 radiusMargin。
默认的 radiusMargin 为 4。
示例:
- Cobblemon 半径
32 → TP-Pastures 半径 28
- Cobblemon 半径
64 → TP-Pastures 半径 60
这意味着你通常只需要更改 Cobblemon 的 pastureMaxWanderDistance。TP-Pastures 会自动调整其有效传送半径。
Cobblemon 的值通常可以在这里找到:
...\config\cobblemon\main.json
Cobblemon 1.8.0 将默认的 pastureMaxWanderDistance 从 64 更改为 32。启用自动半径配置后,TP-Pastures 会将其有效半径自动从 60 更改为 28。
如果无法读取 Cobblemon 的配置,则使用 maxPastureRadius 作为后备值。
手动半径配置
若要使用固定半径,请设置:
"automaticRadius": false
TP-Pastures 随后将使用 maxPastureRadius 下配置的值。
在使用手动模式时,请始终确保 TP-Pastures 的 maxPastureRadius 低于 Cobblemon 的 pastureMaxWanderDistance。否则,Cobblemon 可能会在 TP-Pastures 将其传回之前就把宝可梦收回。
使用更大的牧场半径
启用自动半径配置时,你只需要增加 Cobblemon 的 pastureMaxWanderDistance。
例如:
"pastureMaxWanderDistance": 64
使用默认的 radiusMargin 4,TP-Pastures 将自动使用 60 的有效半径。
如果你想让 TP-Pastures 更早或更晚地传送宝可梦,可以更改 radiusMargin。
从旧版本更新
更新时会保留现有的配置文件。
加载配置时会自动添加新设置。旧的 maxPastureRadius 值可能仍保留在文件中,但在启用 automaticRadius 时仅作为后备值使用。
使用自动半径配置时,你不再需要手动将旧半径(如 54)更改为 28。
伤害保护
默认情况下,当前分配给 Pasture Block 的宝可梦会受到所有伤害的保护。
可以使用以下选项自定义伤害保护:
invulnerablePasturedPokemon
damageFilterMode
damageTypes
黑名单模式
BLACKLIST 会阻止 damageTypes 下列出的伤害类型。
默认的通配符配置会阻止所有伤害:
"damageFilterMode": "BLACKLIST",
"damageTypes": [
"*"
]
如果只想阻止特定的伤害类型,可以将 * 替换为单个 Minecraft 伤害类型 ID:
"damageTypes": [
"minecraft:in_fire",
"minecraft:on_fire",
"minecraft:fall"
]
白名单模式
WHITELIST 允许 damageTypes 下列出的伤害类型,并阻止其他所有伤害。
例如,这允许摔落伤害,同时阻止其他伤害:
"damageFilterMode": "WHITELIST",
"damageTypes": [
"minecraft:fall"
]
将 invulnerablePasturedPokemon 设置为 false 以完全禁用常规伤害保护。
与传送相关的摔落伤害仍可使用 preventTeleportFallDamage 单独防止。
命令
/tppastures — 显示当前配置状态。
/tppastures status — 显示有效半径和启用的保护设置。
/tppastures reload — 无需重启服务器即可重新加载配置。需要权限等级 2(服务器管理员)。
默认配置
{
"_automaticRadius_info": "若为 true,传送半径将自动设置为 Cobblemon 的 pastureMaxWanderDistance 减去 radiusMargin。如果无法获取 Cobblemon 的配置,则使用 maxPastureRadius 作为回退值。默认值:true。",
"automaticRadius": true,
"_radiusMargin_info": "在自动模式下,从 Cobblemon 的 pastureMaxWanderDistance 中减去的方块数量。默认值:4。",
"radiusMargin": 4,
"_maxPastureRadius_info": "手动设置的传送半径以及自动模式下的回退值。必须低于 Cobblemon 的 pastureMaxWanderDistance。默认值:28。",
"maxPastureRadius": 28,
"_useHorizontalDistanceOnly_info": "若为 true,仅检查水平(X/Z)距离,忽略高度。适用于悬崖附近或多层农场的牧场区域。若为 false,则使用完整的 3D 球体距离计算。默认值:false。",
"useHorizontalDistanceOnly": false,
"_candidateTeleportAttempts_info": "在搜索安全落脚点(坚实地面 + 头部空间充足)时,围绕牧场方块尝试随机位置的次数。较高的数值可降低落入方块内的几率,但会带来微小的性能损耗。默认值:24。",
"candidateTeleportAttempts": 24,
"_fallbackYOffset_info": "如果在 candidateTeleportAttempts 次尝试后仍未找到安全位置,宝可梦将被放置在牧场方块上方若干个方块的绝对垂直位置,作为最后手段。默认值:1.5。",
"fallbackYOffset": 1.5,
"_debugLogging_info": "若为 true,每当一只宝可梦被传回时,附近的玩家会收到一条聊天消息(例如:“皮卡丘离开束缚盒 → (x, y, z)”)。默认值:false。",
"debugLogging": false,
"_serverLogging_info": "若为 true,传送事件将被写入服务器日志。如果不想看到日志刷屏,请禁用此项。默认值:false。",
"serverLogging": false,
"_preventTeleportFallDamage_info": "若为 true,由 TP-Pastures 传回的宝可梦在该次传送过程中不会受到坠落伤害。保护效果持续至其落地为止。默认值:true。",
"preventTeleportFallDamage": true,
"_invulnerablePasturedPokemon_info": "若为 true,当前分配给牧场方块的宝可梦所受伤害将根据 damageFilterMode 和 damageTypes 进行过滤。默认值:true。",
"invulnerablePasturedPokemon": true,
"_damageFilterMode_info": "BLACKLIST 将阻止 damageTypes 中列出的伤害类型。WHITELIST 仅允许 damageTypes 中列出的伤害类型。请使用 Minecraft 的伤害类型 ID,如 minecraft:in_fire。默认值:BLACKLIST。",
"damageFilterMode": "BLACKLIST",
"_damageTypes_info": "damageFilterMode 所使用的伤害类型 ID。通配符 * 匹配所有伤害类型。默认值:[\"*\"](防止所有伤害)。",
"damageTypes": [
"*"
],
"_clearHazardousStatesAfterTeleport_info": "若为 true,TP-Pastures 传送宝可梦后,将清除其身上的燃烧、溺水和冻结状态。默认值:true。",
"clearHazardousStatesAfterTeleport": true,
"_teleportParticles_info": "若为 true,当宝可梦被传送时,会在旧位置和新位置显示传送门粒子效果。默认值:false。",
"teleportParticles": false,
"_teleportSounds_info": "若为 true,当宝可梦被传送时,会在旧位置和新位置播放末影人的传送音效。默认值:false。"
}
支持 / 错误报告
我目前未设立专门的支持或错误报告平台。
如果您需要帮助或想要报告问题,可以通过 Discord 联系我:
@datibrr
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.
The mod includes automatic radius configuration, safe landing detection, fall damage protection, configurable damage immunity, hazardous-state removal, optional teleport effects, and administrative commands.
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.
- Automatically adjusts the teleport radius based on Cobblemon’s configuration.
- Protects Pokémon from fall damage caused by teleporting them back.
- Protects pastured Pokémon from damage using a configurable whitelist or blacklist.
- Removes fire, drowning, and freezing states after teleporting.
- Improves compatibility with 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, which protects your Pokémon from damage.
SafePastures is no longer necessary for damage protection because TP-Pastures now includes configurable damage immunity for Pokémon assigned to a Pasture Block.
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 to prevent this behavior.
Dependencies
All versions require:
Fabric version:
NeoForge version:
Configuration
The config file is located here:
...\config\cobblemon_tp_pastures.json
Automatic radius configuration
By default, TP-Pastures automatically reads Cobblemon’s pastureMaxWanderDistance setting and subtracts the configured radiusMargin.
The default radiusMargin is 4.
Examples:
- Cobblemon radius
32 → TP-Pastures radius 28
- Cobblemon radius
64 → TP-Pastures radius 60
This means you normally only need to change Cobblemon’s pastureMaxWanderDistance. TP-Pastures automatically adjusts its effective teleport radius.
Cobblemon’s value can usually be found here:
...\config\cobblemon\main.json
Cobblemon 1.8.0 changed the default pastureMaxWanderDistance from 64 to 32. With automatic radius configuration enabled, TP-Pastures automatically changes its effective radius from 60 to 28.
If Cobblemon’s configuration cannot be read, maxPastureRadius is used as a fallback.
Manual radius configuration
To use a fixed radius instead, set:
"automaticRadius": false
TP-Pastures will then use the value configured under maxPastureRadius.
When using manual mode, always keep TP-Pastures’ maxPastureRadius lower than Cobblemon’s pastureMaxWanderDistance. Otherwise, Cobblemon may recall the Pokémon before TP-Pastures can teleport it back.
Using a larger pasture radius
When automatic radius configuration is enabled, you only need to increase Cobblemon’s pastureMaxWanderDistance.
For example:
"pastureMaxWanderDistance": 64
With the default radiusMargin of 4, TP-Pastures will automatically use an effective radius of 60.
You can change radiusMargin if you want TP-Pastures to teleport Pokémon sooner or later.
Updating from an older version
Existing config files are preserved when updating.
New settings are automatically added when the config is loaded. An old maxPastureRadius value may remain in the file, but it is only used as a fallback while automaticRadius is enabled.
You no longer need to manually change an old radius such as 54 to 28 when using automatic radius configuration.
Damage protection
By default, Pokémon currently assigned to a Pasture Block are protected from all damage.
Damage protection can be customized using:
invulnerablePasturedPokemon
damageFilterMode
damageTypes
Blacklist mode
BLACKLIST prevents the damage types listed under damageTypes.
The default wildcard configuration prevents all damage:
"damageFilterMode": "BLACKLIST",
"damageTypes": [
"*"
]
You can replace * with individual Minecraft damage type IDs if only specific damage types should be prevented:
"damageTypes": [
"minecraft:in_fire",
"minecraft:on_fire",
"minecraft:fall"
]
Whitelist mode
WHITELIST allows the damage types listed under damageTypes and prevents all other damage.
For example, this allows fall damage while preventing other damage:
"damageFilterMode": "WHITELIST",
"damageTypes": [
"minecraft:fall"
]
Set invulnerablePasturedPokemon to false to disable general damage protection completely.
Teleport-related fall damage can still be prevented separately using preventTeleportFallDamage.
Commands
/tppastures — Displays the current configuration status.
/tppastures status — Displays the effective radius and enabled protection settings.
/tppastures reload — Reloads the configuration without restarting the server. Requires permission level 2 (server operator).
Default config
{
"_automaticRadius_info": "If true, the teleport radius is automatically set to Cobblemon's pastureMaxWanderDistance minus radiusMargin. maxPastureRadius is used as a fallback if Cobblemon's config is unavailable. Default: true.",
"automaticRadius": true,
"_radiusMargin_info": "How many blocks are subtracted from Cobblemon's pastureMaxWanderDistance in automatic mode. Default: 4.",
"radiusMargin": 4,
"_maxPastureRadius_info": "Manual teleport radius and fallback for automatic mode. Must be lower than Cobblemon's pastureMaxWanderDistance. Default: 28.",
"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, damage to Pokémon currently assigned to a Pasture Block is filtered using damageFilterMode and damageTypes. Default: true.",
"invulnerablePasturedPokemon": true,
"_damageFilterMode_info": "BLACKLIST prevents the damage types listed in damageTypes. WHITELIST allows only the damage types listed in damageTypes. Use Minecraft damage type IDs such as minecraft:in_fire. Default: BLACKLIST.",
"damageFilterMode": "BLACKLIST",
"_damageTypes_info": "Damage type IDs used by damageFilterMode. The wildcard * matches every damage type. Default: [\"*\"] (all damage is prevented).",
"damageTypes": [
"*"
],
"_clearHazardousStatesAfterTeleport_info": "If true, fire, drowning and freezing states are cleared after TP-Pastures teleports a Pokémon. Default: true.",
"clearHazardousStatesAfterTeleport": true,
"_teleportParticles_info": "If true, portal particles are shown at the old and new position when a Pokémon is teleported. Default: false.",
"teleportParticles": false,
"_teleportSounds_info": "If true, an Enderman teleport sound is played at the old and new position when a Pokémon is teleported. Default: false.",
"teleportSounds": 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
评论 0
登录后参与评分
还没有评论,来抢沙发吧