reBle

make a mod for fabrik 26.3 that prevents lighting a portal to the Nether

Kodari AI
KodariOct 10 at 9:41 am 1
NetherPortalGuard
NetherPortalGuard is a Minecraft Fabric mod for version 26.3 that prevents players from lighting Nether portals. The mod intercepts portal ignition attempts, including flint and steel usage, fire charges, and fire spread that could activate a portal frame. When a player attempts to light a portal, the mod cancels the action and displays a configurable chat message explaining that Nether portals are disabled. The mod uses Fabric API events to hook into block interactions and fire spread mechanics, ensuring portals cannot be activated through any means. Server administrators can toggle the protection on or off via a simple configuration file, allowing flexible server management without requiring a restart.
  • Block vanilla portal formation at its creation point, leaving ordinary fire behavior unchanged.

  • Add the 26.3 Fabric project and mixin configuration.

Created the Fabric 26.3 mod. It cancels Nether portal block creation, so flint and steel or fire charges can still start fires, but cannot activate a Nether portal.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 89
src/main/java/com/kodari/nonetherportals/mixin/PortalShapeMixin.java
package com.kodari.nonetherportals.mixin;

import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.portal.PortalShape;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(PortalShape.class)
public class PortalShapeMixin {
	@Inject(method = "createPortalBlocks", at = @At("HEAD"), cancellable = true)
	private void noNetherPortals$preventCreation(LevelAccessor level, CallbackInfo ci) {
		ci.cancel();
	}
}