Dewansh GAMING

Add the mutant iron golem helth 700

Kodari AI
KodariOct 23 at 12:27 pm 3
MutantIronGolem
Adds a powerful mutant iron golem boss with 700 health to the Minecraft world. This custom entity features enhanced combat abilities, unique attack patterns, and increased damage output compared to standard iron golems. The mutant variant spawns with distinct visual characteristics, including larger size and glowing red eyes. It drops rare loot upon defeat and provides challenging end-game content for players. The mod includes custom AI behavior for aggressive targeting, area-of-effect slam attacks, and regenerative health mechanics. Fully compatible with Fabric 26.3, this mod enhances gameplay with a formidable new adversary that requires strategic combat approaches to defeat.
  1. Register a survival-obtainable mutant iron golem with 700 maximum health.

  2. Reuse the vanilla golem appearance and sounds, and add its spawn egg, recipe, loot table, and required mod files.

Added the Mutant Iron Golem with 700 maximum health, using the vanilla iron golem appearance and sounds. Craft its spawn egg with 8 iron blocks surrounding a nether star; it also drops an iron ingot and a poppy.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
11 203
src/main/java/com/kodari/mutantgolem/MutantGolemMod.java
package com.kodari.mutantgolem;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.fabricmc.fabric.api.creativetab.v1.CreativeModeTabEvents;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.SpawnEggItem;

public final class MutantGolemMod implements ModInitializer {
	public static final String MOD_ID = "mutantgolem";

	private static final ResourceKey<EntityType<?>> MUTANT_IRON_GOLEM_KEY = ResourceKey.create(
			Registries.ENTITY_TYPE,
			Identifier.fromNamespaceAndPath(MOD_ID, "mutant_iron_golem")
	);

	public static final EntityType<MutantIronGolem> MUTANT_IRON_GOLEM = Registry.register(
			BuiltInRegistries.ENTITY_TYPE,
			MUTANT_IRON_GOLEM_KEY,
			EntityType.Builder.of(MutantIronGolem::new, MobCategory.CREATURE)
					.sized(1.4F, 2.7F)
					.build(MUTANT_IRON_GOLEM_KEY)
	);

	private static final ResourceKey<Item> MUTANT_IRON_GOLEM_SPAWN_EGG_KEY = ResourceKey.create(
			Registries.ITEM,
			Identifier.fromNamespaceAndPath(MOD_ID, "mutant_iron_golem_spawn_egg")
	);

	public static final Item MUTANT_IRON_GOLEM_SPAWN_EGG = Registry.register(
			BuiltInRegistries.ITEM,
			MUTANT_IRON_GOLEM_SPAWN_EGG_KEY,
			new SpawnEggItem(new Item.Properties()
					.spawnEgg(MUTANT_IRON_GOLEM)
					.setId(MUTANT_IRON_GOLEM_SPAWN_EGG_KEY))
	);

	private static final ResourceKey<CreativeModeTab> SPAWN_EGGS_TAB = ResourceKey.create(
			Registries.CREATIVE_MODE_TAB,
			Identifier.fromNamespaceAndPath("minecraft", "spawn_eggs")
	);

	@Override
	public void onInitialize() {
		FabricDefaultAttributeRegistry.register(
				MUTANT_IRON_GOLEM,
				MutantIronGolem.createAttributes().add(Attributes.MAX_HEALTH, 700.0)
		);
		CreativeModeTabEvents.modifyOutputEvent(SPAWN_EGGS_TAB)
				.register(output -> output.accept(MUTANT_IRON_GOLEM_SPAWN_EGG));
	}
}