Skip to content

Implement Effects API - #122

Open
SpaceWalkerRS wants to merge 1 commit into
enchantmentsfrom
effects
Open

SpaceWalkerRS wants to merge 1 commit into
enchantmentsfrom
effects

Conversation

@SpaceWalkerRS

Copy link
Copy Markdown
Member

API for registering status effects.

Registering Status Effects

package com.example;

import net.ornithemc.osl.effects.api.StatusEffectEvents;
import net.ornithemc.osl.entrypoints.api.ModInitializer;

public class ExampleInitializer implements ModInitializer {

	@Override
	public void init() {
		StatusEffectEvents.REGISTER_STATUS_EFFECTS.register(ExampleStatusEffects::init);
	}
}
package com.example;

import net.minecraft.entity.living.effect.StatusEffect;

import net.ornithemc.osl.core.util.NamespacedIdentifiers;
import net.ornithemc.osl.effects.api.StatusEffectRegistry;

public final class ExampleStatusEffects {

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

	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