宝箱补充

宝箱补充

一个服务端模组,用于重新填充战利品容器。

工具

ChestRefill

一个用于重新填充战利品容器的服务端模组。

使用方法

  1. 将模组放入你的 mods/ 文件夹。
  2. 重启游戏 / 服务器。
    1. 如有需要,调整配置,然后使用 /chestrefill reload
  3. 生成 / 创建新的战利品箱子。
  4. 搜刮它们,等待指定时间(默认:4 小时),然后用另一个账号再次搜刮!

特性

  • 可配置(时间、最大填充次数、重置战利品种子……)
  • 支持权限(chestrefill.allowReloot)
  • 适用于任何继承 RandomizableContainerBlockEntity 的容器

权限

  • chestrefill.allowReloot - 允许重新搜刮箱子
  • chestrefill.config
    • chestrefill.config.edit - 允许在游戏内编辑配置
    • chestrefill.config.reload - 允许重新加载配置

配置

你可以使用游戏内的 /chestrefill 命令在游戏中编辑配置。 可用选项:

# Whether to randomize loot table seed."
# This ensures that regenerated loot is different each time.
# (default = true)
randomize_loot_seed = true

# Whether to allow players to reloot containers
# even if they don't have `chestrefill.allowReloot` permission.
# (default = false)
allow_reloot_without_permission = false

# Max refills per container, inclusive. -1 for unlimited.
# (default = 5)
max_refills = 5

# Whether to add loot even if container has some items already.
# (default = false)
refill_non_empty = false

# Minimum wait time to refill the loot, in seconds.
# (default = 14400 (=4 hours))
min_wait_time = 14400

按战利品表自定义

你还可以为指定的战利品表设置自定义值。 你想让末地城战利品表比默认填充更多次吗? 设置以下选项。

{
  "...": "",
  "// Map to override above config for certain loot tables only.": "",
  "lootModifierMap": {
    "minecraft:chests/end_city_treasure": {
      "randomize_loot_seed": true,
      "allow_reloot_without_permission": true,
      "max_refills": 100,
      "refill_non_empty": false,
      "min_wait_time": 60
    },
    "sample_mod:chests/custom_loot_table": {
      "randomize_loot_seed": true,
      "allow_reloot_without_permission": false,
      "max_refills": 5,
      "refill_non_empty": false,
      "min_wait_time": 14400
    }
  }
}

这将使 minecraft:chests/end_city_treasure 可以

  • 被同一批玩家重新搜刮
  • 可填充 100 次
  • 每 60 秒填充一次

按容器自定义

你可以使用 NBT 标签自定义箱子。这些将同时覆盖 配置默认值和战利品表覆盖值。


    ChestRefill: {
            RefillCounter: 0,
            SavedLootTable: "minecraft:chests/igloo_chest",
            CustomValues: {
                AllowReloot: 1b
                MaxRefills: -1
                MinWaitTime: 60
            }
    }

(RandomizeLootSeed 和 RefillNonEmpty 自定义值也可用。)

命令大致如下:

/setblock ~ ~ ~ minecraft:chest{ChestRefill: {RefillCounter: 0, SavedLootTable: "minecraft:chests/igloo_chest", CustomValues: {AllowReloot: 1b, MaxRefills: -1, MinWaitTime: 60}}}

这将创建一个可搜刮的容器,它可以

  • 被同一批玩家重新搜刮
  • 无限次填充
  • 每 60 秒填充一次