Skip to content
Jab125 edited this page Apr 8, 2026 · 4 revisions

Information for everyone

Summoning Command

Summoning foxes can be now done with a string value as the "variant" nbt.

This is similar to the namespace system minecraft uses almost anywhere else but doesn't for some entity variants included the fox's.

For example this would be how to summon the vanilla lucy variant:

/summon minecraft:fox ~ ~ ~ {variant:"minecraft:red"}

Item components

Use mfvapi:fox/variant over minecraft:fox/variant. minecraft:fox/variant only works with vanilla variants and isn't namespaced.

 

Information for Modders

The recommended way of creating new variants is to use the datapack method. If you need to interact with foxes in Java code, see § Java API;

Importing the API

Currently importing can only be done by importing the mod jar via gradle.

Adding a new variant

Fox variants can be defined in data packs, as part of the directory structure below.

data pack name.zip or data pack name
pack.mcmeta
data
        namespace
              mfvapi
                    fox_variant
                          <name>.json

Fox variants are defined using the following format:

The root object.
assets: The assets to use for this variant:
awake: The resource location of the texture to use when the fox is awake.
sleeping: The resource location of the texture to use when the fox is asleep.
baby_assets: The assets to use for the baby of this variant:
awake: The resource location of the texture to use when the fox is awake.
sleeping: The resource location of the texture to use when the fox is asleep.
spawn_conditions: The spawn conditions of this variant, see Mob variant definitions § Spawn condition.

In addition, you can make foxes spawn in more biomes by adding them to the mfvapi:fox_spawn biome tag.

Java API

Fox variants now use FoxVariant instead of the hardcoded Fox.Variant enum. You can get and set the variant of a fox in the FoxVariants class.
It is recommended for you to make a class containing all the variants your mod adds.

public class ModFoxVariants {
	public static final ResourceKey<FoxVariant> CHEESE = createKey("cheese");

	private static ResourceKey<FoxVariant> createKey(String name) {
		return ResourceKey.create(MfvApiRegistries.FOX_VARIANT, MoreCheese.id(name));
	}
}

To check if a fox is your variant:

FoxVariants.getVariant(fox).is(ModFoxVariants.CHEESE)

Don't use anything inside the implementation packages unless you understand that it could suddenly stop working.

Clone this wiki locally