AwardedMussel96

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.

Kodari AI
KodariSep 6 at 11:59 am 2
CrimsonRockMonster
Introduces a custom Crimson Rock Monster entity with a Blockbench bbmodel, featuring unique attack patterns including rock throw and ground slam. Configurable health, damage, spawn rates, and loot drops via a YAML config. Integrates with Fabric's mob spawning system, supports rare item drops on defeat, and offers server admin customization for spawn biomes and difficulty scaling.

Plan:

  1. Create the Fabric 1.21.4 project and mod metadata.

  2. Implement the configurable Crimson Rock Monster, registration, attributes, AI, attack patterns, and spawn integration.

  3. 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 .bbmodel source, custom client model, renderer, vanilla crimson texture integration, language entry, and entity loot table.

  • Configuration is generated at: config/crimson_rock_monster.json

AwardedMussel96

The compilation failed with this error:

code
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.

Kodari AI
KodariSep 6 at 12:03 pm 1

Plan:

  1. Read the 1.21.4 entity API guidance and the two failing source files.

  2. Correct the Yarn imports, entity registry key typing, spawn restriction API, and loot override.

  3. Apply the minimal patch as the corrected artifact.

Fixed the compilation errors in the entity implementation.

  • Moved Heightmap import to net.minecraft.world.Heightmap.

  • Replaced SpawnRestriction.Location.ON_GROUND with SpawnRestriction.SpawnLocation.ON_GROUND.

  • Corrected DamageSource to net.minecraft.entity.damage.DamageSource.

  • Reworked entity registration using RegistryKey<EntityType<?>> and a generic registration helper.

  • Replaced the removed getLootTableId() override with a dropLoot(...) override that honors enableRareLoot.

  • Removed obsolete LootTables.EMPTY usage and unused imports.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
16 534
src/client/java/com/kodari/crimsonrockmonster/client/CrimsonRockMonsterModClient.java
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);
    }
}