Bedrock Wiki
  • Discord
  • Contribute
  • bedrock.dev
  • MS Learn
Beginner's Guide
  • Guide
    • 1. Introduction
      guide
    • 2. Add-Ons Explained
    • 3. Software & Preparation
    • 4. Project Setup
    • 5. Create a Custom Item
    • 6. Create a Custom Entity
    • 7. Blockbench: Modeling, Texturing & Animating
    • 8. Adding a Loot Table, Spawn Rule & Crafting Recipe
  • Extra
    • a. Understanding JSON
    • b. Download Example Packs
    • c. Troubleshooting
      help
    • d. Advanced Manifest
    • e. Format Versions
    • f. Project Setup Android
Animation Controllers
  • Intro to Animation Controllers
    guide
  • Entity Commands
  • AFK Detector
  • Death Commands
  • Molang into Scoreboard
  • Respawn Commands
Blocks
  • General
    • Intro to Blocks
      guide
    • Block Components
    • Block Tags
    • Block States
    • Block Traits
    • Block Permutations
    • Block Events
      Scripts
    • Block Event Migration
      help
    • Blocks as Items
    • Troubleshooting Blocks
      help
  • Visuals
    • Block Culling
    • Block Models
      guide
    • Block Texture Animation
    • Block Texture Variation
    • Block Tinting
  • Tutorials
    • Applying Constant Effects
      Scripts
    • Avoiding State Limit
    • Fake Blocks
      Scripts
    • Ore Loot Tables
      Scripts
    • Precise Interaction
      Scripts
    • Precise Rotation
      Scripts
    • Rotatable Blocks
  • Vanilla Re-Creations
    • Custom Crops
      Scripts
    • Custom Glass
    • Custom Glazed Terracotta
    • Custom Trapdoors
      Scripts
  • Documentation
    • Block Format History
    • Block Shapes
    • Block Sounds
    • Vanilla Block Models
Commands
  • General
    • Intro to Command Blocks
    • Functions
    • Block States
    • Coordinate System
    • NBT Commands
    • Scoreboard Operations
    • Understanding Selectors
  • Commands
    • Damage
    • Execute
    • Playanimation
    • Playsound
  • On Event Systems
    • On Player First Join
    • On Player Join
    • On Player Leave
    • On Player Death
    • On Player Respawn
    • On First World Load
  • Scoreboard Systems
    • Entity Counter
    • Scoreboard Timers
    • Comparing And Retrieving Scores
  • Techniques
    • Execute Logic Gates
    • MBE - Max's Block Entity
    • FMBE - A New Way to Create Display Entities
    • Look Detection
    • Movement Detections
    • Orbital Camera
  • Useful Creations
    • Custom Crafter
    • Multiplayer Position Rearrangement
      function
Concepts
  • contents.json
  • Emojis & Symbols
  • Molang
  • Namespaces
  • Overwriting Assets
  • Raw Text
  • Shaders
  • Sounds
  • Subpacks
  • Text and Localization
  • Texture Atlases
  • textures_list.json
Documentation
  • Shared Constructs
  • Advanced Molang
  • File Types
  • Fog IDs
  • Material Configuration Description
  • Menu Categories
  • Molang Queries
  • Pack Folder Structure
  • Sound Definitions
  • Vanilla Materials
Entities
  • General
    • Intro to Entities BP
      guide
    • Intro to Entities RP
      guide
    • Troubleshooting Entities
      help
    • Entity Events
    • Entity Properties
    • NPC Dialogues
    • Render Controllers
    • Spawn Rules
  • Tutorials
    • Convert Points Between Any Space (World, Entity, Bones)
    • Creating Boats
    • Detecting Other Entities
    • Disabling Team Damage
    • Dummy Entities
    • Entity Attacks
    • Entity Holds Item
    • Entity Movement
    • Entity Timers
    • Flying Entities
    • Introduction to AOE Clouds
    • Invulnerable Entities
    • Look at Entity
    • Sleeping Entities
    • Solid Entities
    • Spawning Tamed Entities
      Scripts
    • Village Mechanic
  • Documentation
    • Dummy Components
    • Non-Mob Runtime Identifiers
    • Projectiles
    • Runtime Identifiers
    • Vanilla Usage Components
    • Vanilla Usage Spawn Rules
Items
  • General
    • Intro to Items
      guide
    • Item Components
    • Item Tags
    • Item Events
      Scripts
    • Item Event Migration
      help
    • Troubleshooting Items
      help
  • Tutorials
    • Custom Armor
    • Custom Food
      Scripts
    • Custom Pottery Sherds
    • Custom Weapons
    • Equipment-Based Commands
    • High Resolution Items
    • Spawning Items
    • Throwable Items
  • Documentation
    • Enchantments
    • Attachables
    • Item Format History
    • Numerical Item IDs
    • Vanilla Item Identifiers
    • Vanilla Usage Components
JSON UI
  • General
    • Intro to JSON UI
      guide
    • Best Practices
      guide
  • Tutorials
    • Adding HUD Elements
    • Aseprite Animations
    • Buttons and Toggles
    • Modifying Server Forms
    • Preserve Title Texts
    • String to Number
  • Documentation
    • JSON UI Documentation
Loot, Recipes & Trading
  • General
    • Trading Behavior
  • Documentation
    • Loot Tables
    • Trade Tables
    • Recipes
    • Item Functions
  • Tutorials
    • Randomized Structure Loot
Meta
  • Add-On Performance
  • Style Guide
  • Useful Links
  • Using Schemas
  • Version Control
  • Q&A
    • Blocks and Items Q&A 2024/08/30
    • Deferred Technical Preview Q&A 2024/02/23
    • GameTest Q&A 2021/08/06
    • Scripting and Editor Q&A 2023/09/22
    • World Generation Q&A 2024/11/15
NBT
  • General
    • .mcstructure
  • Tutorials
    • Experiments in Minecraft Education
    • Extending Structure Limits
  • NBT in Depth
    • About NBT (Named Binary Tag)
    • NBT Libraries
    • Reading NBT Example
Particles
  • General
    • Intro to Particles
      guide
  • Tutorials
    • Disabling Particles
  • Documentation
    • Vanilla Particles
Scripting
  • General
    • Intro to Scripting
    • What is Script API?
    • API Modules
  • Tutorials
    • Block Placement Prevention
    • GameTests
    • Script Core Features
    • Script Forms
    • Script Requests API
    • Simple Chat Commands
  • Documentation
    • Engine Environment
    • Script Resources
    • Script Watchdog
    • Troubleshooting JavaScript
    • TypeScript
Servers
  • Software
    • Bedrock Server Software
  • Protocols
    • Bedrock Protocol
    • NetherNet Protocol
    • RakNet Protocol
Visuals
  • General
    • Introduction to Entity Visuals
      guide
    • Bedrock Modeling
    • Custom Death Animations
    • Effects in Animations
    • Material Creations
    • Materials
    • Math-Based Animations
    • Skin Packs
  • Tutorials
    • Entity Texture Animation
    • Glowing Entity Texture
    • Hurt Animations
    • Leash Position
    • Player Geometry
    • Remove Entity Shadows
    • Retexturing Spawn Eggs
  • Ideas
    • Structure Presentation
World Generation
  • General
    • Intro to World Generation
      guide
    • Biomes
      guide
    • Feature Types
    • Jigsaw Structures
  • Tutorials
    • Block Conditions for Features
    • Generating Custom Ores
    • Generating Custom Structures
    • Generating Patches
    • Heightmap Noise
  • Documentation
    • Biome Tags

Fake Blocks

intermediate
scripting
Fake Blocks
  • Creating the Collision
  • Basic Components
  • Aligning the Entity Rotation
  • Aligning the Entity Position
  • Cracking Texture

Sometimes your block needs to have features which Minecraft doesn't allow. A possible solution is to create an entity which replicates characteristics of a block.

Creating the Collision ​

The solid entities tutorial outlines four different ways to create a collision, with runtime_identifiers, blocks, and components.

Basic Components ​

Those components below are required to make the entity act as a block, and also don't add the "minecraft:physics": {} component in there, because this will make your entity fall or have a collision with some blocks like water or lava.

BP/entities/your_entity.json#minecraft:entity/components
json
{
    // Knockback resistance is needed to make it not be Knocked off by an entity.
    "minecraft:knockback_resistance": {
        "value": 1
    },
    // Tells if the entity can be pushed or not.
    "minecraft:pushable": {
        "is_pushable": false,
        "is_pushable_by_piston": true
    },
    // Sets the distance through which the entity can push through.
    "minecraft:push_through": {
        "value": 1
    },
    // Makes it invincible.
    "minecraft:damage_sensor": {
        "triggers": [
            {
                "deals_damage": false,
                "cause": "all"
            }
        ]
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

Aligning the Entity Rotation ​

To align your entity in rotation, you will need some Math.

json
"rotation": [ 0, "-q.body_y_rotation + (Math.round(q.body_y_rotation / 90) * 90)", 0 ]
1

Apply that code on the core folder (that has all the other groups inside) of your model in an animation, make sure the pivot point is 0 in the X and Z Axis, to avoid visual bugs. And also you don't need to add components like:

  • "minecraft:behavior.look_at_entity": {}
  • "minecraft:behavior.look_at_player": {}
  • "minecraft:behavior.look_at_target": {}

The reason why is because this will change the Target Y Rotation, causing it to move the Body Y Rotation so the Model will move. Don't add walk components too.

Aligning the Entity Position ​

To align the position of the entity this will be more tricky.

First, in the minecraft:entity_spawned event, make a custom block with a queue_command, and make a new dummy-entity with a transformation event to transform the dummy entity to the original entity, so we avoid triggering the minecraft:entity_spawned again.

BP/entities/your_entity.json#minecraft:entity/events
json
// Event in the original entity.
"minecraft:entity_spawned": {
    "add": {
        "components_groups": [
            "despawn" // We will also need to despawn the first entity.
        ]
    },
    "queue_command": {
        "command": ["setblock ~~~ wiki:align"]
    }
}
1
2
3
4
5
6
7
8
9
10
11
BP/entities/your_entity.json#minecraft:entity/component_groups
json
// Component group in the original entity.
"component_groups": {
    "despawn": {
        "minecraft:despawn": {}
    }
}
1
2
3
4
5
6

Block used to summon the dummy entity right on the block, and as the block is centered, the entity will center too:

BP/blocks/your_dummy_block.json
json
{
    "format_version": "1.21.70",
    "minecraft:block": {
        "description": {
            "identifier": "wiki:align"
        },
        "components": {
            "minecraft:light_dampening": 0,
            "minecraft:collision_box": false,
            "minecraft:selection_box": false,
            "minecraft:loot": "loot_tables/empty.json",
            "minecraft:geometry": "geometry.empty",
            "minecraft:material_instances": {
                "*": {
                    "texture": "wiki:empty"
                }
            },
            "minecraft:destructible_by_mining": {
                "seconds_to_destroy": 2
            },
            "minecraft:custom_components": ["wiki:align_entity"]
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

For our custom component script, we'll utilize the beforeOnPlayerPlace event. We use this event to prevent the block from being placed and just summon our entity instead.

js
import { world } from "@minecraft/server";

/** @type {import("@minecraft/server").BlockCustomComponent} */
const BlockAlignEntityComponent = {
    beforeOnPlayerPlace(event) {
        event.cancel = true;

        const location = event.block.center();
        event.dimension.spawnEntity("wiki:dummy_align", location);
    },
};

world.beforeEvents.worldInitialize.subscribe(({ blockComponentRegistry }) => {
    blockComponentRegistry.registerCustomComponent("wiki:align_entity", BlockAlignEntityComponent);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
BP/entities/your_dummy_entity.json
json
{
    "format_version": "1.13.0",
    "minecraft:entity": {
        "description": {
            "identifier": "wiki:dummy_align", // The dummy entity is used to avoid triggering the entity_spawned event in the original entity.
            "is_spawnable": false,
            "is_summonable": true,
            "is_experimental": false
        },
        "component_groups": {
            "transform": {
                "minecraft:transformation": {
                    "into": "wiki:your_entity",
                    "delay": 0
                }
            }
        },
        "components": {
            "minecraft:physics": {
                "has_gravity": false
            },
            "minecraft:collision_box": {
                "width": 0.1,
                "height": 0.1
            },
            "minecraft:damage_sensor": {
                "triggers": {
                    "cause": "all",
                    "deals_damage": false
                }
            }
        },
        "events": {
            "minecraft:entity_spawned": {
                "add": {
                    "component_groups": ["transform"]
                }
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

Cracking Texture ​

Vanilla blocks have a cracking texture that appears when you break them. Here I will show you how to add this effect to your entity.

First, we have to add some textures to your entity file, make sure that you are using the vanilla textures instead of custom ones(this is to make it compatible with your resource packs)

RP/entity/your_entity.json#description
json
{
    "textures": {
        "default": "textures/entity/your_texture",
        "destroy_stage_0": "textures/environment/destroy_stage_0",
        "destroy_stage_1": "textures/environment/destroy_stage_1",
        "destroy_stage_2": "textures/environment/destroy_stage_2",
        "destroy_stage_3": "textures/environment/destroy_stage_3",
        "destroy_stage_4": "textures/environment/destroy_stage_4",
        "destroy_stage_5": "textures/environment/destroy_stage_5",
        "destroy_stage_6": "textures/environment/destroy_stage_6",
        "destroy_stage_7": "textures/environment/destroy_stage_7",
        "destroy_stage_8": "textures/environment/destroy_stage_8",
        "destroy_stage_9": "textures/environment/destroy_stage_9"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

And add a geometry that has to inflate 0.1 in all their cubes to avoid Z-Fighting.

RP/entity/your_entity.json#description
json
{
    "geometry": {
        "default": "geometry.your_geometry",
        "broken": "geometry.broken"
    }
}
1
2
3
4
5
6

And now we have to add a new render controller. This is going to select different textures between the destroy stages. (Remember not to replace your actual controller, you need two controllers, the first one is just the one that adds model, textures, and material to your normal entity, and the second one is this one that defines the cracking texture)

RP/render_controllers/my_entity.json
json
{
    "controller.render.broken": {
        "arrays": {
            "textures": {
                "array.broken": [
                    "texture.destroy_stage_9",
                    "texture.destroy_stage_8",
                    "texture.destroy_stage_7",
                    "texture.destroy_stage_6",
                    "texture.destroy_stage_5",
                    "texture.destroy_stage_4",
                    "texture.destroy_stage_3",
                    "texture.destroy_stage_2",
                    "texture.destroy_stage_1",
                    "texture.destroy_stage_0",
                    "texture.normal"
                ]
            }
        },
        "geometry": "Geometry.broken",
        "materials": [
            {
                "*": "Material.default"
            }
        ],
        "textures": [
            "array.broken[q.health * 1]" // Here you can calculate the health of your entity to make sure it isn't buggy. If your entity has 10 health, leave it as it. If it has 20, it should be `q.health * 0.5`. If it is 40, it has to be 0.25, etc...
        ]
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Contributors

Edit Fake Blocks on GitHub

Bedrock Wiki by Bedrock OSS

"Minecraft" is a trademark of Mojang AB.

Bedrock OSS, Bedrock Wiki and bedrock.dev are not affiliated in any way with Microsoft or Mojang AB.

  • Privacy Policy
  • Join our Discord
  • Learn how to Contribute
  • Visit our Repository