Skip to content

Architecture & Mixin Injection Points

Home / Architecture & Mixins


🏗️ Architecture & Package Layout

Vanilla Outsider: Better Dogs strictly adheres to the 1 File, 1 Function Law. Code logic is decoupled into specialized packages under net.vanillaoutsider.betterdogs:

net.vanillaoutsider.betterdogs
├── BetterDogs.java               # Main entrypoint & GameRules initialization
├── WolfExtensions.java           # Extension interface for wolf persistent state
├── WolfPersistentData.java       # NBT/Codec data container for personality & scale
├── WolfPersonality.java          # Personality enum (NORMAL, AGGRESSIVE, PACIFIST)
├── ai                            # AI Goal implementations (30 specialized goals)
│   ├── AggressiveTargetGoal.java
│   ├── PersonalityFollowOwnerGoal.java
│   ├── WolfGuardGoal.java
│   ├── WolfFlankAttackGoal.java
│   ├── WildWolfTerritorialGoal.java
│   ├── WolfStormAnxietyGoal.java
│   └── ...
├── command                       # Brigadier command registration
│   └── BetterDogsCommand.java
├── config                        # Configuration screens & YACL v3 integration
├── mixin                         # Java Mixin injection suite (25 mixins)
└── util                          # Math, raycasting, and thread-safe looper utilities

💉 Complete Mixin Target Reference Table (25 Mixins)

The mod injects non-intrusive hooks into vanilla Minecraft classes to expand wolf behaviors without breaking compatibility:

Mixin ClassTarget Minecraft ClassInjection Point / Purpose
AnimalMixinnet.minecraft.world.entity.animal.AnimalIntercepts animal breeding rules for litter size scaling.
BreedGoalMixinnet.minecraft.world.entity.ai.goal.BreedGoalHooks breeding completion to process personality genetics inheritance.
EntityMixinnet.minecraft.world.entity.EntityIntercepts bounding box recalculation for custom physical scale rendering.
HurtByTargetGoalMixinnet.minecraft.world.entity.ai.goal.target.HurtByTargetGoalFilters retaliation targets based on friendly fire protection rules.
InstrumentItemMixinnet.minecraft.item.InstrumentItemIntercepts goat horn usage to broadcast tactical commands to owned wolves.
NaturalSpawnerMixinnet.minecraft.world.level.NaturalSpawnerHooks natural spawning weights for bd_wolf_spawn_multiplier_percent.
OwnerHurtByTargetGoalMixinnet.minecraft.world.entity.ai.goal.target.OwnerHurtByTargetGoalAdjusts owner defense targeting for Pacifist and Aggressive traits.
OwnerHurtTargetGoalMixinnet.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoalModifies attack target priorities based on wolf personality.
ServerLevelMixinnet.minecraft.server.level.ServerLevelHandles level tick listeners for pack howl schedules and storm anxiety.
ServerPlayerMixinnet.minecraft.server.level.ServerPlayerSyncs wolf selection and vehicle boarding commands across network.
ServerPlayerTickMixinnet.minecraft.server.level.ServerPlayerManages fast-travel catch-up safety teleportation for owned wolves.
TamableAnimalMixinnet.minecraft.world.entity.TamableAnimalExtends tamed entity follow distance ranges and owner teleport logic.
WalkNodeEvaluatorMixinnet.minecraft.world.level.pathfinder.WalkNodeEvaluatorImplements cliff safety path evaluation (bd_cliff_safety).
WolfAIMixinnet.minecraft.world.entity.animal.WolfRegisters custom AI goals into the wolf goal selector hierarchy.
WolfAccessornet.minecraft.world.entity.animal.WolfAccessor interface exposing protected wolf sound and animation triggers.
WolfBreedingMixinnet.minecraft.world.entity.animal.WolfIntercepts wolf feeding and breeding interactions.
WolfCombatMixinnet.minecraft.world.entity.animal.WolfApplies damage, knockback, and sprint speed modifiers during combat.
WolfGroupMixinnet.minecraft.world.entity.animal.WolfManages wild pack cluster formation and leader assignment.
WolfGuardMixinnet.minecraft.world.entity.animal.WolfControls Guard Mode state transitions and sentinel patrol anchors.
WolfInteractMixinnet.minecraft.world.entity.animal.WolfHandles Shift+Right-Click interaction triggers (Guard Mode, Adoption).
WolfMixinnet.minecraft.world.entity.animal.WolfCore mixin attaching WolfExtensions persistent data container.
WolfMobMixinnet.minecraft.world.entity.MobModifies mob navigation pathfinding parameters for pack flanking.
WolfSafetyMixinnet.minecraft.world.entity.animal.WolfPrevents accidental friendly fire damage from owner sweeping attacks.
WolfSocialMixinnet.minecraft.world.entity.animal.WolfImplements territorial rivalry, pack wars, and group howl triggers.
WolfSpawnMixinnet.minecraft.world.entity.animal.WolfAssigns random personality traits and scale factors upon initial spawn.

TIP

Surgical Mixin architecture with zero overwrite baggage: By injecting non-intrusively into vanilla AI goal selectors and bounding box calculations, Better Dogs preserves flawless compatibility with other mob overhaul mods. If you appreciate clean bytecode engineering, considering supporting my work on Ko-fi!


⚡ Thread Safety & Performance Constraints

  • Non-Blocking Loopers: All spatial scans (such as pack leader detection and creeper raycasting) execute asynchronously or are throttled via interval tick gates, preventing main-thread server lag spikes.
  • Single-Function Cohesion: Each AI goal (e.g. WolfFlankAttackGoal, WolfGuardGoal) handles strictly one behavioral responsibility, prioritizing clean execution paths over monolithic loop structures.

Back to Home

Official documentation & web portal for Dasik Igaijinn mods.