The loot table works as intended in 1.13.1 official release single player testing.
When upload to the Realm server, the portion of the loot table related to set_nbt is ignored.
The specific case revealing bug is this custom minecraft/entities/potions loot table. The set nbt portions are ignored, and the loot is just the default empty potion bottle.
Since set_nbt is ignored on Realm server, written book loots don't work at all on Realms (but do in single player), dropping nothing on Realms, given that books depend entirely on set_nbt.
{
"type": "item",
"name": "minecraft:potion",
"weight": 2,
"quality": 2,
"functions": [
{
"function": "set_nbt",
"tag": "{
Potion:\"minecraft:empty\",
CustomPotionEffects: [
{
Id: 8,
Amplifier: 3,
Duration: 1000
}
],
display: {
Lore: [
\"§r§9Flying (0:50)§r\",
\"Mysterious Concoction\"
]
},
CustomPotionColor:16777215
}"
},
{
"function": "set_name",
"name": {
"text": "Flying Potion"
}
},
{
"function": "set_count",
"count": {
"min": 1,
"max": 2
}
},
{
"function": "looting_enchant",
"count": {
"min": 1,
"max": 2
}
}
]
}
Linked issues
is duplicated by 1
Attachments
Comments 11
Following the directions posted here: https://minecraft.gamepedia.com/Tutorials/Setting_up_a_server#Configuring_the_Minecraft_server
I successfully set up a server.jar Minecraft server on a MacOS v10.13.6 (17G65) environment, joined it, gave myself witch spawn eggs, killed multiple witches, and they successfully dropped my custom loot potions and custom loot written books (see attached screenshot example). This would indicate to me that the set_nbt bug as reported here is NOT reproducible on a standalone Java server. The bug then seems to be specific/unique to Realms.
This continues to be an issue. The validity checker seems to be confused by the complex JSON format required for books and potions, and rejects valid JSON loot tables containing such items.
Realms continues to reject valid jsons as invalid which otherwise function properly in JAVA servers. I can't speak for the Realm checker specifically, since I don't know it's proprietary brand, but I can demonstrate that Adobe Brackets, which I use to code jsons, also misidentifies jsons as invalid. See the attached screenshot, Adobe Brackets, for example, fails to account for all braces { that immediately follow quotation marks ". To make complex jsons work in Minecraft, the coder really has to trust themselves and ignore the pairings Brackets is trying to highlight. In the end, Brackets will say there are unpaired braces and etc when the json functions as intended on java servers just fine. Realms will reject them as invalid.
This means valid custom books and potions, for example, will be rejected and not function on Realm servers.
That JSON is indeed invalid according to the JSON spec; the entire string should be on one line. Although seemingly this is ignored by the game itself (which uses GSON I believe). If you just want your files to start working on your realm, I'd recommend you just comply with the spec and put the string on one line and report back if that fixes the issue.
It does seem like a discrepancy that should be corrected one way or the other, though.
Putting the string on one line did in fact fix the issue: Realm's accepts the loot tables.
😃
Much obliged!
Thank you for your report!
Minecraft Realms for Java Edition has received a lot of updates and fixes over the last two years, so this issue has probably already been fixed in the meantime (e.g. because it was a temporary outage or an issue with the base game).
Since this bug report has not been updated since at least two years, please let us know if this is still an issue in current versions of Minecraft and update the bug report if applicable. If this is no longer an issue, please let us know as well. Thanks!
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki – 📖 FAQs
Trying to get my loot tables to work, I blended the secondary loot tables all into the witch.json loot table, and made more discoveries.
The loot table "works" in the sense normal items are successfully dropped, so the loot table is not "broken".
Custom potions work in single player, but in Realm drop only empty bottles (which the custom potions are based on, using set_nbt function).
Written books work in single player, but in Realm drop nothing (which are entirely defined in set_nbt function).
So... it appears its not secondary loot tables themselves that fail on Realms, but the fact that my original secondary loot tables were dropping potions and books, which depend on the set_nbt function in the loot tables.
Revised the title of this report to reflect the more accurate bug reported.