HomeJavaModsSalicin: Block Scale
Salicin: Block Scale
Salicin: Block Scale — screenshot 1

Easily and conveniently resize and rotate blocks (including their block entity renderers and collision boxes) with a single interface.

This is a library mod for Minecraft Forge 1.20.1. Have your Block implement IScalableBlock and/or IRotatableBlock, and it automatically gets scaled/rotated model rendering, BER rendering, and VoxelShape collision, no per-block mixin registration required.

Features

Usage

public class MyBlock extends Block implements IScalableBlock, IRotatableBlock {

    @Override
    public SBSProp getScaleConfig(BlockState state) {
        // Scale to 50% around the block center, including collision
        return new SBSProp(0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, true);
    }

    @Override
    public SBSRProp getRotationConfig(BlockState state) {
        // Rotate 45° around Y axis, centered on the block
        return new SBSRProp(45f, Direction.Axis.Y, 0.5f, 0.5f, 0.5f);
    }

    @Override
    public VoxelShape getShape(BlockState state,
                               BlockGetter level,
                               BlockPos pos,
                               CollisionContext ctx) {
        VoxelShape rotatedShape = getTranslatedShape(state, level, pos, ctx, 
                                                     super.getShape(state, level, pos, ctx));
        return getScaledShape(state, level, pos, ctx, rotatedShape);
    }
}

SBSProp Parameters

Field Description
scaleX / Y / Z Scale multiplier per axis (1.0 = original)
pivotX / Y / Z Anchor point in block coordinates (0~1, 0.5 = center)
scaleShape Whether to also scale the collision VoxelShape

SBSRProp Parameters

Field Description
degree Rotation angle in degrees
axis Rotation axis (Direction.Axis.X / Y / Z)
pivotX / Y / Z Anchor point in block coordinates (0~1, 0.5 = center)

Compatible

This mod is designed to be compatible with Embeddium & Oculus. Any incompatibility is welcome to feedback.

Feedback

If you have issues/pr to submit, please first send a brief description about the issue to 3485874663@qq.com, you will be redirected to a gitea website with username & password. You can continue your issues/pr there.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more