
盯着水壶看,水永远不开。盯着熔炉看,它……也永远不会“滴答”作响?
A Watched Pot 是一款适用于 Neoforge/Forge 和 Fabric/Quilt 的全可配置模组,它可以根据方块标签(block tag),实现让被注视的方块停止 ticking(更新)或仅在被注视时才进行 ticking。
在 Fabric/Quilt 上需要 Fabric API。
用法
在 Forge 上,A Watched Pot 可以通过 Forge 的标准服务器配置系统进行配置。目前有两个配置选项:
- 模组可以使用白名单或黑名单,通过
use_whitelist选项进行切换。如果启用该选项,只有位于watchedpot:whitelist方块标签中的方块会受到影响。如果禁用(默认状态),所有方块都会受到影响,除非它们位于watchedpot:blacklist标签中。 - 模组的行為可以通过
invert_behavior选项进行反转。如果启用,只有被注视的方块才会 ticking(在这些受影响的方块中);如果禁用,所有方块都会 ticking,除非它们正被注视。
默认情况下,这两个选项都设置为 false——也就是说,当玩家注视某个方块时,该方块不会 ticking。
总结一下:
use_whitelist=true, invert_behavior=false- 位于白名单标签中的方块如果被注视则不会 ticking;其他方块保持不变。use_whitelist=false, invert_behavior=false- 除非位于黑名单标签中(此时保持不变),否则所有被注视的方块都不会 ticking。use_whitelist=true, invert_behavior=true- 位于白名单标签中的方块只有在被注视时才会 ticking;其他方块保持不变。use_whitelist=false, invert_behavior=true- 除非位于黑名单标签中(此时同样保持不变),否则所有方块只有在被注视时才会 ticking。
在 Fabric 上,相同的选项可以通过游戏内规则(gamerules,即 watchedpot_useWhitelist 和 watchedpot_invertBehavior)来设置,以避免额外的配置依赖。这虽然不如前者稳健,但能保持模组在两个平台上的轻量级。如果你需要设置默认值(例如用于整合包),你可以使用 KubeJS server_script 来模拟这种行为,如下所示:
// For 1.18.2 change the line below to onEvent('server.load', event => {
ServerEvents.loaded(event => {
if (event.server.persistentData.gameRules) return
event.server.gameRules.set("watchedpot_useWhitelist", true)
event.server.gameRules.set("watchedpot_invertBehavior", false)
event.server.persistentData.gameRules = true
})
你也可以使用数据包来实现相同的效果,通过运行 /gamerule 命令的 .mcfunction 文件。有关详细信息,请参阅 Minecraft Wiki。

A watched pot never boils. A watched furnace never... ticks?
A Watched Pot is a fully configurable mod for both Neoforge/Forge and Fabric/Quilt that either stops blocks from ticking when they're looked at or restricts them to only tick when they are looked at, based on a block tag.
Requires Fabric API on Fabric/Quilt.
Usage
On Forge, A Watched Pot can be configured through Forge's normal server configuration systems. There are currently two configuration options:
- The mod can use either a whitelist or a blacklist, which can be toggled via the
use_whitelistoption. If the option is enabled, only blocks in thewatchedpot:whitelistblock tag will be affected. If it's disabled (which it is by default), all blocks will be affected except those in thewatchedpot:blacklisttag. - The mod's behavior can be inverted via the
invert_behavioroption. If enabled, only blocks that are looked at will tick (of those affected); if disabled, all blocks will tick unless they are looked at.
By default, both options are set to false - that is, no block will tick while a player is looking at it.
To recap:
use_whitelist=true, invert_behavior=false- blocks in the whitelist tag will not tick if they are looked at; all other blocks remain unchanged.use_whitelist=false, invert_behavior=false- all blocks will not tick if they are looked at, unless they are in the blacklist tag (in which case they remain unchanged).use_whitelist=true, invert_behavior=true- blocks in the whitelist tag will only tick if they are looked at; all other blocks remain unchanged.use_whitelist=false, invert_behavior=true- all blocks will only tick if they are looked at, unless they are in the blacklist tag (in which case, again, they remain unchanged). On Fabric, the same options can be set via gamerules (watchedpot_useWhitelistandwatchedpot_invertBehavior) to avoid an extra config dependency. This is unfortunately not quite as robust but it keeps the mod lightweight on both platforms. If you need to set default values (such as for a modpack) you can emulate that behavior with a KubeJS server_script, like so:
// For 1.18.2 change the line below to onEvent('server.load', event => {
ServerEvents.loaded(event => {
if (event.server.persistentData.gameRules) return
event.server.gameRules.set("watchedpot_useWhitelist", true)
event.server.gameRules.set("watchedpot_invertBehavior", false)
event.server.persistentData.gameRules = true
})
You can also use datapacks to achieve the same effect with a .mcfunction running the /gamerule command. See the Minecraft Wiki for information on that.
下载 A Watched Pot
下载 A Watched Pot
下载 A Watched Pot
下载 A Watched Pot
下载 A Watched Pot
下载 A Watched Pot
下载 A Watched Pot
下载 A Watched Pot
下载 A Watched Pot
下载 A Watched Pot
更新到 1.21.4
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
评论 0
登录后参与评分
还没有评论,来抢沙发吧