|
1 | 1 | ---
|
2 | 2 | title: Precise Rotation
|
| 3 | +description: This tutorial guides you through making a block with sub-cardinal rotation (e.g. creeper heads and signs), providing examples of a shell block with this rotation type. |
3 | 4 | category: Tutorials
|
4 | 5 | tags:
|
5 | 6 | - expert
|
6 | 7 | - scripting
|
7 | 8 | mentions:
|
8 | 9 | - QuazChick
|
9 | 10 | - SmokeyStack
|
10 |
| -description: This tutorial guides you through making a block with sub-cardinal rotation (e.g. creeper heads and signs), providing examples of a shell block with this rotation type. |
11 | 11 | ---
|
12 | 12 |
|
13 | 13 | ::: tip FORMAT & MIN ENGINE VERSION `1.21.40`
|
@@ -380,10 +380,10 @@ Add the following component to your block:
|
380 | 380 | "minecraft:geometry": {
|
381 | 381 | "identifier": "geometry.shell", // Model created in first step
|
382 | 382 | "bone_visibility": {
|
383 |
| - "up_0": "q.block_state('minecraft:block_face') == 'up' && !math.mod(q.block_state('wiki:rotation'), 4)", |
384 |
| - "up_22_5": "q.block_state('minecraft:block_face') == 'up' && !math.mod(q.block_state('wiki:rotation') - 1, 4)", |
385 |
| - "up_45": "q.block_state('minecraft:block_face') == 'up' && !math.mod(q.block_state('wiki:rotation') - 2, 4)", |
386 |
| - "up_67_5": "q.block_state('minecraft:block_face') == 'up' && !math.mod(q.block_state('wiki:rotation') - 3, 4)", |
| 383 | + "up_0": "q.block_state('minecraft:block_face') == 'up' && math.mod(q.block_state('wiki:rotation'), 4) == 0", |
| 384 | + "up_22_5": "q.block_state('minecraft:block_face') == 'up' && math.mod(q.block_state('wiki:rotation'), 4) == 1", |
| 385 | + "up_45": "q.block_state('minecraft:block_face') == 'up' && math.mod(q.block_state('wiki:rotation'), 4) == 2", |
| 386 | + "up_67_5": "q.block_state('minecraft:block_face') == 'up' && math.mod(q.block_state('wiki:rotation'), 4) == 3", |
387 | 387 | "side": "q.block_state('minecraft:block_face') != 'up'"
|
388 | 388 | }
|
389 | 389 | }
|
@@ -452,10 +452,10 @@ Your block JSON and script files after the above steps should look similar to th
|
452 | 452 | "minecraft:geometry": {
|
453 | 453 | "identifier": "geometry.shell",
|
454 | 454 | "bone_visibility": {
|
455 |
| - "up_0": "q.block_state('minecraft:block_face') == 'up' && !math.mod(q.block_state('wiki:rotation'), 4)", |
456 |
| - "up_22_5": "q.block_state('minecraft:block_face') == 'up' && !math.mod(q.block_state('wiki:rotation') - 1, 4)", |
457 |
| - "up_45": "q.block_state('minecraft:block_face') == 'up' && !math.mod(q.block_state('wiki:rotation') - 2, 4)", |
458 |
| - "up_67_5": "q.block_state('minecraft:block_face') == 'up' && !math.mod(q.block_state('wiki:rotation') - 3, 4)", |
| 455 | + "up_0": "q.block_state('minecraft:block_face') == 'up' && math.mod(q.block_state('wiki:rotation'), 4) == 0", |
| 456 | + "up_22_5": "q.block_state('minecraft:block_face') == 'up' && math.mod(q.block_state('wiki:rotation'), 4) == 1", |
| 457 | + "up_45": "q.block_state('minecraft:block_face') == 'up' && math.mod(q.block_state('wiki:rotation'), 4) == 2", |
| 458 | + "up_67_5": "q.block_state('minecraft:block_face') == 'up' && math.mod(q.block_state('wiki:rotation'), 4) == 3", |
459 | 459 | "side": "q.block_state('minecraft:block_face') != 'up'"
|
460 | 460 | }
|
461 | 461 | },
|
|
0 commit comments