Jump to content

Recommended Posts

Posted

Working on adding "wood paneling" using wallpaper as my base script. I dont get any errors and the block shows up in game just fine but I t wont go on the walls:

 

code:

{
	code: "woodpanel",
	behaviors: [ {name: "Decor", properties: {sides: ["north", "east", "south", "west", "up", "down"], thickness: 0.0 }} ],
	attributes: {
		handbook: {
			groupBy: ["paneling-*"]
		}
	},
	variantgroups: [
		{ code:"type", states: ["acacia-1","acacia-2" ] }
	],
	drawtype: "surfacelayer",
	shapeInventory: { base: "game:block/basic/layers/0voxel", rotateX: 90 },
	sidesolid: { all: false },
	sideopaque: { all: false },
	blockmaterial: "Wood",
	creativeinventory: { "general": ["*"], "decorative": ["*"] },
	replaceable: 5500,
	resistance: 0,
	lightAbsorption: 0,
	textures: { all: { base: "stain/{type}" } },
	vertexflags: { zOffset: 1 },
	drops: [],
	combustibleProps: {
		burnTemperature: 150,
		burnDuration: 2,
	},
	guiTransform: {
		rotate: false,
		rotation: { x: 15, y: -42, z: 0 },
		origin: { x: 0.5, y: 0.5, z: 0 },
		scale: 1.5
	},
	groundTransform: {
		translation: { x: 0, y: 0, z: 0 },
		rotation: { x: -90, y: 1, z: 0 },
		origin: { x: 0.5, y: 0.5, z: -0.02 },
		scale: 2.5
	},
	tpHandTransform: {
		translation: { x: -1.2, y: -0.7, z: 0.1 },
		rotation: { x: 5, y: -12, z: -25 },
		origin: { x: 0.5, y: 0.5, z: 0 },
		scale: 0.45
	},
	sounds: {
		place: "game:block/cloth",
		break: "game:block/cloth",
		hit: "game:block/cloth",
		walk: "game:walk/cloth"
	},
	materialDensity: 400
}

 

Not sure I understand why its not going on the walls like wallpaper. The only thing I changed was textures. I see it has a "up" and "down" face in the shape. But I assume using texture all should translate into all sides use "this" texture. Not sure what to do here. If I had an error I would have something to review. 

Posted (edited)

Update:

I got the code kinda working. I revamped my code:


{
	code: "woodpaneling",
	behaviors: [ {name: "Decor", properties: {sides: ["north", "east", "south", "west", "up", "down"], thickness: 0.0 }} ],
	class: "Block",
	shape: { base: "woodpanel1" },
	drawtype: "surfacelayer",
	blockmaterial: "Wood",
	creativeinventory: { "general": ["*"], "construction": ["*"] },
	replaceable: 700,
	resistance: 3,
	lightAbsorption: 99,
	textures: { "all": { "base": "stain/acacia-1" } },
	drops: [ {
		type: "block",
		code: "woodpaneling",
		quantity: { avg: 0.85, var: 0 }
	} ],
	sounds: {
		place: "game:block/dirt",
		break: "game:block/dirt",
		hit: "game:block/dirt"
	},
	fertility: 3,
	heldTpIdleAnimation: "holdbothhandslarge", heldRightReadyAnimation: "heldblockready", heldTpUseAnimation: "twohandplaceblock",
	tpHandTransform: {
		translation: { x: -1.23, y: -0.91, z: -0.8 },
		rotation: { x: -2, y: 25, z: -78 },
		scale: 0.4
	}
}

 

The problem is here:

drawtype: "surfacelayer",

If I change it to "Cube" it will give me a texture but also draws a cube. If I use "surfacelayer", it draws on surface but does not apply texture. So not sure how to get it to use my texture and draw on surface. 

 

update:

So far I've discovered:

"json" = draws only on the floor/ground

"cube" = draws a cube

"drawsurface" = i assume only draws on surface but for me not getting a texture currently

"liquid" = Draws on ground but gives not texture when tested

Edited by Micah Holmes
  • Solution
Posted

I got it working here is my solution:

Block code:


{
	code: "woodpaneling",
	behaviors: [ {name: "Decor", properties: {sides: ["north", "east", "south", "west", "up", "down"], thickness: 0.1 }} ],
	class: "Block",
	shape: { base: "woodpanel1" },
	blockmaterial: "Wood",
	creativeinventory: { "general": ["*"], "construction": ["*"] },
	replaceable: 700,
	resistance: 3,
	lightAbsorption: 99,
	textures: { "all": { "base": "stain/acacia-1" } },
	drops: [ {
		type: "block",
		code: "woodpaneling",
		quantity: { avg: 0.85, var: 0 }
	} ],
	sounds: {
		place: "game:block/dirt",
		break: "game:block/dirt",
		hit: "game:block/dirt"
	},
	fertility: 3,
	heldTpIdleAnimation: "holdbothhandslarge", heldRightReadyAnimation: "heldblockready", heldTpUseAnimation: "twohandplaceblock",
	tpHandTransform: {
		translation: { x: -1.23, y: -0.91, z: -0.8 },
		rotation: { x: -2, y: 25, z: -78 },
		scale: 0.4
	}
}

 

I had to make my own shape to get it to work fully:

{
	"editor": {
		"allAngles": false,
		"entityTextureMode": false
	},
	"textureWidth": 16,
	"textureHeight": 16,
	"textureSizes": {
	},
	"textures": {
	},
	"elements": [
		{
			"name": "Cube2",
			"from": [ 0.0, 0.0, 0.0 ],
			"to": [ 16.0, 1.0, 16.0 ],
			"faces": {
				"north": { "texture": "#panel", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
				"east": { "texture": "#panel", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
				"south": { "texture": "#panel", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
				"west": { "texture": "#panel", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
				"up": { "texture": "#panel", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
				"down": { "texture": "#panel", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
			}
		}
	]}

 

I still dont know how they where able to get wallpaper to work but here is my working version. 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.