Résolu Craft custom spécial

Team Geek

Mineur des cavernes
4 Mars 2020
53
2
3
28
24
teamgeek.fr
Bonjour j'aimerai faire un craft custom dans lequel l'item résultat est custom (avec un datapack)
craft.PNG

J'ai essayé ça:
JSON:
{
    "type": "minecraft:crafting_shapeless",
    "ingredients": [
        {
            "item": "minecraft:crafting_table"
        }
    ],
    "result": {
        "item": "minecraft:crafting_table{CanPlaceOn:["minecraft:stone"]}",
        "count": 1
    }
}
Mais ça n'a pas marché :(

Merci de votre aide :)
 
Dernière édition:
Solution
Essaies comme cela :
JSON:
{
    "type": "minecraft:crafting_shapeless",
    "ingredients": [
        {
            "item": "minecraft:crafting_table"
        }
    ],
    "result": {
        "item": "minecraft:crafting_table",
        "count": 1,
        "nbt":"{CanPlaceOn:[\"minecraft:stone\"]}"
    }
}

robin4002

Expert en informatique et systèmes d'information
Staff
Responsable technique
Responsable forum
12 Novembre 2012
20 855
157
3 002
347
26
Alsace
www.minecraftforgefrance.fr
Bonsoir,
La syntaxe du json n'est pas valide, il faut échapper les guillemets interne avec un \ :

JSON:
{
    "type": "minecraft:crafting_shapeless",
    "ingredients": [
        {
            "item": "minecraft:crafting_table"
        }
    ],
    "result": {
        "item": "minecraft:crafting_table{CanPlaceOn:[\"minecraft:stone\"]}",
        "count": 1
    }
}
(on voit déjà la différence avec la coloration du forum)

Par contre je ne sais pas si c'est une syntaxe valide pour Minecraft
 

Team Geek

Mineur des cavernes
4 Mars 2020
53
2
3
28
24
teamgeek.fr
Bonsoir,
La syntaxe du json n'est pas valide, il faut échapper les guillemets interne avec un \ :

JSON:
{
    "type": "minecraft:crafting_shapeless",
    "ingredients": [
        {
            "item": "minecraft:crafting_table"
        }
    ],
    "result": {
        "item": "minecraft:crafting_table{CanPlaceOn:[\"minecraft:stone\"]}",
        "count": 1
    }
}
(on voit déjà la différence avec la coloration du forum)

Par contre je ne sais pas si c'est une syntaxe valide pour Minecraft
Effectivement Minecraft n'en veut pas:
1618596021978.png
 

robin4002

Expert en informatique et systèmes d'information
Staff
Responsable technique
Responsable forum
12 Novembre 2012
20 855
157
3 002
347
26
Alsace
www.minecraftforgefrance.fr
Essaies comme cela :
JSON:
{
    "type": "minecraft:crafting_shapeless",
    "ingredients": [
        {
            "item": "minecraft:crafting_table"
        }
    ],
    "result": {
        "item": "minecraft:crafting_table",
        "count": 1,
        "nbt":"{CanPlaceOn:[\"minecraft:stone\"]}"
    }
}
 
  • C'est le feu
Reactions: Team Geek
Solution