11
votes
Accepted
What loot tables have mending?
So as I could not find an answer online, I just manually searched every loot table in the game to get an answer which I have now added to the wiki.
But anyways here we go:
Treasure enchantments (...
8
votes
Accepted
What was the (unofficial) Minecraft Snapshot 20w14✨?
It's from the old Verified Helpers team on the Minecraft Commands discord (link found on /r/MinecraftCommands)
The Verified Helpers of this server joined together to create a data pack and resource ...
4
votes
Accepted
How can I modify an item while it is inside the player's inventory?
Solution for versions 1.17 and newer
As of 1.17, there are two ways to modify items while they are inside of the player's inventory.
Item modifiers
1.17 introduced item modifiers, data pack files that ...
4
votes
Accepted
Why is my loot table not showing up in the /loot command?
Your loot table contains an error on line 10 and on line 15.
...
8. "bonus_rolls": {
9. "min": 0,
10. "max": 2.5
11. },
...
4
votes
Accepted
How to add existing tags to items? (1.19.2, modded)
To add existing tags like forge:swords to items in your modpack, you can use datapacks or mods like KubeJS. Since you already know how to use datapacks, here's a simple way to do it:
Using Datapacks: ...
3
votes
Make part of a writable book read only
If you want the text to be locked in when they submit, a alternative would to tell the player to sign the book when they're done, and test for a written_book in the inventory.
/say Enter your text, ...
3
votes
How can I modify an item while it is inside the player's inventory?
Solution for versions 1.14–1.16
An interesting workaround to change NBT of a custom item is to copy it to a chest, modify it in the chest (where it can be modified) and then use /loot in replace mode ...
3
votes
Keeping inventory conditionally
The gamerule keepInventory can only be applied to the whole Minecraft world. But luckily there's also the /clear command. You can set /gamerule keepInventory true and then handle the inventory ...
3
votes
Accepted
How do I exclude only myself in an execute command?
To exclude players of your choice, you should be able to do something to the effect of /execute at @a[name=!Aceplante] run say hi and of course replace my name for yours. You can actually exclude as ...
3
votes
How do I exclude only myself in an execute command?
To exclude players of your choice, you can tag the players you want to exclude and
execute the player don't have the tag
tag @s add this
execute as @a[tag=!this] run say test
tag @s remove this
...
2
votes
Keeping inventory conditionally
I currently am working on a server-side Fabric mod which would entirely focus on such a matter. And even though it still only is in beta, you can still set a config to make it work properly, since ...
2
votes
Accepted
Sub-tick loops in functions without recursions
There's no proper call-stack with function recursion. For example if you call a function that creates and sets a score, that score will still be set when the function is exited.
When a function is ...
2
votes
2
votes
How can I create different portals to different sky block islands for multiplayer?
Best Solution
From they way you posed the question it sounded like you intended to use minecraft's built-in portals, particularly the nether portal, impossible to do without a mod or script. (which ...
2
votes
Accepted
How do I make a loot table in Minecraft give one of several items?
You would use multiple entries in a pool. For example, if you wanted it to give stone or dirt, you would use this:
{
"type": "see below",
"pools": [{
"rolls&...
2
votes
Datapacks question: Craft Enchanted Items
How I have handled similar ideas:
Set the recipe's "result" to a particular item that a player is not likely to ever have in their inventory (I usually use bat_spawn_egg).
Create an advancement that ...
2
votes
How do I put an experience orb into a scoreboard?
For anyone else who is looking for an answer to this question, this is what I came up with and it works quite well.
First, it is recommended that you tag your xp orbs mostly to make the commands look ...
2
votes
"vanilla:entities" not working in Minecraft loot table
I assume vanilla:entities/cow is supposed to mention the vanilla loot table for the cow. vanilla is not the namepsace you are looking for. In fact, the vanilla namespace is minecraft. So, you will ...
2
votes
How do I make it that /trigger will only execute a command once?
Create two scoreboards. One for the trigger and one normal one. In every tick you check if the value of both scoreboards are the same and run your function only if they are not:
# tick.mcfunction
...
2
votes
Accepted
Simulate TNT and fireballs
you can summon an armor stand at the position you want
use the command
/execute at @e[type=armor_stand] fill (x, y, z) (x, y, z) air replace (block you want to remove)
repeat this command to destroy ...
2
votes
Minecraft Data pack bug, mobs are just floating items
There should be a texture pack that goes along with the datapack. You will have to download this separately. I am not sure where you downloaded this datapack from, so you will have to find the texture ...
2
votes
Accepted
Why are my commands applying to everyone instead of just the person with the tag?
You are overcomplicating your commands so much that this is causing them to fail.
Your overcomplicated version:
Simpler and works:
execute as @e at @e if entity @s[tag=glasswalker]run …
execute ...
2
votes
Accepted
How can i find anvil GUI nbt?
This may upset you --- I don't think GUI interactions are open for manipulation by command.
See that "isFurnaceGuiOpen" nbt tag? It looks like you can at least detect if a player is ...
2
votes
Accepted
Loot table based on NBT data
Edit, I was just being stupid. As you can see, the final "killed by player check" is outside the final pool's "function" brackets.
The final and working loot table is successfully ...
2
votes
Accepted
"match_tool" enchant check for entity loot table?
Nevermind I figured it out.
As you can see, I just used the same check that creepers use when dropping discs (killer), and then I can specify killer nbt:
{
"type": "minecraft:entity&...
2
votes
Teleporting to the Nether with entities
Distance doesn't work across dimensions.
Also the execute command takes multiple arguments, so you don't need to do ... run execute ....
I assume the entity with tag 'spawn' is an armor stand on the ...
2
votes
Why is my datapack so laggy?
There are many many reasons why a datapack may be laggy, and it is hard to diagnose the issue(s) without knowing what it does. But, here are some common reasons that I can list off the top of my head:
...
2
votes
Accepted
Not broken by player loot table?
For some reason, removing the "survives explosion" check on the second part allows it to drop, and it now works as intended
2
votes
Accepted
How do I limit my raycast range?
How to do it
Set a number equal to how many times the raycast can advance.
Decrease the number each time you advance the raycast 1 block forwards.
When you reach zero, stop advancing the raycast.
In ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
minecraft-java-edition × 160minecraft-data-packs × 160
minecraft-commands × 88
minecraft-resource-packs × 5
minecraft-java-edition-server × 4
minecraft-mods × 4
minecraft-optifine × 2
minecraft-bedrock-edition × 1
achievements × 1
mods × 1
performance × 1
minecraft-addons × 1
minecraft-java-edition-realms × 1