Develop a Minecraft plugin that introduces a Crimson Rock Monster using a Blockbench bbmodel, featuring unique attack patterns and behaviors. The monster should have customizable health, damage output, and spawn rates, along with an optional loot drop system for rare items upon defeat. Include integration with existing mob systems and configurable settings for server administrators.
Plan:
Create the Fabric 1.21.4 project and mod metadata.
Implement the configurable Crimson Rock Monster, registration, attributes, AI, attack patterns, and spawn integration.
Add the Blockbench model asset, client renderer/model, loot table, defaults, and language entries.
Created a complete Fabric 1.21.4 Crimson Rock Monster mod.
Added Gradle project configuration for Minecraft 1.21.4, Fabric Loader 0.16.9, Fabric API, Yarn mappings, and Java 21.
Implemented configurable health, damage, movement, special attack cooldown, spawn weight, group sizes, and rare loot settings.
Added hostile AI with melee attacks, ground slams, alternating rock bursts, targeting, wandering, and revenge behavior.
Registered natural overworld spawning with configurable spawn rates and spawn restrictions.
Added Blockbench
.bbmodelsource, custom client model, renderer, vanilla crimson texture integration, language entry, and entity loot table.Configuration is generated at:
config/crimson_rock_monster.json
The compilation failed with this error:
Compilation failed with 16 error(s):
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 18: cannot find symbol
import net.minecraft.util.math.Heightmap;
^
symbol: class Heightmap
location: package net.minecraft.util.math
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/CrimsonRockMonsterEntity.java at line 24: package net.minecraft.world.damage does not exist
import net.minecraft.world.damage.DamageSource;
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 24: incompatible types: inference variable T has incompatible equality constraints EntityType<CrimsonRockMonsterEntity>,EntityType<?>
RegistryKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(CrimsonRockMonsterMod.MOD_ID, "crimson_rock_monster"));
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 31: incompatible types: RegistryKey<EntityType<CrimsonRockMonsterEntity>> cannot be converted to RegistryKey<EntityType<?>>
.build(CRIMSON_ROCK_MONSTER_KEY)
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 42: cannot find symbol
SpawnRestriction.Location.ON_GROUND,
^
symbol: variable Location
location: class SpawnRestriction
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 43: package Heightmap does not exist
Heightmap.Type.MOTION_BLOCKING_NO_LEAVES,
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/CrimsonRockMonsterEntity.java at line 97: method does not override or implement a method from a supertype
@Override
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/CrimsonRockMonsterEntity.java at line 101: cannot find symbol
: LootTables.EMPTY;
^
symbol: variable EMPTY
location: class LootTables
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 24: incompatible types: inference variable T has incompatible equality constraints EntityType<CrimsonRockMonsterEntity>,EntityType<?>
RegistryKey.of(RegistryKeys.ENTITY_TYPE, Identifier.of(CrimsonRockMonsterMod.MOD_ID, "crimson_rock_monster"));
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 31: incompatible types: RegistryKey<EntityType<CrimsonRockMonsterEntity>> cannot be converted to RegistryKey<EntityType<?>>
.build(CRIMSON_ROCK_MONSTER_KEY)
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 18: cannot find symbol
import net.minecraft.util.math.Heightmap;
^
symbol: class Heightmap
location: package net.minecraft.util.math
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 42: cannot find symbol
SpawnRestriction.Location.ON_GROUND,
^
symbol: variable Location
location: class SpawnRestriction
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/CrimsonRockMonsterEntity.java at line 101: cannot find symbol
: LootTables.EMPTY;
^
symbol: variable EMPTY
location: class LootTables
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/CrimsonRockMonsterEntity.java at line 97: method does not override or implement a method from a supertype
@Override
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/CrimsonRockMonsterEntity.java at line 24: package net.minecraft.world.damage does not exist
import net.minecraft.world.damage.DamageSource;
^
ERROR in src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java at line 43: package Heightmap does not exist
Heightmap.Type.MOTION_BLOCKING_NO_LEAVES,
^
=== COMPILATION ERROR ANALYSIS ===
MISSING CLASSES:
- Heightmap
ACTION: Create these classes or check imports
TYPE MISMATCHES:
- incompatible types: inference variable T has incompatible equality constraints EntityType<CrimsonRockMonsterEntity>,EntityType<?>
- incompatible types: RegistryKey<EntityType<CrimsonRockMonsterEntity>> cannot be converted to RegistryKey<EntityType<?>>
- incompatible types: inference variable T has incompatible equality constraints EntityType<CrimsonRockMonsterEntity>,EntityType<?>
- incompatible types: RegistryKey<EntityType<CrimsonRockMonsterEntity>> cannot be converted to RegistryKey<EntityType<?>>
ACTION: Fix variable types or casting
FILES TO INVESTIGATE:
- src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java
- src/main/java/com/kodari/crimsonrockmonster/entity/CrimsonRockMonsterEntity.java
- src/main/java/com/kodari/crimsonrockmonster/entity/ModEntities.java
- src/main/java/com/kodari/crimsonrockmonster/entity/CrimsonRockMonsterEntity.java
Please fix this error by creating a new artifact with the corrected code.
Plan:
Read the 1.21.4 entity API guidance and the two failing source files.
Correct the Yarn imports, entity registry key typing, spawn restriction API, and loot override.
Apply the minimal patch as the corrected artifact.
Fixed the compilation errors in the entity implementation.
Moved
Heightmapimport tonet.minecraft.world.Heightmap.Replaced
SpawnRestriction.Location.ON_GROUNDwithSpawnRestriction.SpawnLocation.ON_GROUND.Corrected
DamageSourcetonet.minecraft.entity.damage.DamageSource.Reworked entity registration using
RegistryKey<EntityType<?>>and a generic registration helper.Replaced the removed
getLootTableId()override with adropLoot(...)override that honorsenableRareLoot.Removed obsolete
LootTables.EMPTYusage and unused imports.
package com.kodari.crimsonrockmonster.client;
import com.kodari.crimsonrockmonster.entity.ModEntities;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
public final class CrimsonRockMonsterModClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
EntityModelLayerRegistry.registerModelLayer(ModModelLayers.CRIMSON_ROCK_MONSTER, CrimsonRockMonsterModel::getTexturedModelData);
EntityRendererRegistry.register(ModEntities.CRIMSON_ROCK_MONSTER, CrimsonRockMonsterRenderer::new);
}
}