Effective Block
Base class for a custom block backed by a note-block state. ⚠️ Work in progress. Mining, drops and sounds are less battle-tested than items; getCustomBlocks goes through the internal world block cache, which has known bugs. The API may change.
A subclass declares identity (getNamespacedData), a server-unique state (getVariation, 0..799), textures (getResourcePackData) and the block item's meta (editItemMeta); mining, sounds, drops and hooks are tuned through the open methods. Like the other bases, the object must be instantiated (init() from onEnable) to register.
Textures
The model and note-block blockstates are generated only into a built pack: call EffectiveResourcepack.addServerResourcepack(this, "", "") in onEnable after the blocks' init(), otherwise the block places but looks like a plain note block. The server also needs block-updates.disable-noteblock-updates: true in paper-global.yml.
Inheritors
Types
Block textures for the generated cube model (minecraft:block/cube). texture is the main texture used for every face and the particle; override any single face with up/down/north/south/ east/west (or particle) — a null override falls back to texture. When building the model use the resolved *Texture accessors.
Properties
The placeable item: a note block carrying the block's model and force-placing this block's getNoteBlockData state (via the item's block-data / block_state component), so it shows the custom block right away.
Functions
Registers an interact handler for blocks of this custom type (matched by note-block state). RIGHT = right-click on the block, LEFT = left-click (attack) it.
Sound played when this block is broken. Defaults to the vanilla wood break sound (via required.wood.break).
Tool types that mine this block faster; empty (default) means no tool preference (base speed for any).
Block hardness — controls how long it takes to mine (vanilla note block is 0.8). <= 0 breaks instantly.
Minimum tool tier that can harvest this block, checked when requiresCorrectTool. Default EffectiveToolTier.HAND.
Maps getVariation (0..799) to a note-block state: instrument (0..15), note (0..24) and powered. Layout: powered = variation >= 400, then instrument = (variation % 400) / 25, note = % 25.
Sound played when this block is placed. Defaults to the vanilla wood place sound (via required.wood.place).
Sound played when an entity walks on this block. Defaults to the vanilla wood step sound (via required.wood.step).
Whether this block only drops its item when mined with a correct tool (getCorrectTools + getMinTier).