J'essaie de créer une table de butin de coffre personnalisée et peu importe ce que j'essaie, ça ne fonctionne pas. Cela fait maintenant 3 jours que je fais des recherches sur ce problème, mais sans succès.
Mon pack se trouve dans ce chemin de fichier :...\datapacks\BattlePack\data\battle\loot_tables\chests\battle_gear.json
C'est mon pack.mcmeta
:
{
"pack": {
"pack_format": 10,
"description": "Battle Pack"
}
}
C'est mon battle_gear.json
:
{
"type": "minecraft:chests",
"pools": [
{
"rolls": {
"min": 5,
"max": 10
},
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:wooden_sword",
"weight": 100
},
{
"type": "minecraft:item",
"name": "minecraft:stone_sword",
"weight": 75
},
{
"type": "minecraft:item",
"name": "minecraft:golden_sword",
"weight": 50
},
{
"type": "minecraft:item",
"name": "minecraft:iron_sword",
"weight": 60
},
{
"type": "minecraft:item",
"name": "minecraft:wooden_axe",
"weight": 75
},
{
"type": "minecraft:item",
"name": "minecraft:stone_axe",
"weight": 50
},
{
"type": "minecraft:item",
"name": "minecraft:iron_axe",
"weight": 20
},
{
"type": "minecraft:item",
"name": "minecraft:diamond_sword",
"weight": 100
},
{
"type": "minecraft:item",
"name": "minecraft:bread",
"weight": 100,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 5,
"max": 8
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:porkchop",
"weight": 60,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 5
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:beef",
"weight": 55,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 6
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:cooked_beef",
"weight": 20,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 4
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:apple",
"weight": 99,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 5,
"max": 12
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:golden_apple",
"weight": 5,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 2
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:netherite_ingot",
"weight": 6,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 2
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:dirt",
"weight": 99,
"functions": [
{
"function": "minecraft:set_data",
"data": 0
},
{
"function": "minecraft:set_count",
"count": {
"min": 15,
"max": 30
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:chainmail_chestplate",
"weight": 30
},
{
"type": "minecraft:item",
"name": "minecraft:leather_chestplate",
"weight": 100
},
{
"type": "minecraft:item",
"name": "minecraft:iron_chestplate",
"weight": 20
},
{
"type": "minecraft:item",
"name": "minecraft:golden_chestplate",
"weight": 25
},
{
"type": "minecraft:item",
"name": "minecraft:diamond",
"weight": 15,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 0,
"max": 8
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:leather_boots",
"weight": 85
},
{
"type": "minecraft:item",
"name": "minecraft:chainmail_boots",
"weight": 55
},
{
"type": "minecraft:item",
"name": "minecraft:golden_boots",
"weight": 65
},
{
"type": "minecraft:item",
"name": "minecraft:iron_boots",
"weight": 75
},
{
"type": "minecraft:item",
"name": "minecraft:iron_ingot",
"weight": 65,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 5,
"max": 20
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:log",
"weight": 85,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 18
}
}
]
},
{
"type": "minecraft:item",
"name": "minecraft:book",
"weight": 100,
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1,
"max": 10
}
}
]
}
]
}
]
}
J'ai utilisé Minecraft.tools pour cette génération, mais avec des références croisées misode générateur pour s'assurer que tout était toujours formaté et nommé correctement (j'ai juste choisi Minecraft.tools pour la simplicité, et cela a fonctionné pour moi dans le passé)
J'ai essayé presque toutes les commandes possibles et imaginables pour faire entrer ce coffre dans mon monde, mais aucune n'a fonctionné. C'est la commande que j'essaie actuellement, étant donné que c'est la réponse la plus récente que j'ai trouvée :/setblock ~ ~1 ~ minecraft:chest{BlockEntityTag:{LootTable:"battle:chests/battle_gear"}} replace
Source :
Absolument rien ne fonctionne, et je n'obtiens jamais qu'un coffre vide. J'ai tout vérifié plusieurs fois, et je n'ai trouvé aucun défaut, donc je ne suis vraiment pas sûr de ce qui ne va pas. Je sais également que mon datapack est chargé correctement, puisqu'il est répertorié dans la section /datapack list
et mon load.mcfunction
Le script s'exécute.