Forge 1.20.1 Mario creature lesson

Super Mario is in Minecraft.

Make a Forge MOD a light-hearted, lively Mario-style creature that jumps and shoots fireballs. The course focuses on entity registration, attribute design, AI skills, model texture repair and animation troubleshooting.

Forge 1.20.1 Blockbench AI Goals Fireball Skill Texture UV Animation

Course overview

The lesson solves three problems: Mario can find it, the placards are right, and the movement is running.

Two typical problems occurred in the previous MOD debugging: the entity did not appear in the summon list, and the model texture was in disordered position and had no animation. This page breaks them down into checkable implementation flows, allowing students to progress from "can summon" to "acting like a real game creature."

01

Sign up

Entity types, monster spawn eggs, and attribute events are all linked to the Forge event system.

02

Properties

The amount of blood, the speed at which it moves, the tendency to jump and the range of attacks are designed as "light characters".

03

Skills

Pedals, fireballs, sprints, gold coin particle feedback form a core play cycle.

SuperMarie MOD export flowcharts from resource to entity registration, sticker restoration and animation validation
Implementation flow chart: first ensure that the resource path is correct, and then enter the entity logic and rendering animation.
SuperMarie Minecraft MOD teaching thinking guide
Mind map: Split the Mario creature into six modules: registration, resources, attributes, AI, skills and debugging.

Mind map

The teaching structure remains clear, but the web page has a lighter temperament.

The page follows the dark background, a clear grid and course description of the PixelCraft, while adding Mario's red, blue, yellow and green dots to make it look more like an easy creative lesson than the horror Boss page.

  • Resource level:OBJ/MTL/PNG file names, texture paths, and UV expansion must correspond one to one.
  • Logical layer:Entity registration and attribute events determine whether the game can recognize Mario.
  • Experience layer:Jumping, fireballs, sprints and particle feedback determines whether it's fun or not.

Build steps

From an invisible entity to a Mario who can move, fight, and debug.

1

Confirm MOD ID

If there is no Mario in the command completion, first check whether the `DeferredRegister` uses the correct `MODID`.

2

Bind Properties Events

Being able to register an entity does not mean it can be generated. In the absence of attribute binding, summoning will often fail or directly report an error.

3

Organize resource paths

The sticker is placed in `textures/entity/mario/ ' and the model is exported with reference to the same naming system.

4

Add skill cooling

Do not release fireballs and sprints every tick, use cooldown and distance judgment to maintain the rhythm of the battle.

5

Access animation status

Divide states according to idle, walk, jump, and attack to synchronize actions and AI behaviors.

6

In-game verification

Use `/summon examplemod:mario` and log to check entities, renders, textures and animations simultaneously.

Code guide

Core code: registration, attributes, skills and texture fixes.

ModEntities.java
public class ModEntities {
    public static final DeferredRegister<EntityType<?>> ENTITIES =
        DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, ExampleMod.MODID);

    public static final RegistryObject<EntityType<MarioEntity>> MARIO =
        ENTITIES.register("mario", () -> EntityType.Builder
            .of(MarioEntity::new, MobCategory.CREATURE)
            .sized(0.8F, 1.85F)
            .clientTrackingRange(10)
            .build(new ResourceLocation(ExampleMod.MODID, "mario").toString()));

    public static void register(IEventBus bus) {
        ENTITIES.register(bus);
    }
}
MarioEntity.java
public static AttributeSupplier.Builder createAttributes() {
    return PathfinderMob.createMobAttributes()
        .add(Attributes.MAX_HEALTH, 36.0D)
        .add(Attributes.MOVEMENT_SPEED, 0.34D)
        .add(Attributes.ATTACK_DAMAGE, 6.0D)
        .add(Attributes.FOLLOW_RANGE, 28.0D)
        .add(Attributes.KNOCKBACK_RESISTANCE, 0.15D);
}

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(1, new FloatGoal(this));
    this.goalSelector.addGoal(2, new MarioFireballGoal(this));
    this.goalSelector.addGoal(3, new MeleeAttackGoal(this, 1.18D, true));
    this.goalSelector.addGoal(4, new WaterAvoidingRandomStrollGoal(this, 1.0D));
    this.goalSelector.addGoal(5, new LookAtPlayerGoal(this, Player.class, 8.0F));
    this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Monster.class, true));
}
MarioFireballGoal.java
public class MarioFireballGoal extends Goal {
    private final MarioEntity mario;
    private int cooldown;

    public MarioFireballGoal(MarioEntity mario) {
        this.mario = mario;
    }

    @Override
    public boolean canUse() {
        LivingEntity target = mario.getTarget();
        return target != null
            && target.isAlive()
            && mario.distanceTo(target) < 14.0F
            && cooldown-- <= 0;
    }

    @Override
    public void start() {
        LivingEntity target = mario.getTarget();
        if (target == null) return;

        SmallFireball fireball = new SmallFireball(mario.level(), mario, 0, 0, 0);
        fireball.setPos(mario.getX(), mario.getEyeY() - 0.15D, mario.getZ());
        fireball.shoot(target.getX() - mario.getX(), target.getEyeY() - mario.getEyeY(), target.getZ() - mario.getZ(), 1.3F, 0.8F);
        mario.level().addFreshEntity(fireball);
        mario.playSound(SoundEvents.BLAZE_SHOOT, 0.7F, 1.25F);
        cooldown = 80;
    }
}
MarioRenderer.java
public class MarioRenderer extends MobRenderer<MarioEntity, MarioModel<MarioEntity>> {
    private static final ResourceLocation TEXTURE =
        new ResourceLocation(ExampleMod.MODID, "textures/entity/mario/mario.png");

    public MarioRenderer(EntityRendererProvider.Context context) {
        super(context, new MarioModel<>(context.bakeLayer(MarioModel.LAYER_LOCATION)), 0.42F);
    }

    @Override
    public ResourceLocation getTextureLocation(MarioEntity entity) {
        return TEXTURE;
    }
}

// 贴图错位时优先检查:
// 1. PNG 是否在 assets/examplemod/textures/entity/mario/mario.png
// 2. 模型导出的 UV 坐标是否匹配贴图尺寸
// 3. MTL/OBJ 文件名中是否有空格或特殊字符
// 4. 客户端事件是否注册了 EntityRenderers.register(ModEntities.MARIO.get(), MarioRenderer::new)

Demo check

Use video review: entity appearance, map display, and animation feedback must be checked one by one.

The course video is taken from your Minecraft Forge screen. This presentation portal is maintained on the web page to enable students to match their own game effects.

  • `examplemod:mario` can be seen in the command completion.
  • There is no misalignment, reverse color or loss of textures after Mario is generated.
  • There is visible motion feedback when moving, attacking, and releasing fireballs.

Debug board

Quickly locate common problems.

Mario not found

Check registration link

`ModEntities.register(modEventBus)`, attribute events, and client renderer registration are indispensable.

Paste Misposition

Check UVs and Paths

Export the Java model again from Blockbench to confirm the size of the sticker and the model UV using the same PNG.

No animation

Check state machine

If only static OBJ is imported, there will be no skeletal animation by default. Requires GeckoLib or Java model animation logic.

Super Mario MOD Skills Cycle Chart
Skill cycle: target discovery, jumping approach, fireball remote, stampede melee, particles and sound feedback.