-
Notifications
You must be signed in to change notification settings - Fork 0
Genetics Loot Modifiers
Rifa edited this page Aug 9, 2026
·
1 revision
| Component | Class |
|---|---|
| Modifier Interface | net.dasik.social.api.genetics.GeneticsLootModifier |
| Registry Class | net.dasik.social.api.genetics.GeneticsLootRegistry |
| Mixin Hook Class | net.dasik.social.mixin.LivingEntityLootMixin |
| Target Method | LivingEntity.dropFromLootTable |
GeneticsLootRegistry allows mods to dynamically modify mob loot drops based on entity genetics (e.g., giant animals dropping extra meat, runts dropping less loot, or mutated variants dropping special items).
[ LivingEntity.dropFromLootTable ]
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LivingEntityLootMixin โ โโโ @ModifyVariable Consumer Hook
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GeneticsLootRegistry โ โโโ Lookup Modifier for EntityType
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GeneticsLootModifier โ โโโ Scale stack count / Swap item
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Registering a loot modifier for wolves based on physical scale:
GeneticsLootRegistry.register(EntityTypes.WOLF, (entity, genetics, stack, random) -> {
float scale = DasikAnimalGeneticsAPI.getScale(entity);
if (stack.is(Items.BONE)) {
// Scale bone drop count proportionally to entity scale
int newCount = Math.max(1, Math.round(stack.getCount() * scale));
return new ItemStack(Items.BONE, newCount);
}
return stack;
});
Dasik Library | Social AI & Infrastructure Engine
Developed with โค๏ธ by Dasik (Rifaditya) | Licensed under LGPL-3.0
๐ Documentation reflects active repository source code state.
- Hive Mind Social System
- Social Scheduler & Events
- Animal Genetics Engine
- Genetics API & Pedigree
- Genetics Loot Modifiers
- Leader Follower & Flocking
- Dynamic GameRules Manager
- GameRule Codec & Serialization
- Client GameRule & GUI Helpers
- Dynamic Enchantments & Vision
- Stochastic & Math Utilities
- Stale Attribute Purging & Scale
- ModVersionGuard & Startup Safety
- Developer Setup & Building
- Architecture & Package Layout
- Mixin Reference & Hooks
- Behavior Profiles & Conditions
- Consumer Mods Integration Guide