Minecraft Mod – „Mutation World“
Erstelle eine Minecraft-Mod für Minecraft 26.2 mit Fabric. Die Mod sorgt dafür, dass sich die Welt dynamisch an das Verhalten des Spielers anpasst.
Hauptsystem
Die Mod analysiert wichtige Aktionen des Spielers und besitzt einen globalen Adaptions-Level von 0–100.
Beispiele:
* Viele Blöcke abbauen → entsprechende Welt-Effekte * Viele Mobs töten → stärkere oder veränderte Mobs * Viele Ressourcen sammeln → schwierigere Ereignisse * Lange an einem Ort bleiben → besondere Ereignisse * Unterschiedliche Spielweisen sollen unterschiedliche Reaktionen auslösen.
Mutationen
Ab bestimmten Adaptions-Stufen werden neue Mutationen freigeschaltet. Diese werden zufällig, aber passend zum Verhalten des Spielers ausgewählt.
Mögliche Mutationen:
* neue Mob-Varianten * veränderte Mob-Eigenschaften * besondere Welt-Events * neue Strukturen * veränderte Umgebung * neue Gefahren
Die Schwierigkeit soll schrittweise steigen und niemals plötzlich unfair werden.
Anzeige
Zeige dauerhaft eine übersichtliche Anzeige:
WORLD ADAPTATION: XX/100
Wenn eine neue Mutation aktiviert wird, soll kurz eine deutliche Meldung erscheinen.
Speicherung
Der Adaptions-Level und alle freigeschalteten Mutationen müssen dauerhaft gespeichert werden und nach einem Welt- oder Spielneustart erhalten bleiben.
Wichtig
Die normale Minecraft-Weltgenerierung soll grundsätzlich erhalten bleiben. Die Mod muss performant sein und darf nicht dauerhaft die gesamte Welt scannen.
Ich erstelle die Mod als eigenständiges Fabric-26.2-Projekt mit zentralem Adaptionsspeicher, ereignisbasierter Auswertung, schrittweise freigeschalteten Mutationen, dauerhafter HUD-Anzeige und serverseitiger Persistenz.
Projektbasis: Gradle/Loom, Fabric-Metadaten und Java-25-Quellstruktur anlegen.
Adaptionssystem: globalen
SavedData-Speicher mit Fortschritt, Zählern, Mutation-Auswahl und Weltneustart-Persistenz implementieren.Verhalten: Blockabbau, Mob-Kills, stationäres Spielen und geladene Mobs ereignisbasiert auswerten; schrittweise Effekte anwenden.
Anzeige/Synchronisation: Server-zu-Client-Payload, permanente HUD-Anzeige und Aktivierungsmeldungen hinzufügen.
Übersetzungen und Mixins-Konfiguration ergänzen.
Erstellt wurde das vollständige Fabric-26.2-Projekt „Mutation World“:
Globaler Adaptions-Level von 0–100 mit dauerhaftem
SavedData-Speicher.Auswertung von:
abgebauten Blöcken,
getöteten Mobs,
längerem Aufenthalt an einem Ort.
Zufällige, verhaltensabhängige Mutationsauswahl bei den Stufen 20, 40, 60, 80 und 100.
Schrittweise Mob-Veränderungen und Welt-Effekte ohne vollständige Welt-Scans.
Serverseitige Speicherung im Overworld-Datenspeicher.
Synchronisation des Levels zum Client per Custom-Payload.
Permanente HUD-Anzeige:
WORLD ADAPTATION: XX/100Deutliche Meldung beim Freischalten einer Mutation.
Java 25, Fabric Loader 0.19.3, Fabric API 0.158.0+26.2 und offizielles 26.2-Namensschema.
The compilation failed with this error:
Compilation failed with 24 error(s):
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 7: cannot find symbol
import net.fabricmc.fabric.api.entity.event.v1.ServerEntityEvents;
^
symbol: class ServerEntityEvents
location: package net.fabricmc.fabric.api.entity.event.v1
ERROR in src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java at line 7: cannot find symbol
import net.fabricmc.fabric.api.client.rendering.v1.HudElementRegistry;
^
symbol: class HudElementRegistry
location: package net.fabricmc.fabric.api.client.rendering.v1
ERROR in src/main/java/com/kodari/mutationworld/AdaptationState.java at line 126: cannot find symbol
player.displayClientMessage(message, true);
^
symbol: method displayClientMessage(Component,boolean)
location: variable player of type ServerPlayer
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 42: incompatible types: incompatible parameter types in lambda expression
ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.register((world, entity, killed) -> {
^
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 44: server has private access in ServerPlayer
AdaptationState.get(player.server).recordMobKill(player.server);
^
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 44: server has private access in ServerPlayer
AdaptationState.get(player.server).recordMobKill(player.server);
^
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 52: package ServerEntityEvents does not exist
ServerEntityEvents.ENTITY_LOAD.register((entity, world) -> {
^
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 58: cannot find symbol
monster.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 20 * 60, 0, false, false));
^
symbol: variable MOVEMENT_SPEED
location: class MobEffects
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 61: cannot find symbol
monster.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 20 * 60, 1, false, false));
^
symbol: variable MOVEMENT_SPEED
location: class MobEffects
ERROR in src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java at line 19: cannot find symbol
HudElementRegistry.addLast(Identifier.fromNamespaceAndPath(MutationWorld.MOD_ID, "adaptation_hud"),
^
symbol: variable HudElementRegistry
location: class MutationWorldClient
ERROR in src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java at line 25: cannot find symbol
if (client.player == null || client.options.hideGui) {
^
symbol: variable hideGui
location: variable options of type Options
ERROR in src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java at line 31: cannot find symbol
graphics.drawString(client.font,
^
symbol: method drawString(Font,MutableComponent,int,int,int,boolean)
location: variable graphics of type GuiGraphicsExtractor
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 42: incompatible types: incompatible parameter types in lambda expression
ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.register((world, entity, killed) -> {
^
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 7: cannot find symbol
import net.fabricmc.fabric.api.entity.event.v1.ServerEntityEvents;
^
symbol: class ServerEntityEvents
location: package net.fabricmc.fabric.api.entity.event.v1
ERROR in src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java at line 7: cannot find symbol
import net.fabricmc.fabric.api.client.rendering.v1.HudElementRegistry;
^
symbol: class HudElementRegistry
location: package net.fabricmc.fabric.api.client.rendering.v1
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 58: cannot find symbol
monster.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 20 * 60, 0, false, false));
^
symbol: variable MOVEMENT_SPEED
location: class MobEffects
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 61: cannot find symbol
monster.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 20 * 60, 1, false, false));
^
symbol: variable MOVEMENT_SPEED
location: class MobEffects
ERROR in src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java at line 19: cannot find symbol
HudElementRegistry.addLast(Identifier.fromNamespaceAndPath(MutationWorld.MOD_ID, "adaptation_hud"),
^
symbol: variable HudElementRegistry
location: class MutationWorldClient
ERROR in src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java at line 25: cannot find symbol
if (client.player == null || client.options.hideGui) {
^
symbol: variable hideGui
location: variable options of type Options
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 44: server has private access in ServerPlayer
AdaptationState.get(player.server).recordMobKill(player.server);
^
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 44: server has private access in ServerPlayer
AdaptationState.get(player.server).recordMobKill(player.server);
^
ERROR in src/main/java/com/kodari/mutationworld/AdaptationEvents.java at line 52: package ServerEntityEvents does not exist
ServerEntityEvents.ENTITY_LOAD.register((entity, world) -> {
^
ERROR in src/main/java/com/kodari/mutationworld/AdaptationState.java at line 126: cannot find symbol
player.displayClientMessage(message, true);
^
symbol: method displayClientMessage(Component,boolean)
location: variable player of type ServerPlayer
ERROR in src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java at line 31: cannot find symbol
graphics.drawString(client.font,
^
symbol: method drawString(Font,MutableComponent,int,int,int,boolean)
location: variable graphics of type GuiGraphicsExtractor
=== COMPILATION ERROR ANALYSIS ===
MISSING CLASSES:
- ServerEntityEvents
- HudElementRegistry
ACTION: Create these classes or check imports
MISSING METHODS:
- displayClientMessage(Component,boolean)
- drawString(Font,MutableComponent,int,int,int,boolean)
ACTION: Check method names and signatures
TYPE MISMATCHES:
- incompatible types: incompatible parameter types in lambda expression
- incompatible types: incompatible parameter types in lambda expression
ACTION: Fix variable types or casting
FILES TO INVESTIGATE:
- src/main/java/com/kodari/mutationworld/AdaptationEvents.java
- src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java
- src/main/java/com/kodari/mutationworld/AdaptationState.java
- src/main/java/com/kodari/mutationworld/AdaptationEvents.java
- src/main/java/client/java/com/kodari/mutationworld/client/MutationWorldClient.java
- src/main/java/com/kodari/mutationworld/AdaptationState.java
Please fix this error by creating a new artifact with the corrected code.
Event-APIs: korrigiere die Pakete und die 26.2-Signatur von
AFTER_KILLED_OTHER_ENTITY.Server-Nachrichten: ersetze den entfernten Actionbar-Aufruf durch die aktuelle
ServerPlayer-Methode.HUD: verwende das neue
hud-Package,GuiGraphicsExtractor.text(...)und keine entferntehideGui-Option.
Fixed the compilation errors in the corrected artifact:
Moved
ServerEntityEventsimport tonet.fabricmc.fabric.api.event.lifecycle.v1.Updated
AFTER_KILLED_OTHER_ENTITYto the 26.2 four-parameter callback.Replaced private
player.serveraccess withworld.getServer().Replaced
MobEffects.MOVEMENT_SPEEDwithMobEffects.SPEED.Replaced removed
displayClientMessage(...)withsendSystemMessage(message, true).Updated HUD import to
net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry.Removed the unavailable
client.options.hideGuifield.Replaced the removed
drawString(...)call withGuiGraphicsExtractor.text(...).
package com.kodari.mutationworld;
import net.fabricmc.api.ModInitializer;
public final class MutationWorld implements ModInitializer {
public static final String MOD_ID = "mutationworld";
@Override
public void onInitialize() {
AdaptationNetworking.initialize();
AdaptationEvents.initialize();
}
}