Oraxen
Search…
Block mechanic
How to add your own blocks to the game

How does it work?

Unlike items, blocks cannot be added to the game using predicates in a model, in fact it is not really possible to add new blocks ...at least the game wasn't made for that. But there are still some hacked-up techniques to do it anyway. Oraxen allows you to do this in two different ways. Blockstates (the json file which contains all the informations needed by Minecraft in order to render the block) can be used to attribute block models according to the characteristics of particular blocks. The oldest method relies on the blockfacing of the base block. Basically it uses the variations of a vanilla blocks which can have different blockfacing: the mushroom stem block. Only one variation is used in vanilla minecraft maps for this block, there are 6 faces on a block so we have 2^6 - 1 = 63 possible variations.
The most recent (and recommended) method is to use noteblocks and assign them different models depending on their instrument, their note and whether they are activated or not. This makes 800 possibilities (but 25 are reserved so that the vanilla noteblocks still work).
The block and noteblock mechanics have the same configuration. To switch from one to the other you just have to rename the block section to noteblock and vice versa.

Global configuration

This global configuration has to be used in order to define the hierarchy of between your multiple tool_types. You can put the normal types + new types you just invented.
1
noteblock:
2
tool_types:
3
- WOODEN
4
- STONE
5
- IRON
6
- GOLDEN
7
- DIAMOND
8
- NETHERITE
9
enabled: true
Copied!

How to create a simple block?

Oraxen item and Pack configuration

The oraxen item root configuration is the same as for any item (you can use any material like a diamond for example) and set a displayname, etc. For the pack section you can use your own model or generate one. To generate a block model juste tell to oraxen that the parent model is "block/cube_all", then add your block texture (one face) inside your oraxen/pack/textures folder.
1
my_block:
2
displayname: "&My block"
3
material: DIAMOND
4
Pack:
5
generate_model: true
6
parent_model: "block/cube_all"
7
textures:
8
- my_block_texture.png
Copied!

Block Mechanic configuration

To use this mechanic you need to tell to oraxen which model to use (to use the generated one, just put the name id of your item). You then need to use custom_variation which is not already used by another block (since by default 1 is used by caveblock, you can for example use 2). This example drop configurations allows you to get the drop when you mine it with a stone pickaxe.
1
Mechanics:
2
block:
3
custom_variation: 2
4
model: my_block
5
drop:
6
silktouch: false
7
minimal_type: STONE
8
loots:
9
- {oraxen_item: caveblock, probability: 1.0}
Copied!

Customize the breaking speed

You can customize the breaking speed and the most suitable tools with the hardness subsection.
1
Mechanics:
2
block:
3
custom_variation: 2
4
model: my_block
5
drop:
6
silktouch: false
7
minimal_type: STONE
8
best_tools:
9
- PICKAXE # and it's faster using a pickaxe
10
loots:
11
- {oraxen_item: caveblock, probability: 1.0}
12
hardness: 20 # this makes it really hard to mine
Copied!

Produce Light

You can use the option light so that your block emits light.
1
Mechanics:
2
block:
3
custom_variation: 2
4
model: my_block
5
light: 5
6
drop:
7
silktouch: false
8
loots:
9
- {oraxen_item: my_custom_item, probability: 1.0}
Copied!

Ores

This example configuration shows you how to create ores that support fortune and silktouch with a normal hardness.
1
amethyst_ore:
2
displayname: "&dAmethyst Ore"
3
material: DIAMOND
4
Pack:
5
generate_model: true
6
parent_model: "block/cube_all"
7
textures:
8
- amethyst_ore
9
Mechanics:
10
noteblock:
11
break_sound: BLOCK_STONE_BREAK
12
custom_variation: 1
13
model: amethyst_ore
14
hardness: 6
15
drop:
16
silktouch: true
17
fortune: true
18
minimal_type: IRON
19
best_tools:
20
- PICKAXE
21
loots:
22
- oraxen_item: amethyst
23
probability: 1.0
Copied!
Last modified 2mo ago