You can do this with Notepad. Click "Save as" and then open the "Encoding" menu shown here:
I'll fix the thread up later on to include this information.
I saved it as UTF-8 and the loot table wouldn't load in minecraft i pressed f3 t nothing happened. So I closed minecraft and re opened it and it still didn't work. I looked at the loot table file and tried saving it as all files and as a text document neither worked. I tried all the options in the Encoding menu and none would work. Not even if i changed it back to ANSI. I have no idea whats happening but if i look at the rest of the loot table files they all appear as the blue notepad where as the one that i changed is now a white page with line. All the other loot tables have the file type of JSON but now this one is Text Document. Ughhh its so infuriating! any ideas on what to do!??
I saved it as UTF-8 and the loot table wouldn't load in minecraft i pressed f3 t nothing happened. So I closed minecraft and re opened it and it still didn't work. I looked at the loot table file and tried saving it as all files and as a text document neither worked. I tried all the options in the Encoding menu and none would work. Not even if i changed it back to ANSI. I have no idea whats happening but if i look at the rest of the loot table files they all appear as the blue notepad where as the one that i changed is now a white page with line. All the other loot tables have the file type of JSON but now this one is Text Document. Ughhh its so infuriating! any ideas on what to do!??
The logger output will tell you why a loot table is not working. You will need to provide the output here, otherwise I can't tell you what's wrong.
These are the exact steps to create the necessary file with notepad:
1. Paste JSON data into notepad. Example table to be used:
3. Set "Save as type" to "All files (*.*)". The file must be a JSON file, not a TXT file.
4. Set "Encoding" to "UTF-8".
5. Save within appropriate world folder, naming the file appropriately and including the ".json" extension (.minecraft/saves/WORLD/data/loot_tables/namespace/table.json).
6. Open game or reload tables with F3 + T (you must reload if you externally modify loot tables).
7. Run a command that uses the loot table. The item will correctly have a colored name.
I saved it as UTF-8 and the loot table wouldn't load in minecraft i pressed f3 t nothing happened. So I closed minecraft and re opened it and it still didn't work. I looked at the loot table file and tried saving it as all files and as a text document neither worked. I tried all the options in the Encoding menu and none would work. Not even if i changed it back to ANSI. I have no idea whats happening but if i look at the rest of the loot table files they all appear as the blue notepad where as the one that i changed is now a white page with line. All the other loot tables have the file type of JSON but now this one is Text Document. Ughhh its so infuriating! any ideas on what to do!??
You could try copying one of the other JSON files and editing to fit your needs. This should help ensure that your file actually has the right extension and encoding.
But in the long run, if you want to do any serious work with loot tables (or any data file for that matter) you should seriously consider getting a real text editor. The only reason Windows Notepad is called a "text editor" is because editing text is literally the only thing it can do. Off the top of my head, I would recommend any of: Notepad++ (free), Github's Atom Editor (free and open source by nature) or Sublime Text (which is "free for evaluation"). All of these are easy to download and install and come with very little overhead.
3. Set "Save as type" to "All files (*.*)". The file must be a JSON file, not a TXT file.
4. Set "Encoding" to "UTF-8".
5. Save within appropriate world folder, naming the file appropriately and including the ".json" extension (.minecraft/saves/WORLD/data/loot_tables/namespace/table.json).
6. Open game or reload tables with F3 + T (you must reload if you externally modify loot tables).
7. Run a command that uses the loot table. The item will correctly have a colored name.
YESSSS I got it to work!
After my first attempt of saving the file with UT8-F I left the file type as text document and thats why it saved wrong. Every time after, even if I chose All Files it would save as a Text Document and not JSON. Even if i wrote .JSON after the file name it still didn't work. So I restarted my computer and tried again, and it worked! Now I got me some emerald boots! Thanks you so much for your assistance!!
So in custom mob drops setting, mobs drop their regular drops like zombies drop rotten flesh
With this will they still drop their regular drops?
With custom loot tables, you can make mobs drop anything you want. If you wish, you can keep their regular drops and add new ones. Or you can remove their regular drops and make them drop something completely new. It's up to you!
My json file wasn't running because I was setting the data of stone to a "count" of 6 to make it polished andesite. Took me a little bit to figure out that it's suppose to be "data" instead. ^^
Edit: Also might as will ask, I'm using Notepad++ with the encoding setting "UTF-8 without BOM", will this effect anything that I should know about instead of using just "UTF-8" encoding?
My json file wasn't running because I was setting the data of stone to a "count" of 6 to make it polished andesite. Took me a little bit to figure out that it's suppose to be "data" instead. ^^
Edit: Also might as will ask, I'm using Notepad++ with the encoding setting "UTF-8 without BOM", will this effect anything that I should know about instead of using just "UTF-8" encoding?
Thanks, fixed!
"Without BOM" means a series of bytes won't be placed at the beginning to identify the file as being specifically UTF-8. In some cases having the BOM will produce a negative effect depending on what program is reading it; in this case, both will work for Minecraft.
Question with the new loottable : is there an easy way to set a chest to refill its content when emptied ? rpg server would benefit a lot from that.
I can see a way of auto refill by using a timer which decrease when the chest emptied (by using armorstand), but would be nice if it's doable only by nbt....
You will have to use external NBT detection. If the chest has a "LootTable" tag, it will overwrite its inventory the next time it is opened, and by opening it the "LootTable" tag is deleted. You have use use external commands to re-apply the tag.
When checking for a pre-existing list tag with nothing in it ("Items:[]"), the game will check if the target has that list as being empty. You can do that to detect when a check is empty and then re-apply the "LootTable" tag. You can use CommandStats to store that success value as a score on the armor stand.
Very quick example:
/summon ArmorStand X Y Z {Tags:["ChestRefill"],CommandStats:{SuccessCountName:"@e[type=ArmorStand,c=1]",SuccessCountObjective:"OBJ"}}
/execute @e[type=ArmorStand,tag=ChestRefill] ~ ~ ~ /testforblock ~ ~ ~ minecraft:chest -1 {Items:[]}
/execute @e[type=ArmorStand,tag=ChestRefill,score_OBJ_min=1] ~ ~ ~ /blockdata ~ ~ ~ {LootTable:"minecraft:chests/simply_dungeon"}
Am I right to conclude from my testing that entity / score conditions can not be used for fishing and chests since "this", "killer", "killer_player" are literally only used for mob entities that die?
I wish at minimum "this" would refer to the player initiating the loot table in the case of fishing and opening chests etc. At best, target selector syntax!
Ressource pack AND custom maps. So basically user created content.
Want a mob to drop a specific item, at a specific location, while still being vanilla spawned (not by command block), BAM, loot Table!
Want a chest to be filled randomly (because : A. you don't want fixed odd B. Laziness), BAM, loot TableTable. Custom enchanted weapon also available. Mojang will not be accountable if a ressource pack loot Table unbalance the game.
No good, with enchant by level it will apply random enchantment you could have gotten from an enchanting table in that level range. I am looking for just depth strider 1. and yes I did try stringing both together, it just gave me 1 random enchantment, and 1 random level of depth strider.
I did try "this" and the other two in hopes that fishing used them obscurely. None worked to allow entity score conditions with a player fishing. Of course there is a lot of room to have error in my JSON table, but no errors were reported. Instead, fishing using these conditions gave nothing since the pool didn't meet conditions.
Ressource pack AND custom maps. So basically user created content.
Want a mob to drop a specific item, at a specific location, while still being vanilla spawned (not by command block), BAM, loot Table!
Want a chest to be filled randomly (because : A. you don't want fixed odd B. Laziness), BAM, loot TableTable. Custom enchanted weapon also available. Mojang will not be accountable if a ressource pack loot Table unbalance the game.
Just to point out: loot tables are not resource packs. Resource packs are client-side while loot tables are server-side. They are essentially plugins instead.
I did try "this" and the other two in hopes that fishing used them obscurely. None worked to allow entity score conditions with a player fishing. Of course there is a lot of room to have error in my JSON table, but no errors were reported. Instead, fishing using these conditions gave nothing since the pool didn't meet conditions.
Russ
Unfortunately there are limitations for these types of implementations. I'll be rewriting functions/conditions in the coming week where I will specify which ones work where.
Ohhh, sorry. I just use normal notepad. Does this mean I will have to download a different program :/
You can do this with Notepad. Click "Save as" and then open the "Encoding" menu shown here:
I'll fix the thread up later on to include this information.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
I saved it as UTF-8 and the loot table wouldn't load in minecraft i pressed f3 t nothing happened. So I closed minecraft and re opened it and it still didn't work. I looked at the loot table file and tried saving it as all files and as a text document neither worked. I tried all the options in the Encoding menu and none would work. Not even if i changed it back to ANSI. I have no idea whats happening but if i look at the rest of the loot table files they all appear as the blue notepad where as the one that i changed is now a white page with line. All the other loot tables have the file type of JSON but now this one is Text Document. Ughhh its so infuriating! any ideas on what to do!??
The logger output will tell you why a loot table is not working. You will need to provide the output here, otherwise I can't tell you what's wrong.
These are the exact steps to create the necessary file with notepad:
1. Paste JSON data into notepad. Example table to be used:
2. Click File -> Save As....
3. Set "Save as type" to "All files (*.*)". The file must be a JSON file, not a TXT file.
4. Set "Encoding" to "UTF-8".
5. Save within appropriate world folder, naming the file appropriately and including the ".json" extension (.minecraft/saves/WORLD/data/loot_tables/namespace/table.json).
6. Open game or reload tables with F3 + T (you must reload if you externally modify loot tables).
7. Run a command that uses the loot table. The item will correctly have a colored name.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
You could try copying one of the other JSON files and editing to fit your needs. This should help ensure that your file actually has the right extension and encoding.
But in the long run, if you want to do any serious work with loot tables (or any data file for that matter) you should seriously consider getting a real text editor. The only reason Windows Notepad is called a "text editor" is because editing text is literally the only thing it can do. Off the top of my head, I would recommend any of: Notepad++ (free), Github's Atom Editor (free and open source by nature) or Sublime Text (which is "free for evaluation"). All of these are easy to download and install and come with very little overhead.
YESSSS I got it to work!
After my first attempt of saving the file with UT8-F I left the file type as text document and thats why it saved wrong. Every time after, even if I chose All Files it would save as a Text Document and not JSON. Even if i wrote .JSON after the file name it still didn't work. So I restarted my computer and tried again, and it worked! Now I got me some emerald boots! Thanks you so much for your assistance!!
So in custom mob drops setting, mobs drop their regular drops like zombies drop rotten flesh
With this will they still drop their regular drops?
░░░░██░░████████░░██░░░░░░░░░░░░░░░░░░░░░░░░ ░░██▒▒██▒▒▒▒▒▒▒▒██▒▒██░░░░░░░░░░░░░░░░░░░░░░
░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░░░░░░░░░░░░░░░░░
░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░░░░░░░░░░░░░░░
██▒▒▒▒██▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██░░░░░░░░░░░░░░░░░░
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████░░░░░░░░░░░░░░ ██▒▒▒▒▒▒████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████████████░░ ██▒▒██▒▒██▒▒▒▒██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██ ██▒▒▒▒████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██████░░ ██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░
░░██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░░░░░░░░ ░░██▒▒▒▒████▒▒▒▒████████▒▒▒▒████▒▒██░░░░░░░░ ░░██▒▒▒▒████▒▒██░░░░░░██▒▒██░░██▒▒██░░░░░░░░ ░░██▒▒██░░██▒▒██░░░░░░██▒▒██░░██▒▒██░░░░░░░░ ░░░░██░░░░░░██░░░░░░░░░░██░░░░░░██░░░░░░░░░░
With custom loot tables, you can make mobs drop anything you want. If you wish, you can keep their regular drops and add new ones. Or you can remove their regular drops and make them drop something completely new. It's up to you!
I found a small mistake in the main post there which had me confused for a while -
My json file wasn't running because I was setting the data of stone to a "count" of 6 to make it polished andesite. Took me a little bit to figure out that it's suppose to be "data" instead. ^^
Edit: Also might as will ask, I'm using Notepad++ with the encoding setting "UTF-8 without BOM", will this effect anything that I should know about instead of using just "UTF-8" encoding?
It says, set_data. So it's probebly correct.
Thanks, fixed!
"Without BOM" means a series of bytes won't be placed at the beginning to identify the file as being specifically UTF-8. In some cases having the BOM will produce a negative effect depending on what program is reading it; in this case, both will work for Minecraft.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
You will have to use external NBT detection. If the chest has a "LootTable" tag, it will overwrite its inventory the next time it is opened, and by opening it the "LootTable" tag is deleted. You have use use external commands to re-apply the tag.
When checking for a pre-existing list tag with nothing in it ("Items:[]"), the game will check if the target has that list as being empty. You can do that to detect when a check is empty and then re-apply the "LootTable" tag. You can use CommandStats to store that success value as a score on the armor stand.
Very quick example:
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Am I right to conclude from my testing that entity / score conditions can not be used for fishing and chests since "this", "killer", "killer_player" are literally only used for mob entities that die?
I wish at minimum "this" would refer to the player initiating the loot table in the case of fishing and opening chests etc. At best, target selector syntax!
Russ
Is there anyway I could give a pare of leather boots with only level 1 depth strider in a loot table?
And in what things can you use this?
Oh ok. Thanks.
No good, with enchant by level it will apply random enchantment you could have gotten from an enchanting table in that level range. I am looking for just depth strider 1. and yes I did try stringing both together, it just gave me 1 random enchantment, and 1 random level of depth strider.
Ok I found out how, use the NBT tags to force it
I assume you can also do potions this way
I did try "this" and the other two in hopes that fishing used them obscurely. None worked to allow entity score conditions with a player fishing. Of course there is a lot of room to have error in my JSON table, but no errors were reported. Instead, fishing using these conditions gave nothing since the pool didn't meet conditions.
Russ
Just to point out: loot tables are not resource packs. Resource packs are client-side while loot tables are server-side. They are essentially plugins instead.
Unfortunately there are limitations for these types of implementations. I'll be rewriting functions/conditions in the coming week where I will specify which ones work where.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Ok, so my earlier assumption that set_nbt work for potions was false. How do I put a potion in a loot table?