TheAnubisGod Posted May 4, 2021 Report Posted May 4, 2021 Hello. I want to add block called "statue" to my mod and it is very important to provide user an opportunity to control block orientation. It always looks one way. Is there a special property to fix this (I have checked official documentation page several times but didn`t find anything...)? Thanks in advance)
l33tmaan Posted May 4, 2021 Report Posted May 4, 2021 (edited) This may or may not be helpful, but I used stairs.json as a reference. These, in particular, are the important parts: class: "BlockStairs", variantgroups: [ { loadFromProperties: "abstract/verticalorientation" }, { loadFromProperties: "abstract/horizontalorientation" }, { code: "cover", states: ["free", "snow"] } ], I think the class and vertical/horizontal properties are what help control orientation. If you look further down, you'll see this: shapebytype: { "*-up-north-free": { base: "block/basic/stairs/normal", rotateY: 0 }, "*-up-west-free": { base: "block/basic/stairs/normal", rotateY: 90 }, "*-up-south-free": { base: "block/basic/stairs/normal", rotateY: 180 }, "*-up-east-free": { base: "block/basic/stairs/normal", rotateY: 270 }, "*-up-north-snow": { base: "block/basic/stairs/snow-normal", rotateY: 0 }, "*-up-west-snow": { base: "block/basic/stairs/snow-normal", rotateY: 90 }, "*-up-south-snow": { base: "block/basic/stairs/snow-normal", rotateY: 180 }, "*-up-east-snow": { base: "block/basic/stairs/snow-normal", rotateY: 270 }, "*-down-north-free": { base: "block/basic/stairs/flipped", rotateY: 0 }, "*-down-west-free": { base: "block/basic/stairs/flipped", rotateY: 90 }, "*-down-south-free": { base: "block/basic/stairs/flipped", rotateY: 180 }, "*-down-east-free": { base: "block/basic/stairs/flipped", rotateY: 270 } }, Something like this will probably give you the results you want. You probably don't need vertical orientation unless you're planning on letting people place those statues upside down. EDIT: Also, those are very nice textures. Too nice for this game. I would recommend heavily downscaling the texture and applying a bit of noise to make it fit in better... or you could probably use the existing stone textures in-game. Your call! Edited May 4, 2021 by l33tmaan 1 1
TheAnubisGod Posted May 7, 2021 Author Report Posted May 7, 2021 (edited) Finally, I found the solution. To implement such experience, you should add this code: behaviors: [ { "name": "HorizontalOrientable" } ], variantgroups: [ { code: "side", loadFromProperties: "abstract/horizontalorientation" } ], creativeinventoryByType: { "*-east": {general: ["*"]} }, shape: { base: "block/yourblockmodel", "rotateYByType": { "*-north": 0, "*-east": 270, "*-south": 180, "*-west": 90 } }, Edited May 7, 2021 by TheAnubisGod 1
Recommended Posts