I wanted to make all torches (Crafted and found) have fire aspect using commands. I tried some different things but they didn't work out. Does anyone else have any ideas?
Minecraft – How do i make all torches have fire aspect
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – How to make skeletons shoot players from far away in Minecraft
- Minecraft Java Edition – How to Trigger a Block Update in Minecraft 1.9
- Minecraft – How to keep mobs from being too close together with /spreadplayers and /execute
- Minecraft – Having problems with the ‘distance=’ command in Minecraft 1.13.2
- Minecraft Java Edition – How to Create a Spawner That Summons Items
- Minecraft – How to make an execute command there is a player looking at another player
- Minecraft – How to make a command that makes all the wolves sit and stand
Best Answer
Default items have no data of which to detect in order to separate them from custom items. Unfortunately this greatly restricts methods of replacing default items since, for example,
/clear
would not be able to differentiate your custom torches with default ones.One work-around is to detect each individual slot in the player's inventory and use /replaceitem, but that requires 64 command blocks for each of the 36 slots just for detection alone.
As a quick run-down:
Find 1 torch in slot 0.
Replace that torch with 1 custom torch.
Which would need to be repeated for every number of torches possible in every slot possible.
If using 1.9, you can customize the loot tables so that the torches that are at least found in chests will have the desired enchantment.
For example, the
chests/abandoned_mineshaft.json
loot table has the following entry:If you want it to be enchanted with fire aspect, you'd add the
enchant_randomly
function while only specifyingminecraft:fire_aspect
: