|
| 1 | +--- |
| 2 | +order: D |
| 3 | +icon: light-bulb |
| 4 | +--- |
| 5 | + |
| 6 | +# Examples |
| 7 | + |
| 8 | +Some examples for reference |
| 9 | + |
| 10 | +## Beds |
| 11 | + |
| 12 | +Let's take a look at how you would create an outline rule for beds. |
| 13 | + |
| 14 | +A bed has the parts `foot` and `head`. Both parts face the same direction. So, for the foot we need to connect to where it's facing, and for the head in the opposite direction. |
| 15 | + |
| 16 | +```json bed_foot.json |
| 17 | +{ |
| 18 | + "blocks": ["#minecraft:beds"], |
| 19 | + "blockstates": { |
| 20 | + "part": ["foot"] |
| 21 | + }, |
| 22 | + "directions": ["/state:facing"], |
| 23 | + "connecting_blocks": ["/same"], |
| 24 | + "connecting_blockstates": { |
| 25 | + "facing": ["/same"], |
| 26 | + "part": ["/!same"] |
| 27 | + } |
| 28 | +} |
| 29 | +``` |
| 30 | + |
| 31 | +```json bed_head.json |
| 32 | +{ |
| 33 | + "blocks": ["#minecraft:beds"], |
| 34 | + "blockstates": { |
| 35 | + "part": ["head"] |
| 36 | + }, |
| 37 | + "directions": ["/state:facing+opposite"], |
| 38 | + "connecting_blocks": ["/same"], |
| 39 | + "connecting_blockstates": { |
| 40 | + "facing": ["/same"], |
| 41 | + "part": ["/!same"] |
| 42 | + } |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +Because we use a tag in `blocks`, beds from other mods would automatically work too, provided that the mod developer has added their beds to the tag. |
| 47 | + |
| 48 | +## Chests |
| 49 | + |
| 50 | +If a chest is large, it has the types `left` and `right`. Both blocks face in the same direction. If a left chest faces north, the right chest would be to the east, so rotating clockwise once. The Ender Chest is included in the tag but does not have a double variant, so we should exclude it. |
| 51 | + |
| 52 | +```json chest_left.json |
| 53 | +{ |
| 54 | + "blocks": ["#c:chests", "#forge:chests", "!minecraft:ender_chest"], |
| 55 | + "blockstates": { |
| 56 | + "type": ["left"] |
| 57 | + }, |
| 58 | + "directions": ["/state:facing+1"], |
| 59 | + "connecting_blocks": ["/same"], |
| 60 | + "connecting_blockstates": { |
| 61 | + "facing": ["/same"], |
| 62 | + "type": ["right"] |
| 63 | + } |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +For right chests facing north, the left one would be in the west direction, so three clockwise rotations. |
| 68 | + |
| 69 | +```json chest_right.json |
| 70 | +{ |
| 71 | + "blocks": ["#c:chests", "#forge:chests", "!minecraft:ender_chest"], |
| 72 | + "blockstates": { |
| 73 | + "type": ["right"] |
| 74 | + }, |
| 75 | + "directions": ["/state:facing+3"], |
| 76 | + "connecting_blocks": ["/same"], |
| 77 | + "connecting_blockstates": { |
| 78 | + "facing": ["/same"], |
| 79 | + "type": ["left"] |
| 80 | + } |
| 81 | +} |
| 82 | +``` |
0 commit comments