
Cobblemon:Crzbrain
CRZbrain is a Kotlin-based Fabric mod for Minecraft/Cobblemon that gives Pokemon an AI-powered brain featuring reinforcement learning, sentiment analysis, cross-trainer knowledge sharing, and adaptive response generation to make Pokemon interaction
Tags
Creators
Details
2.1.0
Compatibility
Changes
v3.6: Defense System Disabled + Per-Pokemon Tick Optimization
Part A — PokemonDefenseSystem Disabled
- Removed PokemonDefenseSystem.register() from CRZbrainMod — no more tick handler (entity search every 1s for ALL Pokemon) and no damage listener
- Removed all PDS calls from PokemonCommandSystem — executeProtect(), executeActiveDefense(), executeAggressiveMode(), executeGuardMode(), executeStandDown() no longer call PokemonDefenseSystem
- Simplified updateDefendingState() — removed findHostilesNearPlayer() entity search, now just follows player (teleport if distance > 5.0)
- Simplified updateProtectingState() — removed findHostilesNearPlayer() entity search, now just stays near player (teleport if distance > 3.0)
- Disabled defense commands in Commands.kt — setDefenseMode(), showDefenseStatus(), showAllDefenseStatus(), activatePvPMode() all return "Sistema difesa disabilitato (v3.6)"
- Removed PDS.resetPokemon() from PokemonLifecycleManager
- Removed unused imports — PokemonDefenseSystem import removed from CRZbrainMod, Commands, PokemonCommandSystem, PokemonLifecycleManager
Part B — TickOptimizationSystem (New Unified Tick Dispatcher)
- Created sensors/TickOptimizationSystem.kt — single ServerTickEvents.END_SERVER_TICK handler replaces 3 separate handlers
- Strategy 1 — Temporal Staggering: Pokemon split into 2 groups via uuid.hashCode() % 2, updated on alternating ticks (halves peak load per tick)
- Strategy 2 — Distance-Based LOD: Pokemon >16 blocks from trainer (squaredDistanceTo > 256) skip every other update cycle (recalculated every 20 ticks)
- Strategy 3 — Frequency Reduction: Combat states stay at 10-tick interval, non-combat states (FOLLOWING, EXPLORING, DEFENDING, PROTECTING) doubled to 20 ticks; WorldEventSystem interval doubled from 600 to 1200 ticks (30s → 60s)
- Strategy 4 — Intelligent Batching: getActivePokemon() cached per player with 10-tick TTL (was called ~28 times per cycle, now 1); single player iteration loop instead of 3 separate loops
- Removed tick handler from PokemonCommandSystem — exposed updateSinglePokemon() public method, removed lastUpdateTick and UPDATE_INTERVAL
- Removed tick handler from WorldEventSystem — renamed checkWorldEvents() to checkWorldEventsForPlayer() and made it public, removed lastCheckTick and CHECK_INTERVAL_TICKS
- Removed tick handler from PokemonRelationshipSystem — added tickForPlayer() public method, removed lastInteractionTick and INTERACTION_COOLDOWN_TICKS
- Cache invalidation hooks — TickOptimizationSystem.invalidateCache() called on POKEMON_SENT_POST and DISCONNECT events; cleanup() called on SERVER_STOPPING
- handleSpontaneousDialogue() uses cached Pokemon list instead of calling PokemonUtils.hasActivePokemon() directly
- Removed unused imports — ServerTickEvents removed from WorldEventSystem, PokemonRelationshipSystem; HostileEntity/AnimalEntity/PlayerEntity removed from PokemonCommandSystem
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:JbNzzoj3:VASBqTJI"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:JbNzzoj3:VASBqTJI"
}
