Azu

Night elf sentinell

Kodari AI
KodariOct 30 at 12:34 pm 11
NightElfSentinell
NightElfSentinell is a Minecraft NeoForge mod that adds a sentinel-themed gameplay system. Players can craft and place sentinel statues that automatically detect and attack hostile mobs within a configurable radius. The mod includes custom sentinel entities with ranged attacks, a crafting recipe system, visual particle effects for targeting, and configurable damage/range values. It also features a night-vision buff when near sentinels, reinforcing the night elf guardian theme. The mod integrates with NeoForge events for entity spawning and damage handling, providing a balanced tower-defense style addition to vanilla gameplay.
  1. Add a hostile Night Elf Sentinel with a humanoid skin and working combat behavior.

  2. Register its forest spawns, attributes, loot, spawn egg, recipe, client rendering, and names.

Added the Night Elf Sentinel as a hostile forest mob with combat behavior, a humanoid skin, custom spawn egg, emerald loot, and English names.

In survival, sentinels spawn naturally in forests. Craft their spawn egg with an egg, amethyst shard, dark oak sapling, and ender pearl.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
16 281
src/main/java/com/kodari/nightelfsentinel/NightElfSentinelMod.java
package com.kodari.nightelfsentinel;

import com.kodari.nightelfsentinel.entity.NightElfSentinel;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.SpawnEggItem;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredItem;
import net.neoforged.neoforge.registries.DeferredRegister;

@Mod(NightElfSentinelMod.MOD_ID)
public final class NightElfSentinelMod {
    public static final String MOD_ID = "nightelfsentinel";

    private static final DeferredRegister.Entities ENTITY_TYPES = DeferredRegister.createEntities(MOD_ID);
    private static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MOD_ID);

    public static final DeferredHolder<EntityType<?>, EntityType<NightElfSentinel>> NIGHT_ELF_SENTINEL =
            ENTITY_TYPES.registerEntityType("night_elf_sentinel", NightElfSentinel::new, MobCategory.MONSTER,
                    builder -> builder.sized(0.6F, 1.95F));

    public static final DeferredItem<SpawnEggItem> NIGHT_ELF_SENTINEL_SPAWN_EGG =
            ITEMS.registerItem("night_elf_sentinel_spawn_egg", SpawnEggItem::new,
                    properties -> properties.spawnEgg(NIGHT_ELF_SENTINEL.get()));

    public NightElfSentinelMod(IEventBus modEventBus) {
        ENTITY_TYPES.register(modEventBus);
        ITEMS.register(modEventBus);
    }
}