-
Notifications
You must be signed in to change notification settings - Fork 0
Animal Genetics and Trait Inheritance
Rifaditya edited this page Aug 9, 2026
·
1 revision
| Trait Key | Target Attribute | Modifier Operation | Default Base | Min Bound | Max Bound | Mutation Rule |
|---|---|---|---|---|---|---|
scale |
minecraft:generic.scale |
ADD_VALUE |
0.0f |
0.75f |
1.30f |
uniform(0.75f, 1.30f) |
movement_speed |
minecraft:generic.movement_speed |
ADD_MULTIPLIED_BASE |
0.0f |
-0.04f |
0.08f |
uniform(-0.04f, 0.08f) |
attack_damage |
minecraft:generic.attack_damage |
ADD_VALUE |
0.0f |
1.0f |
4.0f |
uniform(1.0f, 4.0f) |
Better Bats registers custom genetic traits for EntityTypes.BAT inside BetterBatsFabric.java using EntityGeneticsRegistry.register:
EntityGeneticsRegistry.register(
EntityTypes.BAT,
new GeneticsConfig(
Map.of(
"scale", new TraitConfig(
"scale", "minecraft:generic.scale", "ADD_VALUE", 0.0f, 1.0f, 0.75f, 1.30f
),
"movement_speed", new TraitConfig(
"movement_speed", "minecraft:generic.movement_speed", "ADD_MULTIPLIED_BASE", 0.0f, 1.0f, -0.04f, 0.08f
),
"attack_damage", new TraitConfig(
"attack_damage", "minecraft:generic.attack_damage", "ADD_VALUE", 0.0f, 1.0f, 1.0f, 4.0f
)
),
Map.of(
"default", Map.of(
"scale", new MutationRule("uniform", 0.75f, 1.30f),
"movement_speed", new MutationRule("uniform", -0.04f, 0.08f),
"attack_damage", new MutationRule("uniform", 1.0f, 4.0f)
)
)
)
);-
Scale / Wingspan (
scale):- Directly scales the physical model rendering size and collision bounding box of the bat.
- Range:
$0.75\times$ (dwarf micro-bat) to$1.30\times$ (giant megabat / flying fox).
-
Movement Speed (
movement_speed):- Modifies base flight locomotion velocity by
$-4%$ up to$+8%$ .
- Modifies base flight locomotion velocity by
-
Attack Damage (
attack_damage):- Multiplies predatory dive-bomb damage against Silverfish and Endermites:
$$\text{Pest Damage} = 10.0 \times \text{attack_damage_trait}$$
- Multiplies predatory dive-bomb damage against Silverfish and Endermites:
When a bat ticks for the first time without genetics (!DasikAnimalGeneticsAPI.hasGenetics(self)), BatMixin.betterbats$onCustomServerAiStep automatically rolls its genetic profile and applies attribute modifiers:
if (!DasikAnimalGeneticsAPI.hasGenetics(self)) {
DasikAnimalGeneticsAPI.rollStats(self, "better-bats:bat");
GeneticsEngine.applyGeneticsModifiers(self);
}Genetics data is stored safely in vanilla entity NBT compound tags (EntityGenetics), ensuring total uninstallation safety without corrupting world saves.
Better Bats Wiki • Copyright © 2026 Dasik (Rifaditya) • Licensed under GNU GPLv3
📌 The documentation in this Wiki reflects the current source code state in the repository.
- Bat Ecology & Photophobia
- 3D BOIDs Flocking & Math
- Guano Crop Fertilization
- Phototaxis & Light Orbiting
- Pest Control Combat
- Echolocation & Panic
- Chiroptera Genetics
- Dynamic GameRules
- Ambient Spawning Rules
- HUD & Client GUI Config
- Commands & Advancements
- Sounds & Particle Effects
- Troubleshooting & FAQ