LineageCore is a mod I made specifically to create Species that work with all kinds of things.
Whether you want to use Java or purely JSON, you can make a species with either.
Here's some basic guides in the form of an example json file that you should put into ".minecraft/lineages/template.json" or ".minecraft/lineages/template/template.json"
NOTE: The artDirectory searches ONLY in the lineages folder, nowhere else.
{
"displayName": "Example Species",
"speciesDescription": "A versatile custom lineage created via JSON. Grants speed and basic survival gear upon selection.",
"speciesID": "example_species",
"order": 10,
"hasSubspecies": false,
"isSubspeciesOf": "human",
"locksOnSelect": true,
"artDirectory": "textures/example_species_art.png",
"onSelect": {
"type": "command",
"command": [
"/give @s minecraft:iron_sword 1",
"/effect give @s minecraft:speed 9999 0 true"
]
}
}
Java Code Example:
NEOFORGE BELOW
//How a Human is registered in NeoForge 1.21.1
public static final DeferredHolder<Species, Species> HUMAN = SPECIES.register(
"human",
() -> new Species(
"Human",
"All-Rounder Species, your Classic Minecraft Experience.",
"human",
true,
player -> {},
null,
Integer.MIN_VALUE
)
);
//How a Normal Human is registered in NeoForge 1.21.1
public static final DeferredHolder<Species, Species> NORMAL_HUMAN = SPECIES.register(
"normal_human",
() -> new Species(
"Normal Human",
"All-Rounder Species, your Classic Minecraft Experience.",
"normal_human_sub",
false,
player -> {},
null,
Integer.MIN_VALUE
)
);
// Brand New LOCKED Species feature, where if it gets selected it gets locked for everyone else until they are forced to choose another species
public static final DeferredHolder<Species, Species> TEMP_LINEAGE = SPECIES.register(
"temp_lineage",
() -> new Species(
"Temp Lineage",
"A temporary species designed for testing lineage selection and locking mechanics.",
"temp_lineage",
false,
player -> {
player.sendSystemMessage(Component.literal("§aYou have selected the Temp Lineage!"));
player.addEffect(new MobEffectInstance(MobEffects.NIGHT_VISION, 6000, 0, false, false));
},
null,
1,
true
)
);
FORGE BELOW
public static final RegistryObject<Species> ELF = SPECIES.register(
"elf",
() -> new Species(
"Elf",
"Agile archers attuned with nature.",
"elf",
true,
player -> {
// Example 1: Add potion effects directly
player.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 999999, 0, false, false));
// Example 2: Give an item directly
player.getInventory().add(new ItemStack(Items.BOW));
// Example 3: Send a message or play a sound
player.sendSystemMessage(Component.literal("You have attuned with nature!"));
},
null,
-1
)
);