From 5be6554fb9df32e155da71806cac5e520d4b359b Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Thu, 24 Nov 2022 19:02:45 -0400 Subject: [PATCH 01/22] entity_variants In this page you will learn about variants. --- entity_variants | 80 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 entity_variants diff --git a/entity_variants b/entity_variants new file mode 100644 index 0000000000..afa79d7a92 --- /dev/null +++ b/entity_variants @@ -0,0 +1,80 @@ +--- +title: Death Commands +tags: + - recipe +--- + +Learn more about Render Controllers + +Entity variants should be defined as an entity with a different looking than usually, and according to what you want to acomplish you could also change its stats. + +On this page you will learn how to add your own variants to your entities, changing their model and texture, and how to change them in-game by using commands. + +## minecraft:variant + +According to Microsoft documentation, `minecraft:variant` is used to differentiate the component group of a variant of an entity from others, such as ocelot, villager and horse. We want to use this component at our `entity.json` located at `BP/entities` to differentiate the default variant, which is the entity with no modifications, between our new variant. + +So let's get started by adding this component in our `entity.json` components, just like this: + +``` +"minecraft:variant":{ + "value": 0 +} +``` + +After having this done, we want to add a component group in order to change its variant, and it will be done just like this: + +``` +"component_groups": { + "wiki:variant_change": { + "minecraft:variant": { + "value": 1 + } + } + } +} +``` + +We have the main part done, now in order to changing the variant in-game we need to make an event call the component group, this is done this way: + +``` +"events": { + "wiki:my_event": { + "add": { + "component_groups":[ + "wiki:variant_change" + ] + } + } +``` + +Now we are completly done with the entity's behavior, so we will move to the `entity.client.json` file at `RP/entity/`. + +## entity.client.json + +In the previosly mentioned file, we need to mention all the textures we want to have, in this example im modifying the vanilla `player.entity.json` file to make it able to use the zombie texture: + +``` +"textures": { + "default": "textures/entity/steve", + "cape": "textures/entity/cape_invisible", + "variant_one": "textures/entity/zombie/zombie" + } +``` + +Remember that in this example, `default`, `cape`, and `variant_one` are our own namespaces, so we can change them to whatever we wish. Next to the namespace is our textures directories. + + +Let's now mention all the geometries we want to list for our entity: + +``` +"geometry": { + "default": "geometry.humanoid.custom", + "cape": "geometry.cape", + "variant_one": "geometry.zombie" + } +``` + +We are now done with the `entity.client.json` file! + +## Render Controller From afa0602f3b2053f33711b672114223facf9da16b Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Thu, 24 Nov 2022 17:04:56 -0600 Subject: [PATCH 02/22] Actualizar entity_variants --- entity_variants | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entity_variants b/entity_variants index afa79d7a92..27f2d8df05 100644 --- a/entity_variants +++ b/entity_variants @@ -1,5 +1,5 @@ --- -title: Death Commands +title: Entity Variants tags: - recipe --- From b33fc4aa475c833f1564718cb541911ba58893c8 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:20:34 -0600 Subject: [PATCH 03/22] Actualizar blocks-16.md Added a note related to defining block properties using commands. --- docs/blocks/blocks-16.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/blocks/blocks-16.md b/docs/blocks/blocks-16.md index 2bd226e451..6a52d0944e 100644 --- a/docs/blocks/blocks-16.md +++ b/docs/blocks/blocks-16.md @@ -819,6 +819,10 @@ bedrock_wiki: .. Will, in-game, yield the result: `tile.Barrel of Foxes.name`. Using language files is strongly recommended. +- You can define a specific block property in the `/fill` and `/setblock` commands where the data value would be, just as shown in the following example; +`/fill ~ ~ ~ ~ ~ ~ wiki:my_block ["wiki:my_property": 1]` +`/setblock ~ ~ ~ wiki:my_block ["wiki:my_property": 1]` + - A maximum of `16` values per block property may be used. - The following components may not exceed the default (16x) block size limitations: - `minecraft:entity_collision` From 95897b0145631a239c64c16a4fa21cf965ae6e92 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:21:29 -0600 Subject: [PATCH 04/22] Actualizar blocks-16.md --- docs/blocks/blocks-16.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/blocks/blocks-16.md b/docs/blocks/blocks-16.md index 6a52d0944e..5462e188b7 100644 --- a/docs/blocks/blocks-16.md +++ b/docs/blocks/blocks-16.md @@ -820,6 +820,7 @@ bedrock_wiki: .. Will, in-game, yield the result: `tile.Barrel of Foxes.name`. Using language files is strongly recommended. - You can define a specific block property in the `/fill` and `/setblock` commands where the data value would be, just as shown in the following example; + `/fill ~ ~ ~ ~ ~ ~ wiki:my_block ["wiki:my_property": 1]` `/setblock ~ ~ ~ wiki:my_block ["wiki:my_property": 1]` From e3b8d8488077b88165a9814ee1baef430db9f86e Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:21:58 -0600 Subject: [PATCH 05/22] Actualizar blocks-16.md --- docs/blocks/blocks-16.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/blocks/blocks-16.md b/docs/blocks/blocks-16.md index 5462e188b7..85d386d229 100644 --- a/docs/blocks/blocks-16.md +++ b/docs/blocks/blocks-16.md @@ -822,6 +822,7 @@ bedrock_wiki: - You can define a specific block property in the `/fill` and `/setblock` commands where the data value would be, just as shown in the following example; `/fill ~ ~ ~ ~ ~ ~ wiki:my_block ["wiki:my_property": 1]` + `/setblock ~ ~ ~ wiki:my_block ["wiki:my_property": 1]` - A maximum of `16` values per block property may be used. From ad01b3459667654b3d9f99987c6f836aa591aa74 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Fri, 21 Jul 2023 21:04:35 -0400 Subject: [PATCH 06/22] Create avoiding-properties-limit This page explains how to avoid reaching the limit of properties when developing blocks. --- docs/blocks/avoiding-properties-limit | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 docs/blocks/avoiding-properties-limit diff --git a/docs/blocks/avoiding-properties-limit b/docs/blocks/avoiding-properties-limit new file mode 100644 index 0000000000..91008bc317 --- /dev/null +++ b/docs/blocks/avoiding-properties-limit @@ -0,0 +1,59 @@ +--- +title: Avoiding Properties limit +tags: + - guide +mentions: + - Kaioga5 +--- + +## Introduction: +As you may know, block properties have a limit of 64 that you cannot exceed. This is very frustrating when creating new blocks, so I will explain you how you can avoid reaching this limit. Please note that you are not going to have more than 64 properties, however the results you'll get using this method will be equal to that! + +## How it works: +This method simply combines two or more properties in order to re-use them and read them either in permutations or conditions. For example, let's say you want to have a block with the English Alphabet letters. You'll need 26 properties for that, right? Well, with combinations you need way less! For the sake of simplicity, let's just use 15. + +## The logic: +What your code will do going of by the example above is the following; + +Example + +``` +1 & 1 = A 1 & 5 = E 1 & 9 = I 1 & 13 = M +1 & 2 = B 1 & 6 = F 1 & 10 = J +1 & 3 = C 1 & 7 = G 1 & 11 = K +1 & 4 = D 1 & 8 = H 1 & 12 = L +``` +And then; + +Example + +``` +2 & 1 = N 2 & 5 = R 2 & 9 = V 2 & 13 = Z +2 & 2 = O 2 & 6 = S 2 & 10 = W +2 & 3 = P 2 & 7 = T 2 & 11 = X +2 & 4 = Q 2 & 8 = U 2 & 12 = Y +``` + +You see how you get the same results as using 26 properties with just 15? And it can even be less if you combine more than two digits! With just 16 properties and using 5 values for combinations, you can read up to 4368 properties... crazy right? + +## How will it look like: +Using the example above as reference, your properties would look like this; +``` +"properties": { + "wiki:value": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ], + "wiki:division": [ 1, 2 ] + } +``` +And your conditions like this; +``` +"condition": "query.block_property('wiki:division') == 1 && query.block_property('wiki:value') == 1" + +"condition": "query.block_property('wiki:division') == 1 && query.block_property('wiki:value') == 2" +``` +## What have you learned; +You have learned how to use less than 64 properties and do more, combining properties to have better possibilities. + +:::tip +You can use more than 2 values in order to have more possible combinations. + +::: From 94a4aeb6e8a36350cde2c044cef610ad557f6c22 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Fri, 21 Jul 2023 21:06:25 -0400 Subject: [PATCH 07/22] Update avoiding-properties-limit update --- docs/blocks/avoiding-properties-limit | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/blocks/avoiding-properties-limit b/docs/blocks/avoiding-properties-limit index 91008bc317..d2b760c9ec 100644 --- a/docs/blocks/avoiding-properties-limit +++ b/docs/blocks/avoiding-properties-limit @@ -14,9 +14,6 @@ This method simply combines two or more properties in order to re-use them and r ## The logic: What your code will do going of by the example above is the following; - -Example - ``` 1 & 1 = A 1 & 5 = E 1 & 9 = I 1 & 13 = M 1 & 2 = B 1 & 6 = F 1 & 10 = J @@ -24,9 +21,6 @@ What your code will do going of by the example above is the following; 1 & 4 = D 1 & 8 = H 1 & 12 = L ``` And then; - -Example - ``` 2 & 1 = N 2 & 5 = R 2 & 9 = V 2 & 13 = Z 2 & 2 = O 2 & 6 = S 2 & 10 = W From ada227e07e39e9d75c5441978585144817b0c059 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Fri, 21 Jul 2023 21:10:12 -0400 Subject: [PATCH 08/22] Rename avoiding-properties-limit to avoiding-properties-limit.md --- .../{avoiding-properties-limit => avoiding-properties-limit.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/blocks/{avoiding-properties-limit => avoiding-properties-limit.md} (100%) diff --git a/docs/blocks/avoiding-properties-limit b/docs/blocks/avoiding-properties-limit.md similarity index 100% rename from docs/blocks/avoiding-properties-limit rename to docs/blocks/avoiding-properties-limit.md From 45a27829fa9335bd1dffa757181c618bb3053756 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sat, 22 Jul 2023 18:50:42 -0400 Subject: [PATCH 09/22] Update avoiding-properties-limit.md --- docs/blocks/avoiding-properties-limit.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/blocks/avoiding-properties-limit.md b/docs/blocks/avoiding-properties-limit.md index d2b760c9ec..2c648d2724 100644 --- a/docs/blocks/avoiding-properties-limit.md +++ b/docs/blocks/avoiding-properties-limit.md @@ -1,16 +1,18 @@ --- -title: Avoiding Properties limit +title: Avoiding Properties Limit +category: Tutorials tags: - guide + - advanced mentions: - Kaioga5 --- ## Introduction: -As you may know, block properties have a limit of 64 that you cannot exceed. This is very frustrating when creating new blocks, so I will explain you how you can avoid reaching this limit. Please note that you are not going to have more than 64 properties, however the results you'll get using this method will be equal to that! +As you may know, block properties have a total limit of 64 values (16 maximum per property) that you cannot exceed. This is very frustrating when creating new blocks, so I will explain you how you can avoid reaching this limit. Please note that you are not going to have more than 64 properties, however the results you'll get using this method will be equal to that! ## How it works: -This method simply combines two or more properties in order to re-use them and read them either in permutations or conditions. For example, let's say you want to have a block with the English Alphabet letters. You'll need 26 properties for that, right? Well, with combinations you need way less! For the sake of simplicity, let's just use 15. +This method simply combines two or more properties in order to re-use them and read them either in permutations or conditions. For example, let's say you want to have a block with the English Alphabet letters. You'll need 26 property values for that, right? Well, with combinations you need way less! For the sake of simplicity, let's just use 15 property values. ## The logic: What your code will do going of by the example above is the following; @@ -28,7 +30,7 @@ And then; 2 & 4 = Q 2 & 8 = U 2 & 12 = Y ``` -You see how you get the same results as using 26 properties with just 15? And it can even be less if you combine more than two digits! With just 16 properties and using 5 values for combinations, you can read up to 4368 properties... crazy right? +You see how you get the same results as using 26 property values with just 15? And it can even be less if you combine more than two digits! With just 16 property values in one of your properties and using 5 values in a second property for combinations, you can read up to 4368 property values... crazy right? ## How will it look like: Using the example above as reference, your properties would look like this; From 44a4d353337ce9baa0d0e98140b880d8c529203a Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 23 Jul 2023 22:04:16 -0400 Subject: [PATCH 10/22] Update avoiding-properties-limit.md --- docs/blocks/avoiding-properties-limit.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/blocks/avoiding-properties-limit.md b/docs/blocks/avoiding-properties-limit.md index 2c648d2724..508a092685 100644 --- a/docs/blocks/avoiding-properties-limit.md +++ b/docs/blocks/avoiding-properties-limit.md @@ -9,10 +9,14 @@ mentions: --- ## Introduction: -As you may know, block properties have a total limit of 64 values (16 maximum per property) that you cannot exceed. This is very frustrating when creating new blocks, so I will explain you how you can avoid reaching this limit. Please note that you are not going to have more than 64 properties, however the results you'll get using this method will be equal to that! +Block properties have a total limit of 64 values (16 maximum per property) that cannot be exceed. This article will explain how to avoid reaching the limit. + +:::tip +You are not going to have more than 64 properties. Using this method will be equal to that amount! +::: ## How it works: -This method simply combines two or more properties in order to re-use them and read them either in permutations or conditions. For example, let's say you want to have a block with the English Alphabet letters. You'll need 26 property values for that, right? Well, with combinations you need way less! For the sake of simplicity, let's just use 15 property values. +This method combines two or more properties in order to re-use and read them in permutations or conditions. For example, a block with the English Alphabet letters will need 26 values. You can use less values by using combinations. ## The logic: What your code will do going of by the example above is the following; @@ -30,26 +34,25 @@ And then; 2 & 4 = Q 2 & 8 = U 2 & 12 = Y ``` -You see how you get the same results as using 26 property values with just 15? And it can even be less if you combine more than two digits! With just 16 property values in one of your properties and using 5 values in a second property for combinations, you can read up to 4368 property values... crazy right? +Using this method, you achieve the same results with just 15 values. The more values available for combinations, the higher your property limit is. ## How will it look like: Using the example above as reference, your properties would look like this; -``` +```json "properties": { "wiki:value": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ], "wiki:division": [ 1, 2 ] - } +} ``` And your conditions like this; ``` -"condition": "query.block_property('wiki:division') == 1 && query.block_property('wiki:value') == 1" +"condition": "q.block_property('wiki:division') == 1 && q.block_property('wiki:value') == 1" -"condition": "query.block_property('wiki:division') == 1 && query.block_property('wiki:value') == 2" +"condition": "q.block_property('wiki:division') == 1 && q.block_property('wiki:value') == 2" ``` ## What have you learned; You have learned how to use less than 64 properties and do more, combining properties to have better possibilities. :::tip You can use more than 2 values in order to have more possible combinations. - ::: From 1c6f0432071b3e5b02d9cc8e98e70b395aa61a81 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 23 Jul 2023 23:06:41 -0400 Subject: [PATCH 11/22] Delete entity_variants --- entity_variants | 80 ------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 entity_variants diff --git a/entity_variants b/entity_variants deleted file mode 100644 index 27f2d8df05..0000000000 --- a/entity_variants +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: Entity Variants -tags: - - recipe ---- - -Learn more about Render Controllers - -Entity variants should be defined as an entity with a different looking than usually, and according to what you want to acomplish you could also change its stats. - -On this page you will learn how to add your own variants to your entities, changing their model and texture, and how to change them in-game by using commands. - -## minecraft:variant - -According to Microsoft documentation, `minecraft:variant` is used to differentiate the component group of a variant of an entity from others, such as ocelot, villager and horse. We want to use this component at our `entity.json` located at `BP/entities` to differentiate the default variant, which is the entity with no modifications, between our new variant. - -So let's get started by adding this component in our `entity.json` components, just like this: - -``` -"minecraft:variant":{ - "value": 0 -} -``` - -After having this done, we want to add a component group in order to change its variant, and it will be done just like this: - -``` -"component_groups": { - "wiki:variant_change": { - "minecraft:variant": { - "value": 1 - } - } - } -} -``` - -We have the main part done, now in order to changing the variant in-game we need to make an event call the component group, this is done this way: - -``` -"events": { - "wiki:my_event": { - "add": { - "component_groups":[ - "wiki:variant_change" - ] - } - } -``` - -Now we are completly done with the entity's behavior, so we will move to the `entity.client.json` file at `RP/entity/`. - -## entity.client.json - -In the previosly mentioned file, we need to mention all the textures we want to have, in this example im modifying the vanilla `player.entity.json` file to make it able to use the zombie texture: - -``` -"textures": { - "default": "textures/entity/steve", - "cape": "textures/entity/cape_invisible", - "variant_one": "textures/entity/zombie/zombie" - } -``` - -Remember that in this example, `default`, `cape`, and `variant_one` are our own namespaces, so we can change them to whatever we wish. Next to the namespace is our textures directories. - - -Let's now mention all the geometries we want to list for our entity: - -``` -"geometry": { - "default": "geometry.humanoid.custom", - "cape": "geometry.cape", - "variant_one": "geometry.zombie" - } -``` - -We are now done with the `entity.client.json` file! - -## Render Controller From 2eaa76590d1cc369e14b6e62bff690ec00377f4b Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Tue, 25 Jul 2023 08:58:33 -0400 Subject: [PATCH 12/22] Update blocks-16.md --- docs/blocks/blocks-16.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/blocks/blocks-16.md b/docs/blocks/blocks-16.md index 85d386d229..2bd226e451 100644 --- a/docs/blocks/blocks-16.md +++ b/docs/blocks/blocks-16.md @@ -819,12 +819,6 @@ bedrock_wiki: .. Will, in-game, yield the result: `tile.Barrel of Foxes.name`. Using language files is strongly recommended. -- You can define a specific block property in the `/fill` and `/setblock` commands where the data value would be, just as shown in the following example; - -`/fill ~ ~ ~ ~ ~ ~ wiki:my_block ["wiki:my_property": 1]` - -`/setblock ~ ~ ~ wiki:my_block ["wiki:my_property": 1]` - - A maximum of `16` values per block property may be used. - The following components may not exceed the default (16x) block size limitations: - `minecraft:entity_collision` From cea95740d0d96ccd2510f592eb02b28abdf461a2 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Tue, 25 Jul 2023 09:39:10 -0400 Subject: [PATCH 13/22] Update avoiding-properties-limit.md --- docs/blocks/avoiding-properties-limit.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/blocks/avoiding-properties-limit.md b/docs/blocks/avoiding-properties-limit.md index 508a092685..0d3c260c88 100644 --- a/docs/blocks/avoiding-properties-limit.md +++ b/docs/blocks/avoiding-properties-limit.md @@ -8,18 +8,18 @@ mentions: - Kaioga5 --- -## Introduction: +## Introduction Block properties have a total limit of 64 values (16 maximum per property) that cannot be exceed. This article will explain how to avoid reaching the limit. :::tip You are not going to have more than 64 properties. Using this method will be equal to that amount! ::: -## How it works: +## How it works This method combines two or more properties in order to re-use and read them in permutations or conditions. For example, a block with the English Alphabet letters will need 26 values. You can use less values by using combinations. -## The logic: -What your code will do going of by the example above is the following; +## The logic +What your code will do going of by the example above is the following: ``` 1 & 1 = A 1 & 5 = E 1 & 9 = I 1 & 13 = M 1 & 2 = B 1 & 6 = F 1 & 10 = J @@ -36,8 +36,8 @@ And then; Using this method, you achieve the same results with just 15 values. The more values available for combinations, the higher your property limit is. -## How will it look like: -Using the example above as reference, your properties would look like this; +## How Will It Look +Using the example above as reference, your properties would look like this: ```json "properties": { "wiki:value": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ], @@ -50,7 +50,7 @@ And your conditions like this; "condition": "q.block_property('wiki:division') == 1 && q.block_property('wiki:value') == 2" ``` -## What have you learned; +## What You Have Learned You have learned how to use less than 64 properties and do more, combining properties to have better possibilities. :::tip From b95eecba7520695eccceabf81fd1c5ff4b867769 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sat, 29 Jul 2023 15:20:42 -0400 Subject: [PATCH 14/22] Create custom_slabs.md --- docs/blocks/custom_slabs.md | 183 ++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 docs/blocks/custom_slabs.md diff --git a/docs/blocks/custom_slabs.md b/docs/blocks/custom_slabs.md new file mode 100644 index 0000000000..a6ab6a262a --- /dev/null +++ b/docs/blocks/custom_slabs.md @@ -0,0 +1,183 @@ +--- +title: Custom Slabs +category: Vanilla Re-Creations +tags: + - experimental + - easy +mentions: + - Kaioga5 +--- + +::: tip FORMAT VERSION `1.20.10` +This tutorial assumes a basic understanding of blocks. +Check out [block features](/blocks/blocks-stable) before starting. +::: + +::: warning EXPERIMENTAL +Requires `Holiday Creator Features` for use of experimental Molang queries, new item features and to trigger block events. +Requires `Upcoming Creator Features` for use of block traits. +:: +## Introduction +Making custom slabs is a simple task, but if you find any drawbacks during recreating slabs, this tutorial will help you with it, and you'll be provided with a template for you to use. + +## Custom Slab +This will create a vanilla-like custom slab. + +BP/blocks/custom_slab.json + +```json +{ + "format_version": "1.20.10", + "minecraft:block": { + "description": { + "identifier": "wiki:slab_template", + "menu_category": { + "category": "construction", + "group": "itemGroup.name.slab" + }, + "traits": { + "minecraft:placement_position": { + "enabled_states": ["minecraft:vertical_half"] + } + }, + "properties": { + "wiki:state": [0, 1] + } + }, + "permutations": [ + //Down Slab + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('wiki:state') == 0", + "components": { + "minecraft:collision_box": { + "origin": [ -8, 0, -8 ], + "size": [ 16, 8, 16 ] + }, + "minecraft:selection_box": { + "origin": [ -8, 0, -8 ], + "size": [ 16, 8, 16 ] + }, + "minecraft:on_interact": { + "event": "wiki:full_slab", + "target": "self", + "condition": "q.block_face == 1.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:slab_template')" + } + } + }, + //Top Slab + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('wiki:state') == 0", + "components": { + "minecraft:collision_box": { + "origin": [ -8, 8, -8 ], + "size": [ 16, 8, 16 ] + }, + "minecraft:selection_box": { + "origin": [ -8, 8, -8 ], + "size": [ 16, 8, 16 ] + }, + "minecraft:on_interact": { + "event": "wiki:full_slab", + "target": "self", + "condition": "q.block_face == 0.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:slab_template')" + } + } + }, + //Full Slab + { + "condition": "query.block_property('wiki:state') == 1", + "components": { + "minecraft:unit_cube": { + } + } + } + ], + "components": { + "minecraft:geometry": { + "identifier": "geometry.slab", + "bone_visibility": { + "bottom_slab": "query.block_property('minecraft:vertical_half') == 'bottom'", + "top_slab": "query.block_property('minecraft:vertical_half') == 'top'" + } + }, + "minecraft:material_instances": { + "*": { + "texture": "stone", + "render_method": "opaque" + } + } + }, + "events": { + "wiki:full_slab": { + "set_block_property": { + "wiki:state": 1 + } + } + } + } +} +``` + +## Geometry +This will be the geometry used for your custom slabs. + + + +RP/models/blocks/slab.geo.json +```json +{ + "format_version": "1.12.0", + "minecraft:geometry": [ + { + "description": { + "identifier": "geometry.slab", + "texture_width": 16, + "texture_height": 16, + "visible_bounds_width": 2, + "visible_bounds_height": 2.5, + "visible_bounds_offset": [0, 0.75, 0] + }, + "bones": [ + { + "name": "top_slab", + "pivot": [0, 0, 0], + "cubes": [ + { + "origin": [-8, 8, -8], + "size": [16, 8, 16], + "uv": { + "north": {"uv": [0, 0], "uv_size": [16, 8]}, + "east": {"uv": [0, 0], "uv_size": [16, 8]}, + "south": {"uv": [0, 0], "uv_size": [16, 8]}, + "west": {"uv": [0, 0], "uv_size": [16, 8]}, + "up": {"uv": [16, 16], "uv_size": [-16, -16]}, + "down": {"uv": [16, 16], "uv_size": [-16, -16]} + } + } + ] + }, + { + "name": "bottom_slab", + "pivot": [0, 0, 0], + "cubes": [ + { + "origin": [-8, 0, -8], + "size": [16, 8, 16], + "uv": { + "north": {"uv": [0, 8], "uv_size": [16, 8]}, + "east": {"uv": [0, 8], "uv_size": [16, 8]}, + "south": {"uv": [0, 8], "uv_size": [16, 8]}, + "west": {"uv": [0, 8], "uv_size": [16, 8]}, + "up": {"uv": [16, 16], "uv_size": [-16, -16]}, + "down": {"uv": [16, 16], "uv_size": [-16, -16]} + } + } + ] + } + ] + } + ] +} +``` + + From 125c1db711f4576f866b8164016c7306b2b120a5 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sat, 29 Jul 2023 17:31:05 -0400 Subject: [PATCH 15/22] Update custom_slabs.md --- docs/blocks/custom_slabs.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/blocks/custom_slabs.md b/docs/blocks/custom_slabs.md index a6ab6a262a..eb8cb9bc70 100644 --- a/docs/blocks/custom_slabs.md +++ b/docs/blocks/custom_slabs.md @@ -45,7 +45,7 @@ This will create a vanilla-like custom slab. } }, "permutations": [ - //Down Slab + //Bottom Slab { "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('wiki:state') == 0", "components": { @@ -111,6 +111,11 @@ This will create a vanilla-like custom slab. "wiki:full_slab": { "set_block_property": { "wiki:state": 1 + }, + "run_command": { + "command": [ + "playsound dig.stone @a[r=8]" + ] } } } From 85124d284014b82e0036e0bb7f6f0bae8fa28ed5 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sat, 29 Jul 2023 17:53:00 -0400 Subject: [PATCH 16/22] Update custom_slabs.md --- docs/blocks/custom_slabs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/blocks/custom_slabs.md b/docs/blocks/custom_slabs.md index eb8cb9bc70..e9133eb723 100644 --- a/docs/blocks/custom_slabs.md +++ b/docs/blocks/custom_slabs.md @@ -114,7 +114,7 @@ This will create a vanilla-like custom slab. }, "run_command": { "command": [ - "playsound dig.stone @a[r=8]" + "playsound step.stone @a ~~~ 0.7 1.5" ] } } From bd6452aebcb51943c0281fd21982601c5f0bb105 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 30 Jul 2023 15:01:31 -0400 Subject: [PATCH 17/22] Update custom_slabs.md --- docs/blocks/custom_slabs.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/blocks/custom_slabs.md b/docs/blocks/custom_slabs.md index e9133eb723..e19b400747 100644 --- a/docs/blocks/custom_slabs.md +++ b/docs/blocks/custom_slabs.md @@ -14,7 +14,7 @@ Check out [block features](/blocks/blocks-stable) before starting. ::: ::: warning EXPERIMENTAL -Requires `Holiday Creator Features` for use of experimental Molang queries, new item features and to trigger block events. +Requires `Holiday Creator Features` to trigger block events. Requires `Upcoming Creator Features` for use of block traits. :: ## Introduction @@ -41,13 +41,13 @@ This will create a vanilla-like custom slab. } }, "properties": { - "wiki:state": [0, 1] + "wiki:double": [false, true] } }, "permutations": [ //Bottom Slab { - "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('wiki:state') == 0", + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && !query.block_property('wiki:double')", "components": { "minecraft:collision_box": { "origin": [ -8, 0, -8 ], @@ -66,7 +66,7 @@ This will create a vanilla-like custom slab. }, //Top Slab { - "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('wiki:state') == 0", + "condition": "query.block_property('minecraft:vertical_half') == 'top' && !query.block_property('wiki:double')", "components": { "minecraft:collision_box": { "origin": [ -8, 8, -8 ], @@ -85,7 +85,7 @@ This will create a vanilla-like custom slab. }, //Full Slab { - "condition": "query.block_property('wiki:state') == 1", + "condition": "query.block_property('wiki:double')", "components": { "minecraft:unit_cube": { } @@ -110,7 +110,7 @@ This will create a vanilla-like custom slab. "events": { "wiki:full_slab": { "set_block_property": { - "wiki:state": 1 + "wiki:double": true }, "run_command": { "command": [ From 83a031620ac037498d0adac903cd481ce6e3d4a1 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 30 Jul 2023 16:29:14 -0400 Subject: [PATCH 18/22] Update custom_slabs.md --- docs/blocks/custom_slabs.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/blocks/custom_slabs.md b/docs/blocks/custom_slabs.md index e19b400747..ca56d23719 100644 --- a/docs/blocks/custom_slabs.md +++ b/docs/blocks/custom_slabs.md @@ -88,11 +88,22 @@ This will create a vanilla-like custom slab. "condition": "query.block_property('wiki:double')", "components": { "minecraft:unit_cube": { + }, + "minecraft:on_player_destroyed": { + "event": "wiki:double_destroy", + "target": "self" } } } ], "components": { + "minecraft:destructible_by_mining": { + "seconds_to_destroy": 7 + }, + "minecraft:destructible_by_explosion": { + "explosion_resistance": 6 + }, + "tag:stone": {}, "minecraft:geometry": { "identifier": "geometry.slab", "bone_visibility": { @@ -116,7 +127,13 @@ This will create a vanilla-like custom slab. "command": [ "playsound step.stone @a ~~~ 0.7 1.5" ] + }, + "decrement_stack": { + "ignore_game_mode": false } + }, + "wiki:double_destroy": { + "spawn_loot": {} // Spawns the block's default loot } } } From 2872360773134e4e27d4e2af91c5285b588f0b40 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 30 Jul 2023 16:39:37 -0400 Subject: [PATCH 19/22] Update custom_slabs.md --- docs/blocks/custom_slabs.md | 65 ++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/docs/blocks/custom_slabs.md b/docs/blocks/custom_slabs.md index ca56d23719..3b47884bfb 100644 --- a/docs/blocks/custom_slabs.md +++ b/docs/blocks/custom_slabs.md @@ -38,18 +38,18 @@ This will create a vanilla-like custom slab. "traits": { "minecraft:placement_position": { "enabled_states": ["minecraft:vertical_half"] - } - }, + } + }, "properties": { "wiki:double": [false, true] } }, "permutations": [ - //Bottom Slab - { - "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && !query.block_property('wiki:double')", - "components": { - "minecraft:collision_box": { + // Bottom Slab + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && !query.block_property('wiki:double')", + "components": { + "minecraft:collision_box": { "origin": [ -8, 0, -8 ], "size": [ 16, 8, 16 ] }, @@ -57,18 +57,18 @@ This will create a vanilla-like custom slab. "origin": [ -8, 0, -8 ], "size": [ 16, 8, 16 ] }, - "minecraft:on_interact": { - "event": "wiki:full_slab", - "target": "self", - "condition": "q.block_face == 1.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:slab_template')" - } + "minecraft:on_interact": { + "event": "wiki:full_slab", + "target": "self", + "condition": "q.block_face == 1.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:slab_template')" } - }, - //Top Slab - { - "condition": "query.block_property('minecraft:vertical_half') == 'top' && !query.block_property('wiki:double')", - "components": { - "minecraft:collision_box": { + } + }, + // Top Slab + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && !query.block_property('wiki:double')", + "components": { + "minecraft:collision_box": { "origin": [ -8, 8, -8 ], "size": [ 16, 8, 16 ] }, @@ -76,22 +76,21 @@ This will create a vanilla-like custom slab. "origin": [ -8, 8, -8 ], "size": [ 16, 8, 16 ] }, - "minecraft:on_interact": { - "event": "wiki:full_slab", - "target": "self", - "condition": "q.block_face == 0.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:slab_template')" - } + "minecraft:on_interact": { + "event": "wiki:full_slab", + "target": "self", + "condition": "q.block_face == 0.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:slab_template')" } - }, - //Full Slab - { - "condition": "query.block_property('wiki:double')", - "components": { - "minecraft:unit_cube": { - }, - "minecraft:on_player_destroyed": { - "event": "wiki:double_destroy", - "target": "self" + } + }, + // Full Slab + { + "condition": "query.block_property('wiki:double')", + "components": { + "minecraft:unit_cube": {}, + "minecraft:on_player_destroyed": { + "event": "wiki:double_destroy", + "target": "self" } } } From 9247604c7c55a46381cd350c42c95db3cc444832 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Sun, 30 Jul 2023 16:41:52 -0400 Subject: [PATCH 20/22] Update custom_slabs.md --- docs/blocks/custom_slabs.md | 210 +++++++++++++++++------------------- 1 file changed, 101 insertions(+), 109 deletions(-) diff --git a/docs/blocks/custom_slabs.md b/docs/blocks/custom_slabs.md index 3b47884bfb..644fd33377 100644 --- a/docs/blocks/custom_slabs.md +++ b/docs/blocks/custom_slabs.md @@ -27,115 +27,107 @@ This will create a vanilla-like custom slab. ```json { - "format_version": "1.20.10", - "minecraft:block": { - "description": { - "identifier": "wiki:slab_template", - "menu_category": { - "category": "construction", - "group": "itemGroup.name.slab" - }, - "traits": { - "minecraft:placement_position": { - "enabled_states": ["minecraft:vertical_half"] - } - }, - "properties": { - "wiki:double": [false, true] - } - }, - "permutations": [ - // Bottom Slab - { - "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && !query.block_property('wiki:double')", - "components": { - "minecraft:collision_box": { - "origin": [ -8, 0, -8 ], - "size": [ 16, 8, 16 ] - }, - "minecraft:selection_box": { - "origin": [ -8, 0, -8 ], - "size": [ 16, 8, 16 ] - }, - "minecraft:on_interact": { - "event": "wiki:full_slab", - "target": "self", - "condition": "q.block_face == 1.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:slab_template')" - } - } - }, - // Top Slab - { - "condition": "query.block_property('minecraft:vertical_half') == 'top' && !query.block_property('wiki:double')", - "components": { - "minecraft:collision_box": { - "origin": [ -8, 8, -8 ], - "size": [ 16, 8, 16 ] - }, - "minecraft:selection_box": { - "origin": [ -8, 8, -8 ], - "size": [ 16, 8, 16 ] - }, - "minecraft:on_interact": { - "event": "wiki:full_slab", - "target": "self", - "condition": "q.block_face == 0.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:slab_template')" - } - } - }, - // Full Slab - { - "condition": "query.block_property('wiki:double')", - "components": { - "minecraft:unit_cube": {}, - "minecraft:on_player_destroyed": { - "event": "wiki:double_destroy", - "target": "self" - } - } - } - ], - "components": { - "minecraft:destructible_by_mining": { - "seconds_to_destroy": 7 - }, - "minecraft:destructible_by_explosion": { - "explosion_resistance": 6 - }, - "tag:stone": {}, - "minecraft:geometry": { - "identifier": "geometry.slab", - "bone_visibility": { - "bottom_slab": "query.block_property('minecraft:vertical_half') == 'bottom'", - "top_slab": "query.block_property('minecraft:vertical_half') == 'top'" - } - }, - "minecraft:material_instances": { - "*": { - "texture": "stone", - "render_method": "opaque" - } - } - }, - "events": { - "wiki:full_slab": { - "set_block_property": { - "wiki:double": true - }, - "run_command": { - "command": [ - "playsound step.stone @a ~~~ 0.7 1.5" - ] - }, - "decrement_stack": { - "ignore_game_mode": false - } - }, - "wiki:double_destroy": { - "spawn_loot": {} // Spawns the block's default loot - } - } - } + "format_version": "1.20.10", + "minecraft:block": { + "description": { + "identifier": "wiki:custom_slab", + "menu_category": { + "category": "construction", + "group": "itemGroup.name.slab" + }, + "traits": { + "minecraft:placement_position": { + "enabled_states": ["minecraft:vertical_half"] + } + }, + "properties": { + "wiki:double": [false, true] + } + }, + "permutations": [ + // Bottom Slab + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && !query.block_property('wiki:double')", + "components": { + "minecraft:collision_box": { + "origin": [-8, 0, -8], + "size": [16, 8, 16] + }, + "minecraft:selection_box": { + "origin": [-8, 0, -8], + "size": [16, 8, 16] + }, + "minecraft:on_interact": { + "event": "wiki:full_slab", + "condition": "q.block_face == 1.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:custom_slab')" + } + } + }, + // Top Slab + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && !query.block_property('wiki:double')", + "components": { + "minecraft:collision_box": { + "origin": [-8, 8, -8], + "size": [16, 8, 16] + }, + "minecraft:selection_box": { + "origin": [-8, 8, -8], + "size": [16, 8, 16] + }, + "minecraft:on_interact": { + "event": "wiki:full_slab", + "condition": "q.block_face == 0.0 && q.is_item_name_any('slot.weapon.mainhand','wiki:custom_slab')" + } + } + }, + // Double Slab + { + "condition": "query.block_property('wiki:double')", + "components": { + "minecraft:unit_cube": {}, + "minecraft:on_player_destroyed": { + "event": "wiki:double_destroy" + } + } + } + ], + "components": { + "minecraft:destructible_by_mining": { + "seconds_to_destroy": 7 + }, + "minecraft:destructible_by_explosion": { + "explosion_resistance": 6 + }, + "minecraft:geometry": { + "identifier": "geometry.slab", + "bone_visibility": { + "bottom_slab": "query.block_property('minecraft:vertical_half') == 'bottom'", + "top_slab": "query.block_property('minecraft:vertical_half') == 'top'" + } + }, + "minecraft:material_instances": { + "*": { + "texture": "stone", + "render_method": "opaque" + } + } + }, + "events": { + "wiki:full_slab": { + "set_block_property": { + "wiki:double": true + }, + "run_command": { + "command": "playsound step.stone @a ~~~ 0.7 1.5" + }, + "decrement_stack": {} + }, + "wiki:double_destroy": { + "spawn_loot": {} // Spawns the block's default loot + } + } + } } ``` From 1955b8f01bc96a53c2313a43b8757471aedf05e6 Mon Sep 17 00:00:00 2001 From: Kaioga5 <118004826+Kaioga5@users.noreply.github.com> Date: Fri, 4 Aug 2023 17:48:14 -0400 Subject: [PATCH 21/22] Create custom-trapdoor.md This wiki page explains how to create a custom trapdoor. --- docs/blocks/custom-trapdoor.md | 294 +++++++++++++++++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 docs/blocks/custom-trapdoor.md diff --git a/docs/blocks/custom-trapdoor.md b/docs/blocks/custom-trapdoor.md new file mode 100644 index 0000000000..55d3c40cd7 --- /dev/null +++ b/docs/blocks/custom-trapdoor.md @@ -0,0 +1,294 @@ +--- +title: Custom Trapdoors +category: Vanilla Re-Creations +tags: + - experimental + - expert +mentions: + - Kaioga5 +--- + +::: tip FORMAT VERSION `1.20.10` +This tutorial assumes a basic understanding of blocks. +Check out [block features](/blocks/blocks-stable) before starting. +::: + +::: warning EXPERIMENTAL +Requires `Holiday Creator Features` to trigger block events. +Requires `Upcoming Creator Features` for use of block traits. +:: +## Introduction +Making custom trapdoors is an often difficult task to do, but after reading this tutorial you'll understand how they work in case you find any drawbacks during recreating them, and you'll be provided with a template for you to use. + +## Custom Trapdoor +This will create a vanilla-like custom trapdoor. + +BP/blocks/custom_trapdoor.json + +```json +{ + "format_version": "1.20.10", + "minecraft:block": { + "description": { + "identifier": "wiki:trapdoor_template", + "menu_category": { + "category": "construction", + "group": "itemGroup.name.trapdoor" + }, + "traits": { + "minecraft:placement_position": { + "enabled_states": [ "minecraft:vertical_half" ] + }, + "minecraft:placement_direction": { + "enabled_states": [ "minecraft:cardinal_direction" ] + } + }, + "properties": { + "wiki:open": [ false, true ] + } + }, + "permutations": [ + // Top Closed + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('minecraft:cardinal_direction') == 'north' && !query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 0, 0, 180 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('minecraft:cardinal_direction') == 'south' && !query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 180, 0, 0 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('minecraft:cardinal_direction') == 'east' && !query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 180, -270, 0 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('minecraft:cardinal_direction') == 'west' && !query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 180, 270, 0 ] + } + } + }, + // Top Open + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('minecraft:cardinal_direction') == 'north' && query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ -270, 0, 0 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('minecraft:cardinal_direction') == 'south' && query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 270, 0, -180 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('minecraft:cardinal_direction') == 'east' && query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 0, 270, 90 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'top' && query.block_property('minecraft:cardinal_direction') == 'west' && query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 180, -270, -270 ] + } + } + }, + // Bottom Closed + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('minecraft:cardinal_direction') == 'north' && !query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 0, 0, 0 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('minecraft:cardinal_direction') == 'south' && !query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 0, 180, 0 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('minecraft:cardinal_direction') == 'east' && !query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 0, 270, 0 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('minecraft:cardinal_direction') == 'west' && !query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 0, -270, 0 ] + } + } + }, + { + "condition": "query.block_property('wiki:open')", + "components": { + "minecraft:on_interact":{ + "event" : "wiki:close", + "target": "self" + } + } + }, + // Bottom Open + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('minecraft:cardinal_direction') == 'north' && query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 90, 0, 180 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('minecraft:cardinal_direction') == 'south' && query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 270, 0, 0 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('minecraft:cardinal_direction') == 'east' && query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 0, -270, 90 ] + } + } + }, + { + "condition": "query.block_property('minecraft:vertical_half') == 'bottom' && query.block_property('minecraft:cardinal_direction') == 'west' && query.block_property('wiki:open')", + "components": { + "minecraft:transformation": { + "rotation": [ 180, 270, -270 ] + } + } + } + ], + "components": { + "minecraft:geometry": { + "identifier": "geometry.trapdoor" + }, + "minecraft:collision_box": { + "origin": [-8, 0, -8], + "size": [16, 3, 16] + }, + "minecraft:selection_box": { + "origin": [ -8, 0, -8 ], + "size": [ 16, 3, 16 ] + }, + "minecraft:on_interact":{ + "condition": "!query.block_property('wiki:open')", + "event" : "wiki:open", + "target": "self" + }, + "minecraft:material_instances": { + "*": { + "texture": "spruce_trapdoor","render_method": "blend" + } + } + }, + "events": { + "wiki:open": { + "set_block_property": { + "wiki:open": true + }, + "run_command": { + "command": [ + "playsound open.wooden_trapdoor @a ~~~ 0.9 0.9" + ] + } + }, + "wiki:close": { + "set_block_property": { + "wiki:open": false + }, + "run_command": { + "command": [ + "playsound open.wooden_trapdoor @a ~~~ 0.9 0.9" + ] + } + } + } + } +} +``` + +## Geometry +This will be the geometry used for your custom trapdoors. + + + +RP/models/blocks/trapdoor.geo.json +```json +{ + "format_version": "1.12.0", + "minecraft:geometry": [ + { + "description": { + "identifier": "geometry.trapdoor", + "texture_width": 16, + "texture_height": 16, + "visible_bounds_width": 2, + "visible_bounds_height": 1.5, + "visible_bounds_offset": [0, 0.25, 0] + }, + "bones": [ + { + "name": "trapdoor", + "pivot": [0, 0, 0], + "cubes": [ + { + "origin": [-8, 0, -8], + "size": [16, 3, 16], + "uv": { + "north": {"uv": [16, 3], "uv_size": [-16, -3]}, + "east": {"uv": [16, 3], "uv_size": [-16, -3]}, + "south": {"uv": [16, 3], "uv_size": [-16, -3]}, + "west": {"uv": [16, 3], "uv_size": [-16, -3]}, + "up": {"uv": [16, 16], "uv_size": [-16, -16]}, + "down": {"uv": [0, 0], "uv_size": [16, 16]} + } + } + ] + }, + { + "name": "trapdoor", + "pivot": [0, 0, 0] + } + ] + } + ] +} +``` + + + +:::tip +Vanilla trapdoors have a few issues in the direction of the texture in certain faces and having a height of 2.95 when it should be 3. This block template and geometry fixes both of those issues. +::: From 1dc8353161e78b80888f4d63d02206da44e1f02f Mon Sep 17 00:00:00 2001 From: MJ105 <87320205+MedicalJewel105@users.noreply.github.com> Date: Wed, 9 Aug 2023 10:10:26 +0300 Subject: [PATCH 22/22] Add some new lines. --- docs/blocks/custom-trapdoor.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/blocks/custom-trapdoor.md b/docs/blocks/custom-trapdoor.md index 55d3c40cd7..d1e8f32c85 100644 --- a/docs/blocks/custom-trapdoor.md +++ b/docs/blocks/custom-trapdoor.md @@ -17,10 +17,13 @@ Check out [block features](/blocks/blocks-stable) before starting. Requires `Holiday Creator Features` to trigger block events. Requires `Upcoming Creator Features` for use of block traits. :: + ## Introduction + Making custom trapdoors is an often difficult task to do, but after reading this tutorial you'll understand how they work in case you find any drawbacks during recreating them, and you'll be provided with a template for you to use. ## Custom Trapdoor + This will create a vanilla-like custom trapdoor. BP/blocks/custom_trapdoor.json @@ -240,11 +243,13 @@ This will create a vanilla-like custom trapdoor. ``` ## Geometry + This will be the geometry used for your custom trapdoors. RP/models/blocks/trapdoor.geo.json + ```json { "format_version": "1.12.0",