
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
minecraft-forge-utils
Advanced tools
Collection of useful Minecraft Forge development related utilities.
The Minecraft Forge Utils simplify some of the manual tasks and allows a more enjoying development experience.
For better performance and offline capability reasons it is recommended to use a local copy of the tools.
This can be done inside the project folder with the following command:
npx minecraft-forge-utils init
Use the npx command to run the utils with one of the commands in your project folder.
The init command prepares the workspace and installs a local copy of the needed tools for performance and offline capability.
Use the following command inside a empty folder:
npx minecraft-forge-utils init
After this was successful you should use the npx minecraft-forge-utils new
command to setup your new project.
The new command creates a new project with the required folder and files. It should be only used for new projects and never for existing projects.
To start a new project use npx minecraft-forge-utils new which will ask for
additional details like:

The add commands gives you an selection of pre-defined templates which could be used to create new blocks and items.
The create command is used to create empty files for a specific group of items or blocks.
Instead of creating 16 files manually for each color dye type you can just use:
npx minecraft-forge-utils create files color <filename>
Instead of creating 8 files manually for each wood type you can just use:
npx minecraft-forge-utils create files wood <filename>
The run / run client command tries to start a Minecraft client with your mod.
Example: npx minecraft-forge-utils run
You can add your own templates for repeating pattern within your project.
The template engines tries to detect the correct settings on the given information. You can only use the template engine, if the project was created over the minecraft-forge-utils otherwise these information are missing.
The template engine provides the following basic placeholders:
For items the following additional placeholders are provided:
For blocks the following additional placeholders are provided:
The template engine knows four commands to handle most of the common use cases.
This command create the file if not already include the whole path with the given content, e.g:
+++ models/item/[[ --block_name-- ]].json
@@@ create @@@
Adds the content after the give keyword, e.g:
+++ block/ModBlocks.java
@@@ after:@TemplateEntryPoint("Register Blocks") @@@
Adds the content before the given keyword, e.g:
+++ lang/en_us.json
@@@ before:"block.placeholder.text" @@@
Copies the content from the given file, e.g:
+++ textures/block/[[ --block_name-- ]].png
@@@ copy:/resources/textures/block/CustomBlock.png @@@
Your java template should be end with .java, a simple example looks like:
+++ block/[[ --BlockClassName-- ]].java
@@@ create @@@
package [[ --packageNamespace-- ]].block;
import net.minecraft.world.level.block.Block;
public class [[ --BlockClassName-- ]] extends Block {
public [[ --BlockClassName-- ]](Properties properties) {
super(properties);
}
}
+++ block/ModBlocks.java
@@@ after:@TemplateEntryPoint("Register Blocks") @@@
public static final RegistryObject<Block> [[ --BLOCK_NAME-- ]] =
BLOCKS.register("[[ --block_name-- ]]", () -> new [[ --BlockClassName-- ]](BlockBehaviour.Properties.of(Material.STONE)
.requiresCorrectToolForDrops().strength(3.0F, 6.0F).sound([[ --SoundType-- ]])));
+++ item/ModItems.java
@@@ after:@TemplateEntryPoint("Register Block Items") @@@
public static final RegistryObject<Item> [[ --BLOCK_NAME-- ]] =
ITEMS.register("[[ --block_name-- ]]", () -> new BlockItem(ModBlocks.[[ --BLOCK_NAME-- ]].get(),
new Item.Properties().tab(CreativeModeTab.TAB_BUILDING_BLOCKS)));
Resource templates should be end with .json, a simple example looks like:
+++ models/block/[[ --block_name-- ]].json
@@@ create @@@
{
"parent": "block/cube_all",
"textures": {
"all": "[[ --ModId-- ]]:block/[[ --block_name-- ]]"
}
}
+++ models/item/[[ --block_name-- ]].json
@@@ create @@@
{
"parent": "[[ --ModId-- ]]:block/[[ --block_name-- ]]"
}
+++ blockstates/[[ --block_name-- ]].json
@@@ create @@@
{
"variants": {
"": { "model": "[[ --ModId-- ]]:block/[[ --block_name-- ]]" }
}
}
+++ textures/block/[[ --block_name-- ]].png
@@@ copy:/resources/textures/block/CustomBlock.png @@@
+++ lang/en_us.json
@@@ before:"block.placeholder.text" @@@
"block.[[ --ModId-- ]].[[ --block_name-- ]]": "[[ --BlockName-- ]]",
Data templates should be end with .json, a simple example looks like:
+++ [[ --ModId-- ]]/loot_tables/blocks/[[ --block_name-- ]].json
@@@ create @@@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:copy_name",
"source": "block_entity"
}
],
"name": "[[ --ModId-- ]]:[[ --block_name-- ]]"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
+++ minecraft/tags/blocks/mineable/pickaxe.json
@@@ after:"values": [ @@@
"[[ --ModId-- ]]:[[ --block_name-- ]]",
+++ minecraft/tags/blocks/needs_iron_tool.json
@@@ after:"values": [ @@@
"[[ --ModId-- ]]:[[ --block_name-- ]]",
Mixed templates should be end with .template. The template engine will try it best to detect the correct paths based on the given information. But in some cases it could be that it's not recognize the correct path and you need to split the files for the specific use-case.
Full example:
+++ block/ModBlocks.java
@@@ after:@TemplateEntryPoint("Register Blocks") @@@
public static final RegistryObject<Block> [[ --BLOCK_NAME-- ]]_HALF_SLAP =
BLOCKS.register([[ --block_name-- ]]_half_slab", () -> new HalfSlabBlock(Blocks.[[ --BLOCK_NAME-- ]]_BLOCK));
+++ items/ModItems.java
@@@ after:@TemplateEntryPoint("Register Block Items") @@@
public static final RegistryObject<Item> [[ --BLOCK_NAME-- ]]_HALF_SLAP =
ITEMS.register("[[ --block_name-- ]]_slab", () -> new BlockItem(ModBlocks.[[ --BLOCK_NAME-- ]]_HALF_SLAP.get(),
new Item.Properties().tab(MaterialElementsTab.TAB_PANEL_PLATES)));
+++ blockstates/[[ --block_name-- ]].json
@@@ create @@@
{
"variants": {
"face=floor": {
"model": "[[ --ModId-- ]]:block/half_slab/[[ --block_name-- ]]_half_slab"
},
"face=wall,facing=north": {
"model": "[[ --ModId-- ]]:block/half_slab/[[ --block_name-- ]]_half_slab",
"x": 270,
"y": 180
},
"face=wall,facing=east": {
"model": "[[ --ModId-- ]]:block/half_slab/[[ --block_name-- ]]_half_slab",
"x": 270,
"y": 270
},
"face=wall,facing=south": {
"model": "[[ --ModId-- ]]:block/half_slab/[[ --block_name-- ]]_half_slab",
"x": 270
},
"face=wall,facing=west": {
"model": "[[ --ModId-- ]]:block/half_slab/[[ --block_name-- ]]_half_slab",
"x": 270,
"y": 90
},
"face=ceiling": {
"model": "[[ --ModId-- ]]:block/half_slab/[[ --block_name-- ]]_half_slab",
"x": 180
}
}
}
+++ models/block/half_slab/[[ --block_name-- ]]_half_slab.json
@@@ create @@@
{
"parent": "material_elements_panels_plates_slabs:block/template/half_slab",
"textures": {
"texture": "minecraft:block/[[ --block_name-- ]]_planks",
"particle": "minecraft:block/[[ --block_name-- ]]_planks"
}
}
+++ models/items/[[ --block_name-- ]]_half_slab.json
@@@ create @@@
{
"parent": "[[ --ModId-- ]]:block/half_slab/[[ --block_name-- ]]_half_slab"
}
+++ loot_tables/blocks/[[ --block_name-- ]].json
@@@ create @@@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:copy_name",
"source": "block_entity"
}
],
"name": "[[ --ModId-- ]]:[[ --block_name-- ]]_half_slab"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
+++ recipes/[[ --block_name-- ]]_from_[[ --block_name-- ]]_planks_by_stonecutter.json
@@@ create @@@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "minecraft:[[ --block_name-- ]]_planks"
},
"result": "[[ --ModId-- ]]:[[ --block_name-- ]]_half_slab",
"count": 4
}
+++ recipes/[[ --block_name-- ]]_from_[[ --block_name-- ]]_slab_by_stonecutter.json
@@@ create @@@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "minecraft:[[ --block_name-- ]]_slab"
},
"result": "[[ --ModId-- ]]:[[ --block_name-- ]]_half_slab",
"count": 2
}
+++ minecraft/tags/blocks/mineable/pickaxe.json
@@@ after:"values": [ @@@
"[[ --ModId-- ]]:[[ --block_name-- ]]",
+++ minecraft/tags/blocks/needs_iron_tool.json
@@@ after:"values": [ @@@
"[[ --ModId-- ]]:[[ --block_name-- ]]",
NOT OFFICIAL MINECRAFT PRODUCT. NOT APPROVED BY OR ASSOCIATED WITH MOJANG.
FAQs
Collection of useful Minecraft Forge development related utilities.
We found that minecraft-forge-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.