• 3,462 views • 16 today
    • 410 downloads • 0 today
    • 10
    • 8
    • 9
    Required Resource Pack
    JKuantamechanic
    Level 35 : Artisan Network Architect
    25
    Are you constantly searching around your inventory for extra planks and other materials after finishing the stack in your hands? This data pack automatically replenishes the item in your main hand slot with the same item from your inventory when you run out. If you have a linked chest, any items within that chest will also refill into your inventory the same way!
    Linked Chest:
    You can craft a Chest Link Item using an iron ingot and echo shard in a torch configuration whereby right-clicking any chest with it in hand will couple the chest to your inventory. The Chest link is a one-time use item and will be consumed on a successful link. The link will work at any distance, provided the chest is loaded. Every 10 seconds any chest linked with the player will emit green particles indicating that it is linked. You must destroy the chest for it to unlink.

    Works for stackable and non-stackable items, food, blocks, weapons and all!


    Settings:
    Type /trigger output_stats set 1
    to display the total number of items remaining when it refills.
    /trigger output_stats set 0
    to disable outputs.

    Version: 1.21


    Disclaimer: There is an unforeseen bug in an earlier version of the data pack. If you have this version, don't shift-click items from the hotbar to the player's inventory; the item could disappear. Download the updated version instead.
    Glitch warning
    : If you spam throw the current item, once it is refilled, it may appear that you are holding air, but the item will reappear when you click on it. If you hold "q," the rate at which you throw items may be too fast for the tick function to register it, thus it won't refill.

    CompatibilityMinecraft 1.21
    Tags

    2 Update Logs

    Update #2 : by JKuantamechanic 01/01/2025 8:16:01 pmJanuary 2, 2025 @ 1:16 am UTC

    Fixed bug related to shift-click items from the selected slot in the hotbar into the player's inventory.
    Future developer reference: shift-clicking items in the inventory instigates two different changes in the inventory resulting in two distinct executions of the call-back function, of which the order of call-back function execution and inventory changes (deletion of original stack and appearance /change of new stack where the item has been shift-clicked to) depend on whether the player is in creative or survival mode. In survival mode, inventory changes finish before either of the two call-back functions executes; in creative mode, the first call of the call-back function happens when the item has duplicated (appearing where the item would end up during shift-click), the second call occurs when the original item is deleted.
    LOAD MORE LOGS

      Have something to say?

    DaRealSmiley
    03/01/2025 6:36 pm
    Level 1 : New Miner
    Does it not work for 1.21.4? Because I tried it and it had to effect, I also tried crafting the chest link to confirm and it didn't appear.
    1
    JKuantamechanic
    03/03/2025 5:57 am
    Level 35 : Artisan Network Architect
    Hmm. If the chest link doesn't appear then it's most likely that the datapack isn't loaded. Make sure the folder (auto_refill_datapack) within the downloaded zip file is in the datapacks folder of your Minecraft save. In your Minecraft world check that it's loaded with /datapack list ; you should see my datapack there, if not the files must not be placed correctly. If it does exist then enable it using /datapack enable (my datapack).
    1
    DaRealSmiley
    04/23/2025 9:01 pm
    Level 1 : New Miner
    Ohhhh, it didn't work because you distributed the mod with 2 folders before getting to the files, so the game didn't recognize it as a mod, since there's only supposed to be one folder (The zip) then once you go inside is the mod files. But for your mod you go in the zip, then there's a folder, then the mod files which made it unplayable unless you remove that second folder.
    1
    unlikelyvee
    01/01/2025 5:43 am
    Level 1 : New Crafter
    shift clicking items from hotbar to inventory deletes the item. i lost my enchanted axe to this :( this is a nice data pack when its working tho
    1
    JKuantamechanic
    01/01/2025 8:17 pm
    Level 35 : Artisan Network Architect
    I believe it is fixed, thanks for letting me know of the problem.
    1
    JKuantamechanic
    01/01/2025 6:35 am
    Level 35 : Artisan Network Architect
    Sorry to hear. I'll get that fixed asap.
    1
    yyydragonking
    12/28/2024 9:59 am
    He/Him • Level 3 : Apprentice Skinner
    Very nice. I always try to find something like infinite item to use without throwing or using special items to trigger the give command thing. Thank you!!! 🙏
    1
    JKuantamechanic
    12/28/2024 5:30 pm
    Level 35 : Artisan Network Architect
    Thank you! I just used /item modify instead of /give to succinctly change item counts in a particular slot by copying it from elsewhere in the inventory.
    2
    JKuantamechanic
    12/28/2024 7:46 am
    Level 35 : Artisan Network Architect
    It ended up being a lot more complicated than I imagined. The code detects when a player switches items back and forth between main and off hands, and when you're dragging items in the inventory, then ignores changes to the main hand count accordingly. I will consider item refills during crafting, as well as the crazy prospect of item refills from tagged chest /shulker storage containers.
    1

    Welcome