Jump to content

Recommended Posts

Posted (edited)

I'm trying to create a block which uses a custom model and is rotatable on an axis like wood blocks.

The specific error is:

[02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_medium.json' missing model for variant: 'jdyntreesmod:block_oak_medium#axis=y'
[02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_medium.json' missing model for variant: 'jdyntreesmod:block_oak_medium#axis=z'
[02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_medium.json' missing model for variant: 'jdyntreesmod:block_oak_medium#axis=x'
[02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_medium.json' in resourcepack: 'main': com.google.gson.stream.MalformedJsonException: Expected name at line 6 column 6 path $.variants.

 

The Blockstate File:

{
    "variants": {
        "axis=y":  { "model": "jdyntreesmod:models/blocks/model_block_oak_medium" },
        "axis=z":   { "model": "jdyntreesmod:models/blocks/model_block_oak_medium", "x": 90 },
        "axis=x":   { "model": "jdyntreesmod:models/blocks/model_block_oak_medium", "x": 90, "y": 90 },
    }
}

Before you ask: i removed the axis=none line because it was throwing the following error

[02:54:06] [Server-Worker-2/WARN] [minecraft/ModelBakery]: Exception loading blockstate definition: 'jdyntreesmod:blockstates/block_oak_small.json' in resourcepack: 'main' for variant: 'axis=none': Unknown value: 'none' for blockstate property: 'axis' [x, y, z]

The code i used to create the java File is identical to RotatedPillarBlock (For testing purposes)

This is the Model .json

{
	"credit": "Made with Blockbench",
	"parent": "minecraft:block/block",
	"ambientocclusion": false,
	"texture_size": [32, 16],
	"textures": {
		"particle": "jdyntreesmod:blocks/block_oak_medium"
	},
	"elements": [
		{
			"name": "oakLogMedium",
			"from": [3, 1, 3],
			"to": [13, 16, 13],
			"rotation": {"angle": 0, "axis": "z", "origin": [13, 16, 3]},
			"faces": {
				"north": {"uv": [2.5, 5, 5, 12.5], "texture": "#particle"},
				"east": {"uv": [0, 5, 2.5, 12.5], "texture": "#particle"},
				"south": {"uv": [7.5, 5, 10, 12.5], "texture": "#particle"},
				"west": {"uv": [5, 5, 7.5, 12.5], "texture": "#particle"},
				"up": {"uv": [5, 5, 2.5, 0], "texture": "#particle"},
				"down": {"uv": [7.5, 0, 5, 5], "texture": "#particle"}
			}
		}
	],
	"display": {
		"thirdperson_righthand": {
			"rotation": [75, 45, 0],
			"translation": [0, 2.5, 0],
			"scale": [0.375, 0.375, 0.375]
		}
	}
}

 

Is the axis=none line the cause of the issue? If so, what can i do to fix the error associated with it?

I hate jsons.

Edited by nil
Posted
12 minutes ago, nil said:

com.google.gson.stream.MalformedJsonException: Expected name at line 6 column 6 path $.variants.

Your json file is not valid json.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)
9 hours ago, nil said:

{
    "variants": {
        "axis=y":  { "model": "jdyntreesmod:models/blocks/model_block_oak_medium" },
        "axis=z":   { "model": "jdyntreesmod:models/blocks/model_block_oak_medium", "x": 90 },
        "axis=x":   { "model": "jdyntreesmod:models/blocks/model_block_oak_medium", "x": 90, "y": 90 },
    }
}

If you add a comma at the end of the last block (the "axis = x"), it expects there is another variant after that, which in your case there is not.

Edited by Beethoven92

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

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.