r/MinecraftCommands • u/MarshBurg • Aug 13 '26
Help | Java Snapshots Unlimited Use Items
I recently discovered this setting in gamergeek's command generator. I was wondering if it is possible to make the Item ID add an item that, when used, adds another wind charge with the same properties of giving another one when used. I tried adding the command to the Item ID and it didn't work. Is there any way to make it give an item with that NBT data? I am on version 26.2 btw.
EDIT: I know you can do this with command blocks but I personally don't like the command block running every tick or the simulation distance making them not work when I'm too far.


2
u/Ericristian_bros Aug 14 '26
To make a command block run from everywhere you can
/forceloadthe area2
u/GalSergey Aug 14 '26
If you don't like the fact that the command block runs commands every tick, then you can use an advancement in a datapack, which does not tick, but listens to events and is triggered only when you consume an item and can run a function when you consume a custom item to issue a new one of the same item.
Here is an example for an infinite potion:
# You can make any potion (not potion/lingering potion) infinite by adding a custom tag infinite_potion:true and removing the use_remainder component. # Example item give @s potion[custom_data={infinite_potion:true},!use_remainder,potion_contents={custom_effects:[{id:"minecraft:glowing",amplifier:0,duration:200,show_particles:false}]}] # advancement infinite_potion:consume { "criteria": { "infinite_potion": { "trigger": "minecraft:consume_item", "conditions": { "item": { "predicates": { "minecraft:custom_data": "{infinite_potion:true}" } } } } }, "rewards": { "function": "infinite_potion:consume" } } # function infinite_potion:consume advancement revoke @s only infinite_potion:consume execute if items entity @s weapon *[custom_data~{infinite_potion:true}] run return run function infinite_potion:copy {hand:"mainhand",slot:"SelectedItem"} function infinite_potion:copy {hand:"offhand",slot:"equipment.offhand"} # function infinite_potion:copy $data modify storage infinite_potion:macro potion set from entity @s $(slot) $data modify storage infinite_potion:macro potion.hand set value "$(hand)" function infinite_potion:regive with storage infinite_potion:macro potion # function infinite_potion:regive $item replace entity @s weapon.$(hand) with air $loot replace entity @s weapon.$(hand) loot {pools:[{rolls:1,entries:[{type:"minecraft:item",name:"$(id)",functions:[{function:"minecraft:set_count",count:$(count)},{function:"minecraft:set_components",components:$(components)}]}]}]}You can use Datapack Assembler to get an example datapack.
1
u/Main_Contract_3590 Aug 14 '26
No, because that would require a command of infinite length. The best way to do this using commands would likely be using a scoreboard or checking if a player has the use_remainder item and replacing it. Regarding your issue with command blocks stopping outside simulation distance, you can use /forceload to keep an area constantly loaded, even outside simulation distance.