Skip to content

mcutils:axe

Makes this item strip logs like an axe.

Registering

Before you can use this component you need to register it.

js
import { system } from "@minecraft/server";
import { AxeComponent } from "@lpsmods/mc-utils";

system.beforeEvents.startup.subscribe((event) => {
  event.blockComponentRegistry.registerCustomComponent(AxeComponent.typeId, new AxeComponent());
});

Component

Options

NameTypeDefaultDescription
sizenumber1
sound_eventstringuse.gravel
interactionsInteraction[][]

Interaction

NameTypeDescription
blockstring
converted_blockstring

Examples

Axe

json
{
  "format_version": "1.21.100",
  "minecraft:item": {
    "description": {
      "identifier": "wiki:custom_axe"
    },
    "components": {
      "mcutils:axe": {
        "size": 1,
        "sound_event": "use.gravel",
        "interactions": [{ "block": "log", "converted_block": "stripped_log" }]
      }
    }
  }
}

Not associated with or approved by Mojang Studios or Microsoft