Skip to content

Enchantments API - #121

Open
SpaceWalkerRS wants to merge 2 commits into
gen2from
enchantments
Open

SpaceWalkerRS wants to merge 2 commits into
gen2from
enchantments

Conversation

@SpaceWalkerRS

Copy link
Copy Markdown
Member

API for registering custom enchantments

Registering Enchantments

package com.example;

import net.ornithemc.osl.enchantments.api.EnchantmentEvents;
import net.ornithemc.osl.entrypoints.api.ModInitializer;

public class ExampleInitializer implements ModInitializer {

	@Override
	public void init() {
		EnchantmentEvents.REGISTER_ENCHANTMENTS.register(ExampleEnchantments::init);
	}
}
package com.example;

import net.minecraft.enchantment.Enchantment;

import net.ornithemc.osl.core.util.NamespacedIdentifiers;
import net.ornithemc.osl.enchantments.api.EnchantmentRegistry;

public final class ExampleEnchantments {

	public static final CookieEnchantment COOKIE = EnchantmentRegistry.register(NamespacedIdentifiers.from("example", "cookie"), new CookieEnchantment());

	public static void init() {
	}
}

@SpaceWalkerRS SpaceWalkerRS added the enhancement New feature or request label Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant