Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App
Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
RegistryEdit

RegistryEdit

Very small library to modify and replace assets in Registries

570
5
Cursed
Library
Management
AboutChangelogVersions

A often unneeded, yet sometimes required feature, put into a library: Modifying registry elements at runtime. Not much explanation is needed for this library, other than if used improperly it can cause errors.

How to use:

void Initialize() {
    ...
    //Note: do NOT use Registry.register(...) on the custom assets!
    RegistryEditEvent.EVENT.register(manipulator -> {
        // For native Minecraft elements (Item/Block)
        var myCustomItem1 = new Item(new Item.Settings());
        manipulator.Redirect(Registries.ITEM, Items.STICK, myCustomItem1);
        // ++ Items.STICK = myCustomItem1
        // -- Items.STICK = EXISTING_ITEM
        // other elements (Any, so long as the field holding it is static final)
        var myCustomItem2 = new Item(new Item.Settings());
        manipulator.Redirect(MyItems.class, Registries.ITEM, MyItems.CUSTOM_ITEM, myCustomItem2);
        // ++ MyItems.CUSTOM_ITEM = myCustomItem2
        // -- MyItems.CUSTOM_ITEM = EXISTING_ITEM

        // For removing elements entirely (VERY DANGEROUS UNLESS YOU KNOW WHAT YOU ARE DOING!)
        manipulator.Unregister(Registries.ITEM, Items.ENDER_PEARL);

        // If you are removing a block, ensure you replace the BlockItem associated with it!
        manipulator.Unregister(Registries.BLOCK, Blocks.COBBLESTONE);
        manipulator.Redirect(Registries.Item, Items.COBBLESTONE, new Item(new Item.Settings()));
    });
    
    ...
}

Assuming you are overriding an item in the Items / Blocks class (ie, where Items.STICK would be located) the registry edit will apply to that variable as well. If you need to modify an element that isn't in the Items / Blocks class, you can provide your holder class.

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Compatibility

Minecraft: Java Edition

1.20–1.20.4

Platforms

Fabric
Quilt

Supported environments

Client only
Server only
Singleplayer
Client and server (optional)

Links

View source Join Discord server

Creators

Feintha
Feintha Member

Details

Licensed MIT
Published last year
Updated last year

Modrinth is open source.

main@9ed1dd7

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.