draconicproductions

A mod that adds special spiders based on Minecraft ores that are hostile but can be tamed with the materials they represent, at which point they will become docile and produce string on the ground that can be used to craft the expensive ingredients. However, they will not fight for the player and will only follow them if they have the material they used to tame the spider in their hand.

Kodari AI
KodariApr 12 at 2:51 am 82,011 (v2)
OreSilkSpiders
Adds six ore-themed spider mobs (Coal, Iron, Gold, Diamond, Emerald, Netherite) that roam the world as hostile creatures. Each spider can be tamed by right-clicking with its corresponding ore material, after which it becomes docile and periodically drops a unique Ore Silk on the ground. Tamed spiders will follow their owner only when the matching material is held. Ore Silks can be crafted into their corresponding raw materials, making tamed spiders a slow but passive resource farm.

Let me read the necessary documentation before writing any code.

OreSilkSpiders
Adds six hostile ore-themed spider mobs (Coal, Iron, Gold, Diamond, Emerald, and Netherite) that spawn naturally and attack players. Each spider type can be tamed by right-clicking it with its corresponding ore material, giving a 1-in-3 chance per attempt. Tamed spiders become completely docile and periodically drop Ore Silk on the ground. They will only follow their owner when the taming material is held. Ore Silk can be crafted back into its corresponding raw material.

My plan:

  • Create OreSpiderEntity extending TameableEntity with a DataTracker-backed OreType, conditional hostile/follow goals, periodic silk drops, and right-click taming

  • Register 6 EntityType instances (one per ore type) sharing that entity class via a factory that sets the default ore type

  • Create a custom OreSpiderModel + OreSpiderRenderState + OreSpiderRenderer picking textures per ore type

  • Register all items (6 spawn eggs + 6 ore silks), a creative tab, and 6 shapeless silk→material recipes

Now all the resource files:

The mod is complete. Here’s a summary of what was built:

  • 6 hostile OreSpiderEntity types (Coal → Netherite) extending TameableEntity, each tracked via a DataTracker<Integer> ore type field persisted in NBT

  • Conditional AI goals: MeleeAttackGoal + ActiveTargetGoal<PlayerEntity> only fire when untamed; a custom FollowOwnerIfHoldingItemGoal only activates when tamed and the owner holds the tame item

  • Taming mechanic: right-click with the ore material for a 1-in-3 chance; uses setTamed(true/true) for heart/smoke particles; tamed spiders drop 1 Ore Silk every 60 seconds via tick counter

  • Custom renderer (OreSpiderRenderer) picks texture dynamically from OreSpiderRenderState.oreType; a fully custom OreSpiderModel with 11 parts (head, body, abdomen, 8 legs) on a 64×32 texture atlas with leg pitch animation driven by limbAngle/limbDistance

  • 6 spawn eggs with ore-themed tint colors in items JSON, 6 Ore Silk items, and 6 shapeless crafting recipes converting 4 silk → 1 raw material (netherite silk yields netherite scrap for balance)

draconicproductions

The compilation failed with this error:

code
Compilation failed with 20 error(s):

ERROR in src/main/java/com/oresilkspiders/ModEntities.java at line 28: incompatible types: EntityType<Entity> cannot be converted to EntityType<? extends OreSpiderEntity>
                    OreSpiderEntity entity = new OreSpiderEntity(entityType, world);
                                                                 ^

ERROR in src/main/java/com/oresilkspiders/ModEntities.java at line 36: incompatible types: EntityType<Entity> cannot be converted to EntityType<OreSpiderEntity>
                .build(key);
                      ^

ERROR in src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java at line 23: OreSpiderEntity is not abstract and does not override abstract method isBreedingItem(ItemStack) in AnimalEntity
public class OreSpiderEntity extends TameableEntity {
       ^

ERROR in src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java at line 129: incompatible types: Item cannot be converted to ServerWorld
                dropItem(getSilkItem(), 0);
                                    ^

ERROR in src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java at line 157: method does not override or implement a method from a supertype
    @Override
    ^

ERROR in src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java at line 162: method does not override or implement a method from a supertype
    @Override
    ^

ERROR in src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java at line 96: cannot find symbol
        float walk = state.limbAngle;
                          ^
  symbol: variable limbAngle
  location: variable state of type OreSpiderRenderState

ERROR in src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java at line 97: cannot find symbol
        float speed = state.limbDistance;
                           ^
  symbol: variable limbDistance
  location: variable state of type OreSpiderRenderState

ERROR in src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java at line 99: cannot find symbol
        head.yaw = state.headYaw * ((float) Math.PI / 180.0f);
                        ^
  symbol: variable headYaw
  location: variable state of type OreSpiderRenderState

ERROR in src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java at line 100: cannot find symbol
        head.pitch = state.headPitch * ((float) Math.PI / 180.0f);
                          ^
  symbol: variable headPitch
  location: variable state of type OreSpiderRenderState

ERROR in   src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java at line 23: OreSpiderEntity is not abstract and does not override abstract method isBreedingItem(ItemStack) in AnimalEntity
  public class OreSpiderEntity extends TameableEntity {
         ^

ERROR in   src/main/java/com/oresilkspiders/ModEntities.java at line 28: incompatible types: EntityType<Entity> cannot be converted to EntityType<? extends OreSpiderEntity>
                      OreSpiderEntity entity = new OreSpiderEntity(entityType, world);
                                                                   ^

ERROR in   src/main/java/com/oresilkspiders/ModEntities.java at line 36: incompatible types: EntityType<Entity> cannot be converted to EntityType<OreSpiderEntity>
                  .build(key);
                        ^

ERROR in   src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java at line 129: incompatible types: Item cannot be converted to ServerWorld
                  dropItem(getSilkItem(), 0);
                                      ^

ERROR in   src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java at line 96: cannot find symbol
          float walk = state.limbAngle;
                            ^
  symbol: variable limbAngle
  location: variable state of type OreSpiderRenderState

ERROR in   src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java at line 97: cannot find symbol
          float speed = state.limbDistance;
                             ^
  symbol: variable limbDistance
  location: variable state of type OreSpiderRenderState

ERROR in   src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java at line 99: cannot find symbol
          head.yaw = state.headYaw * ((float) Math.PI / 180.0f);
                          ^
  symbol: variable headYaw
  location: variable state of type OreSpiderRenderState

ERROR in   src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java at line 100: cannot find symbol
          head.pitch = state.headPitch * ((float) Math.PI / 180.0f);
                            ^
  symbol: variable headPitch
  location: variable state of type OreSpiderRenderState

ERROR in   src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java at line 157: method does not override or implement a method from a supertype
      @Override
      ^

ERROR in   src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java at line 162: method does not override or implement a method from a supertype
      @Override
      ^


=== COMPILATION ERROR ANALYSIS ===

TYPE MISMATCHES:
  - incompatible types: EntityType<Entity> cannot be converted to EntityType<? extends OreSpiderEntity>
  - incompatible types: EntityType<Entity> cannot be converted to EntityType<OreSpiderEntity>
  - incompatible types: Item cannot be converted to ServerWorld
  - incompatible types: EntityType<Entity> cannot be converted to EntityType<? extends OreSpiderEntity>
  - incompatible types: EntityType<Entity> cannot be converted to EntityType<OreSpiderEntity>
  - incompatible types: Item cannot be converted to ServerWorld
ACTION: Fix variable types or casting

FILES TO INVESTIGATE:
  - src/main/java/com/oresilkspiders/ModEntities.java
  - src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java
  - src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java
  -   src/main/java/com/oresilkspiders/entity/OreSpiderEntity.java
  -   src/main/java/com/oresilkspiders/ModEntities.java
  -   src/main/java/client/java/com/oresilkspiders/client/render/OreSpiderModel.java

Please fix this error by creating a new artifact with the corrected code.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
41 971
src/main/java/com/oresilkspiders/OreSpidersMod.java
package com.oresilkspiders;

import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class OreSpidersMod implements ModInitializer {

    public static final String MOD_ID = "oresilkspiders";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        ModEntities.initialize();
        ModItems.initialize();
        ModItemGroups.initialize();
    }
}