le rêve Bri
📎 1 file 1,268 chars
📄
pasted-code-1793558398319.txt
txt 2 lines
▶
What should the mod add to the game?
> # Minecraft Mob Disabling Mod  Create a Minecraft mod for **Fabric** that disables ONLY the following mobs:  1. Minecraft Witches 2. Minecraft Vexes 3. Zombie Horses 4. Zombie Nautilus (ONLY if this mob exists in Minecraft 26.3)  ## Requirements  - Prevent the listed mobs from naturally spawning. - Prevent them from spawning through mob events, where applicable. - Prevent them from appearing through other normal game spawning mechanics. - Do not disable, remove, or modify any other Minecraft mobs. - Do not affect villagers, pillagers, skeletons, zombies, or other hostile or passive mobs. - Do not change mob behavior for any creatures outside this list. - Do not interfere with other mods that add mobs. - Keep all other Minecraft gameplay mechanics unchanged.  ## Compatibility  - Minecraft version: 26.3 - Mod loader: Fabric - Generate all required mod files and dependencies.  ## Important Restrictions  This mod must ONLY affect the four specifically listed mob types.  Do not disable entire mob categories, spawning systems, structures, raids, or dimensions.  If Zombie Nautilus does not exist in Minecraft 26.3, simply skip it.  The finished mod should be lightweight, stable, and compatible with other Fabric mods.
Kodari AI
KodariNov 1 at 6:42 pm 1
SelectiveMobDisabler
A lightweight Fabric mod for Minecraft 26.3 that selectively prevents the natural spawning of only four specific mob types: Witches, Vexes, Zombie Horses, and Zombie Nautilus (if it exists in this version). The mod intercepts the spawn logic through a custom mixin targeting the ServerWorld's spawn methods, checking each entity against the configured blacklist before allowing spawns. It does not modify any other mobs, mob behaviors, spawning systems, structures, raids, or dimensions. The mod is fully compatible with other Fabric mods and keeps all other gameplay mechanics unchanged. It includes a minimal configuration file for easy toggling of each mob's disablement, ensuring users can customize which of the four mobs are blocked. The mod is designed to be lightweight, stable, and non-intrusive, with no dependencies beyond the standard Fabric API.
  1. Confirm the 26.3 spawn hook covers normal spawning paths and identify the exact vanilla mob types.

  2. Create the Fabric project files and narrowly block only those types.

  3. Leave Zombie Nautilus out if it is not present in 26.3.

Created the Fabric 26.3 mod. It blocks Witches, Vexes, Zombie Horses, and Zombie Nautiluses at the server entity-load gate, covering natural spawns, other spawn mechanisms, and entities loaded from saves. Zombie Nautilus exists in 26.3; other entity types are unaffected.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
5 85
src/main/java/com/example/mobdisabler/MobDisabler.java
package com.example.mobdisabler;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents;
import net.minecraft.world.entity.EntityTypes;

public final class MobDisabler implements ModInitializer {
	@Override
	public void onInitialize() {
		ServerEntityEvents.ALLOW_LOAD.register((entity, level, spawnReason, isLoadedFromDisk) -> {
			var type = entity.getType();
			return type != EntityTypes.WITCH
					&& type != EntityTypes.VEX
					&& type != EntityTypes.ZOMBIE_HORSE
					&& type != EntityTypes.ZOMBIE_NAUTILUS;
		});
	}
}