Jump to content

Recommended Posts

Posted (edited)

Hi,

I'm having problems getting a block to get its custom model in world and in inventory.

 

The below line is the only thing I can see that indicates where its going wrong, but I don't know what it's expecting differently:

Line from console: Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Invalid escape sequence at line 5 column 53 path $.variants..

 

This is the console with errors:

  Reveal hidden contents

 

 

My blockstate is located "src\main\resources\assets\dw_lonelytraveller\blockstates\gallifrey_chair_council.json" and contains:

{
    "forge_marker": 1,
    "variants": {
        "normal": {
            "model": "dw_lonelytraveller:Gallifrey\council_chamber\gallifrey_chair_council"
        },
        "inventory": {
            "model": "dw_lonelytraveller:Gallifrey\council_chamber\gallifrey_chair_council"
        }
    }
}

 

 

My Model is located "src\main\resources\assets\dw_lonelytraveller\models\block\Gallifrey\council_chamber\gallifrey_chair_council.json" and contains (The lack of textures is intentional right now):

{
	"elements": [
		{
			"name": "LegFL",
			"from": [1, 0, 1],
			"to": [2, 19, 2],
			"faces": {
				"north": {"uv": [0, 0, 1, 14], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 14], "texture": "#missing"},
				"south": {"uv": [0, 0, 1, 14], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 14], "texture": "#missing"},
				"up": {"uv": [0, 0, 1, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 1, 1], "texture": "#missing"}
			}
		},
		{
			"name": "LegFR",
			"from": [14, 0, 1],
			"to": [15, 19, 2],
			"faces": {
				"north": {"uv": [0, 0, 1, 14], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 14], "texture": "#missing"},
				"south": {"uv": [0, 0, 1, 14], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 14], "texture": "#missing"},
				"up": {"uv": [0, 0, 1, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 1, 1], "texture": "#missing"}
			}
		},
		{
			"name": "LegRL",
			"from": [1, 0, 14],
			"to": [2, 32, 15],
			"faces": {
				"north": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"south": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"up": {"uv": [0, 0, 1, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 1, 1], "texture": "#missing"}
			}
		},
		{
			"name": "LegRR",
			"from": [14, 0, 14],
			"to": [15, 32, 15],
			"faces": {
				"north": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"south": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"up": {"uv": [0, 0, 1, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 1, 1], "texture": "#missing"}
			}
		},
		{
			"name": "ChairBase",
			"from": [2, 10, 2],
			"to": [14, 14, 14],
			"faces": {
				"north": {"uv": [0, 0, 12, 4], "texture": "#missing"},
				"east": {"uv": [0, 0, 12, 4], "texture": "#missing"},
				"south": {"uv": [0, 0, 12, 4], "texture": "#missing"},
				"west": {"uv": [0, 0, 12, 4], "texture": "#missing"},
				"up": {"uv": [0, 0, 12, 12], "texture": "#missing"},
				"down": {"uv": [0, 0, 12, 12], "texture": "#missing"}
			}
		},
		{
			"name": "ChairBack",
			"from": [6, 6, 14],
			"to": [10, 25, 15],
			"faces": {
				"north": {"uv": [0, 0, 4, 16], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"south": {"uv": [0, 0, 4, 16], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 16], "texture": "#missing"},
				"up": {"uv": [0, 0, 4, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 4, 1], "texture": "#missing"}
			}
		},
		{
			"name": "BraceBack",
			"from": [2, 4, 14],
			"to": [15, 6, 15],
			"faces": {
				"north": {"uv": [0, 0, 13, 2], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"south": {"uv": [0, 0, 13, 2], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"up": {"uv": [0, 0, 13, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 13, 1], "texture": "#missing"}
			}
		},
		{
			"name": "BraceLeft",
			"from": [1, 4, 2],
			"to": [2, 6, 14],
			"faces": {
				"north": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"east": {"uv": [0, 0, 12, 2], "texture": "#missing"},
				"south": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"west": {"uv": [0, 0, 12, 2], "texture": "#missing"},
				"up": {"uv": [0, 0, 1, 12], "texture": "#missing"},
				"down": {"uv": [0, 0, 1, 12], "texture": "#missing"}
			}
		},
		{
			"name": "BraceRight",
			"from": [14, 4, 2],
			"to": [15, 6, 14],
			"faces": {
				"north": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"east": {"uv": [0, 0, 12, 2], "texture": "#missing"},
				"south": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"west": {"uv": [0, 0, 12, 2], "texture": "#missing"},
				"up": {"uv": [0, 0, 1, 12], "texture": "#missing"},
				"down": {"uv": [0, 0, 1, 12], "texture": "#missing"}
			}
		},
		{
			"from": [2, 26, 14],
			"to": [14, 30, 15],
			"faces": {
				"north": {"uv": [0, 0, 10, 4], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 4], "texture": "#missing"},
				"south": {"uv": [0, 0, 10, 4], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 4], "texture": "#missing"},
				"up": {"uv": [0, 0, 10, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 10, 1], "texture": "#missing"}
			}
		},
		{
			"from": [3, 30, 14],
			"to": [13, 31, 15],
			"faces": {
				"north": {"uv": [0, 0, 10, 4], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 4], "texture": "#missing"},
				"south": {"uv": [0, 0, 10, 4], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 4], "texture": "#missing"},
				"up": {"uv": [0, 0, 10, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 10, 1], "texture": "#missing"}
			}
		},
		{
			"from": [3, 25, 14],
			"to": [13, 26, 15],
			"faces": {
				"north": {"uv": [0, 0, 10, 4], "texture": "#missing"},
				"east": {"uv": [0, 0, 1, 4], "texture": "#missing"},
				"south": {"uv": [0, 0, 10, 4], "texture": "#missing"},
				"west": {"uv": [0, 0, 1, 4], "texture": "#missing"},
				"up": {"uv": [0, 0, 10, 1], "texture": "#missing"},
				"down": {"uv": [0, 0, 10, 1], "texture": "#missing"}
			}
		},
		{
			"name": "ArmLef",
			"from": [14, 18, 2],
			"to": [15, 19, 14],
			"faces": {
				"north": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"east": {"uv": [0, 0, 12, 2], "texture": "#missing"},
				"south": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"west": {"uv": [0, 0, 12, 2], "texture": "#missing"},
				"up": {"uv": [0, 0, 1, 12], "texture": "#missing"},
				"down": {"uv": [0, 0, 1, 12], "texture": "#missing"}
			}
		},
		{
			"name": "ArmRight",
			"from": [1, 18, 2],
			"to": [2, 19, 14],
			"faces": {
				"north": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"east": {"uv": [0, 0, 12, 2], "texture": "#missing"},
				"south": {"uv": [0, 0, 1, 2], "texture": "#missing"},
				"west": {"uv": [0, 0, 12, 2], "texture": "#missing"},
				"up": {"uv": [0, 0, 1, 12], "texture": "#missing"},
				"down": {"uv": [0, 0, 1, 12], "texture": "#missing"}
			}
		}
	],
	"display": {
		"thirdperson_righthand": {
			"scale": [0.3, 0.3, 0.3],
			"rotation": [0, 146, 0]
		},
		"gui": {
			"scale": [0.4, 0.4, 0.4],
			"rotation": [12, 155, 0],
			"translation": [0, -3.5, 0]
		},
		"fixed": {
			"scale": [0, 0.65, 0.1],
			"translation": [0, -4.5, -1]
		},
		"ground": {
			"scale": [0.3, 0.3, 0.3]
		},
		"firstperson_lefthand": {
			"scale": [0.3, 0.3, 0.3],
			"rotation": [0, 118, 0],
			"translation": [0, 0, 2.5]
		},
		"firstperson_righthand": {
			"scale": [0.3, 0.3, 0.3],
			"translation": [0, 0, 2.5],
			"rotation": [0, 118, 0]
		},
		"thirdperson_lefthand": {
			"scale": [0.3, 0.3, 0.3],
			"rotation": [0, 146, 0]
		}
	},
	"groups": [0, 1, 2, 3, 4, 5, 6, 7, 8,
		{
			"name": "HeadRest",
			"isOpen": true,
			"export": true,
			"visibility": true,
			"children": [9, 10, 11]
		}, 12, 13]
}

 

Edited by MajesticMadman
Posted

This is why ResourceLocation exists

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 11/8/2018 at 12:37 AM, Cadiboo said:

This is why ResourceLocation exists

Expand  

Yes, but as there are going to be a lot of items/blocks within the file trees so models>blocks would be the parent. Them every block would be separated into a different category at this level, and the a sub category and potentially more subs dependent on the block. So I was trying to find a way to do it in the JSON which would be simpler than having to create a variable for each block and within that set the file path and then reference that in the ModelResourceLocation

Posted

What?? I was saying that resource location exists to prevent issues like this. If you don’t have anything special (Transformations / 3D models) for your time you should probably auto generate the models.

  On 11/9/2018 at 10:04 AM, MajesticMadman said:

Them every block would be separated into a different category at this level

Expand  

I’ve gone all the way down this path and don’t recommend it. Vanilla does it with all models in a single folder and that’s the easiest way to do it.

  On 11/9/2018 at 10:04 AM, MajesticMadman said:

I was trying to find a way to do it in the JSON

Expand  

The only way to do it is with JSON.

  On 11/9/2018 at 10:04 AM, MajesticMadman said:

simpler than having to create a variable for each block and within that set the file path and then reference that in the ModelResourceLocation

Expand  

for(Item item : allModItems) ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation( item.getRegistryName(), “normal”));

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.