Skip to content

Status Effects

Status effects, also known as effects, are a condition that can affect an entity. They can be positive, negative or neutral in nature. The base game applies these effects in various ways such as food, potions etc.

The /effect command can be used to apply effects on an entity.

Custom Status Effects

In this tutorial we'll add a new custom effect called Tater which gives you one experience point every game tick.

Extend StatusEffect

Let's create a custom effect class by extending StatusEffect, which is the base class for all effects.

public class TaterEffect extends StatusEffect {
	protected TaterEffect() {
		// category: StatusEffectCategory - describes if the effect is helpful (BENEFICIAL), harmful (HARMFUL) or useless (NEUTRAL)
		// color: int - Color is the color assigned to the effect (in RGB)
		super(StatusEffectCategory.BENEFICIAL, 0xe9b8b3);

	// Called every tick to check if the effect can be applied or not
	public boolean canApplyUpdateEffect(int duration, int amplifier) {
		// In our case, we just make it return true so that it applies the effect every tick
		return true;

	// Called when the effect is applied
	public void applyUpdateEffect(LivingEntity entity, int amplifier) {
		if (entity instanceof PlayerEntity) {
			((PlayerEntity) entity).addExperience(1 << amplifier); // Higher amplifier gives you experience faster

Registering Your Custom Effect

Similar to block and item registration, we use Registry.register to register our custom effect into the STATUS_EFFECT registry. This can be done in our initializer.

public class FabricDocsReferenceEffects implements ModInitializer {
	public static final StatusEffect TATER_EFFECT = new TaterEffect();

	public void onInitialize() {
		Registry.register(Registries.STATUS_EFFECT, new Identifier("fabric-docs-reference", "tater"), TATER_EFFECT);

Translations and Textures

You can assign a name to your status effect and provide a texture icon that will appear in the player inventory screen.


The status effect icon is a 18x18 PNG. Place your custom icon in:


Effect in player inventory


Like any other translation, you can add an entry with ID format "effect.<mod-id>.<effect-identifier>": "Value" to the language file.

  "effect.fabric-docs-reference.tater": "Tater"


Use the command /effect give @p fabric-docs-reference:tater to give the player our Tater effect. Use /effect clear @p fabric-docs-reference:tater to remove the effect.


To create a potion that uses this effect, please see the Potions guide.