Download Chest Refill — Minecraft Mods — MetaMods

Chest Refill

Active

Downloads

0

Last update

3 years ago

Versions

1.17.1 — 1.19
Server
Fabric
Forge
Utils

ChestRefill

Server-side mod that automatically restores loot container contents after they've been looted.

Quick Start

To get started, simply place the mod file in the mods/ folder and restart the game or server. If needed, you can configure parameters through the configuration file and execute the /chestrefill reload command to apply changes.

After installation, all new loot containers will automatically restore. Just loot a chest, wait for the specified time (default 4 hours), and you'll be able to get loot again, even using the same account!

Main Features

  • Flexible configuration of restoration time, maximum refills, and other parameters
  • Permission system support for controlling reloot access
  • Works with all containers inheriting from RandomizableContainerBlockEntity

Permission System

The mod provides the following access rights:

  • chestrefill.allowReloot - allows repeated chest looting
  • chestrefill.config - permission group for configuration management
    • chestrefill.config.edit - allows in-game settings editing
    • chestrefill.config.reload - allows configuration reloading

Configuration Settings

Use the /chestrefill command for in-game settings editing. Available options:

# Random seed for loot tables.
# Ensures that restored loot will be different each time.
# (default = true)
randomize_loot_seed = true

# Whether to allow players to reloot containers
# without having the chestrefill.allowReloot permission.
# (default = false)
allow_reloot_without_permission = false

# Maximum number of refills per container. -1 means unlimited.
# (default = 5)
max_refills = 5

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

# Minimum wait time before loot restoration, in seconds.
# (default = 14400 (=4 hours))
min_wait_time = 14400

Individual Loot Table Configuration

You can set special parameters for specific loot tables. For example, if you need end city loot to restore more frequently than usual:

{
  "...": "",
  "// Map to override default settings for specific loot tables.": "",
  "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
    }
  }
}

This configuration will allow:

  • The same players to repeatedly loot chests
  • Loot to be restored up to 100 times
  • Content to update every 60 seconds

Individual Container Configuration

For fine-tuning specific chests, use NBT tags. These parameters take priority over standard settings and individual loot table configurations.

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

(Parameters RandomizeLootSeed and RefillNonEmpty are also available.)

Example command for creating such a container:

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

This will create a container that can be:

  • Looted repeatedly by the same players
  • Restored an unlimited number of times
  • Updated every 60 seconds
Project members
samolego

samolego

Developer

samo_lego

samo_lego

Created: 15 Oct 2021

ID: 9860