Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
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

558
5
Cursed
Library
Management

Compatibility

Minecraft: Java Edition

1.20–1.20.4

Platforms

Fabric
Quilt

Supported environments

Client-side
Server-side
Client and server

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

View source Join Discord server

Creators

Feintha
Feintha Member

Details

Licensed MIT
Published last year
Updated last year
DescriptionChangelogVersions

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.

Modrinth is open source.

main@81b0922

© 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.