nortexi-code

a bypasser that umcaps the tp command allowing for you to /tp ~ 9 trillion (or more Y height) ~ to reach the skylands for fabric (26.2)

Kodari AI
KodariJul 6 at 8:55 am 8
TPUncapper
A lightweight Fabric mod that removes the teleport command height restriction, allowing players to use /tp to reach extreme Y coordinates (up to 9 trillion or more) to access skylands or build at unlimited heights. Uses a mixin to bypass the vanilla coordinate validation in the teleport command without affecting other commands or gameplay mechanics.

Let me first read the relevant docs to understand the correct 1.21.11 APIs.

I’ll create this TP uncapper mod for Fabric 1.21.11.

Plan:

  1. gradle.properties + build.gradle + settings.gradle

  2. fabric.mod.json + mixins.json

  3. TPUncapper.java main class

  4. Mixin targeting TeleportCommand to bypass Y-height validation

Let me build it. The approach: use @WrapOperation to intercept World.isOutOfHeightLimit() calls within TeleportCommand.execute() methods and return false (not out of bounds), allowing any Y coordinate.

I’ll use inline <create> tags to write all project files.

Let me start with the build infrastructure:

Next, the mod config and main class:

Now the key part — the mixin. I need to understand how TeleportCommand validates Y coordinates in 1.21.11. The vanilla /tp command (and relative coordinates with ~) has a “maximumY” / height validation. Let me look at the vanilla teleport command to understand what specifically needs to be bypassed.

The key method is in TeleportCommand. In 1.21.11, the execute methods call a coordinate validation. The Y coordinate is checked against world.getTopY() and world.getBottomY() or similar limits. I need to use @WrapOperation to intercept calls to isOutOfHeightLimit or modify the coordinate validation.

Let me think about what actually happens:

  1. /tp ~ ~9999999999999 ~ — the ~ resolves through CommandSource.getPosition() and coordinate resolution

  2. The coordinate arguments are parsed by ArgumentTypes or similar

  3. When actually teleporting, the entity position is set with requestTeleport(x, y, z) which itself doesn’t check height

The main validation happens in the coordinate parsing/fixing step. Let me look at how /tp is structured. In modern versions, there’s lookupEntity, execute, and the coordinate parsing.

Actually, let me think about what vanilla /tp ~ ~9999999999999 ~ does with a huge Y value. The issue is likely in CommandSource.getPosition() or how the relative coordinate ~ gets resolved — the max value limit might be in LocationArgument or in the coordinate parsing itself.

Looking at Minecraft 1.21.11 code structure, the /tp command has methods like:

  • execute(ServerCommandSource, Collection<Entity>, Location) — teleports entities to a location

  • execute(ServerCommandSource, Collection<Entity>, Entity) — teleports to another entity

The Location is a record containing Vec3d pos, Vec2f rot, etc. When the user types /tp ~ ~9999999999999 ~, the coordinates are resolved in the argument parsing.

The real issue isn’t TeleportCommand itself but the coordinate parsing. The LookTarget or LocationArgument or the relative coordinate resolution may cap Y. Actually, I think in 1.21.11, the coordinate limit might be in how Vec3ArgumentType or the coordinate resolution works.

Actually, let me reconsider. The user said “umcaps the tp command allowing for you to /tp ~ 9 trillion Y height”. This suggests there’s an explicit Y-limit check in the teleport command flow.

In vanilla, I believe there’s an isOutOfHeightLimit check that prevents teleporting entities outside build limits. Let me target the isOutOfHeightLimit method on World.

Actually, the simplest and most effective approach: use @WrapOperation to intercept any call to World.isOutOfHeightLimit(int y) during the teleport command execution and return false. This way, the world thinks any Y is valid.

Or even simpler: target TeleportCommand.execute and intercept the isOutOfHeightLimit calls within.

Let me write the mixin targeting World.isOutOfHeightLimit(BlockPos) or World.isOutOfHeightLimit(int). This affects the Y validation check.

In 1.21.11, World.isOutOfHeightLimit(int y) checks y < getBottomY() || y >= getTopY(). If I make this always return false for teleport commands… but I can’t know the caller context in a simple wrap.

Actually, let me look at the TeleportCommand more carefully. The validation likely happens in the lookup/execute flow. Let me check what methods TeleportCommand has.

In 1.21.11, TeleportCommand has:

  • register method

  • execute methods that parse Location

  • The Location itself has coordinate validation

The key insight: LocationArgumentType resolves coordinates. But in 1.21.11, I think the issue is that TeleportCommand.execute does something like:

Java
BlockPos blockPos = BlockPos.ofFloored(pos);
if (world.isOutOfHeightLimit(blockPos.getY())) {
    // error
}

If this is the case, I need to intercept that specific check.

Let me take a pragmatic approach: I’ll use a broader but precise mixin. I’ll target World.isOutOfHeightLimit(BlockPos) and World.isOutOfHeightLimit(int) with a check that uses @Share to only bypass within teleport command execution. But that’s complex.

Simpler approach: Just wrap World.isOutOfHeightLimit(int) to always return false. This is safe because the main use case of this mod is specifically to allow teleporting to extreme heights — and other code that checks height limits shouldn’t be affected. Actually no, this would break things like block placement, mob spawning, etc.

Best approach: Use @WrapOperation on the specific isOutOfHeightLimit call inside TeleportCommand methods.

Let me write the mixin targeting the specific INVOKE of World.isOutOfHeightLimit within TeleportCommand methods.

Actually, wait. In 1.21.11, let me think about what exactly the TeleportCommand code looks like. Looking at the Yarn mappings pattern:

Java
// TeleportCommand.java
private static int execute(ServerCommandSource source, Collection<? extends Entity> targets, Location location) {
    // ... resolve location ...
    // Check if the location is valid
    if (world.isOutOfHeightLimit(blockPos.getY())) {
        throw ERROR_TOO_HIGH.create();
    }
    // ... teleport each target ...
}

But I don’t know the exact line. Let me write a comprehensive mixin that targets multiple possible call sites.

Actually, let me think about it differently. The Location constructor or its coordinate normalization might be the issue. Let me just wrap isOutOfHeightLimit calls within execute methods of TeleportCommand.

Let me write a mixin that covers all the execute methods in TeleportCommand:

Java
@Mixin(TeleportCommand.class)
public class TeleportCommandMixin {
    @WrapOperation(
        method = {"method_XXXX", "execute", ...}
        at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isOutOfHeightLimit(I)Z")
    )
    private boolean allowAnyY(World world, int y, Operation<Boolean> original) {
        return false; // never out of height limit
    }
}

Actually, I don’t know the exact method names in the Yarn mappings for TeleportCommand. Let me look at what methods exist in the class by checking the Yarn source.

Since I can’t read files (read-only mount and no files exist), let me use a subagent to investigate the vanilla TeleportCommand structure.

Wait, the project is empty - there’s nothing to subagent on. I need to think about what the vanilla class looks like.

In Fabric 1.21.11 with Yarn mappings, net.minecraft.server.command.TeleportCommand contains:

  1. register — registers the command

  2. execute(ServerCommandSource, Collection<? extends Entity>, Location) — teleports entities to a Location

  3. execute(ServerCommandSource, Collection<? extends Entity>, Entity) — teleports to another entity

The Y validation likely happens in the Location variant. Inside it, the position from the Location is checked against world height limits.

Let me look at what the Yarn-mapped methods might be called. In 1.21.x, the methods in TeleportCommand are:

  • register

  • execute (the one with Location)

Let me check what the actual Yarn names are. Actually, I know that in Yarn mappings, the methods that take Location are:

  • lookupEntity or similar

  • execute

Let me just use the @WrapOperation on the execute method that handles Location teleportation. But I don’t know the exact Yarn method name…

Let me take a different approach. Instead of targeting TeleportCommand specifically, let me intercept at Entity.requestTeleport(double, double, double) or at the Vec3d normalization. No, that’s too broad.

Actually, the safest and cleanest approach: The coordinate check happens in TeleportCommand.execute when it resolves the Location. In Yarn mappings for 1.21.11, the main execute method is:

Java
private static int execute(ServerCommandSource source, Collection<? extends Entity> targets, Location location)

The class also has execute(ServerCommandSource, Collection<? extends Entity>, Entity) for entity-to-entity teleport.

Let me try wrapping isOutOfHeightLimit calls within TeleportCommand. Since both execute methods are private static, I need to target them by their Yarn descriptor.

Actually, in Yarn 1.21.11, I think the methods are:

Java
private static int execute(ServerCommandSource source, Collection<? extends Entity> targets, Location location)

This is the one that validates coordinates. Let me write the mixin with @WrapOperation wrapping World.isOutOfHeightLimit calls within TeleportCommand.

Let me check what I know about the method name. In Yarn, these methods are typically just execute. Let me write the mixin:

Java
@Mixin(TeleportCommand.class)
public abstract class TeleportCommandMixin {
    
    @WrapOperation(
        method = "execute(Lnet/minecraft/server/command/ServerCommandSource;Ljava/util/Collection;Lnet/minecraft/server/command/TeleportCommand$Location;)I",
        at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isOutOfHeightLimit(Lnet/minecraft/util/math/BlockPos;)Z")
    )
    private static boolean allowAnyY_blockPos(World world, BlockPos pos, Operation<Boolean> original) {
        return false;
    }

    @WrapOperation(
        method = "execute(Lnet/minecraft/server/command/ServerCommandSource;Ljava/util/Collection;Lnet/minecraft/server/command/TeleportCommand$Location;)I",
        at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isOutOfHeightLimit(I)Z")
    )
    private static boolean allowAnyY_int(World world, int y, Operation<Boolean> original) {
        return false;
    }
}

Wait, but I should also check what the actual execute method is called in Yarn for 1.21.11. Let me look this up via web fetch or something.

Actually, I just realized I can check the Maven repository for the Yarn mappings. Let me try a web search to find the Yarn-mapped names for TeleportCommand in 1.21.11.

Let me think more carefully. In Minecraft’s TeleportCommand (vanilla):

The method that handles entity-to-location teleportation is usually called execute or teleport. In Yarn, it’s typically named execute. Let me use a broader approach - match by descriptor.

Actually, let me keep it simple. The Yarn name for the main teleport method is likely execute. I’ll use the descriptor to match:

Java
@Mixin(TeleportCommand.class)
public class TeleportCommandMixin {
    @WrapOperation(
        method = "execute(Lnet/minecraft/server/command/ServerCommandSource;Ljava/util/Collection;Lnet/minecraft/server/command/TeleportCommand$Location;)I",
        at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isOutOfHeightLimit(I)Z")
    )
    private static boolean bypassHeightCheck(World world, int y, Operation<Boolean> original) {
        return false;
    }
}

Hmm, wait - the TeleportCommand uses both isOutOfHeightLimit(I)Z and isOutOfHeightLimit(Lnet/minecraft/util/math/BlockPos;)Z. Let me handle both.

Let me also consider: does /tp validate coordinates based on a maximum value? There might be a MAX_COORDINATE constant of 30,000,000 somewhere. Let me check if that affects Y.

In vanilla, the world border X/Z is limited to ±30,000,000, but Y has its own limits from the world height (min_y to max_y). The world height for the overworld is typically -64 to 320. /tp ~ ~9999999999999 ~ would set Y to 9 trillion, which is way above the world height, and vanilla would reject it.

The check is world.isOutOfHeightLimit(y) which checks y < bottomY || y >= topY. For the overworld, this means any Y outside -64 to 320 is “out of height limit” and the teleport is rejected.

My mixin needs to bypass this check specifically within TeleportCommand. Let me write it now.

Also, I need the import for @WrapOperation and Operation.

Let me finalize the mixin:

Java
package com.tpuncapper.mixin;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.server.command.TeleportCommand;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(TeleportCommand.class)
public class TeleportCommandMixin {

    @WrapOperation(
        method = "execute(Lnet/minecraft/server/command/ServerCommandSource;Ljava/util/Collection;Lnet/minecraft/server/command/TeleportCommand$Location;)I",
        at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isOutOfHeightLimit(I)Z")
    )
    private static boolean allowAnyHeightY(World world, int y, Operation<Boolean> original) {
        return false;
    }

    @WrapOperation(
        method = "execute(Lnet/minecraft/server/command/ServerCommandSource;Ljava/util/Collection;Lnet/minecraft/server/command/TeleportCommand$Location;)I",
        at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isOutOfHeightLimit(Lnet/minecraft/util/math/BlockPos;)Z")
    )
    private static boolean allowAnyHeightBlockPos(World world, BlockPos pos, Operation<Boolean> original) {
        return false;
    }
}

Wait, but isOutOfHeightLimit(BlockPos) — does this exist in 1.21.11? Let me think. World has:

  • isOutOfHeightLimit(BlockPos) (uses pos.getY())

  • isOutOfHeightLimit(int)

Both exist. My approach should handle both.

Also, I should consider: what about the Location class inside TeleportCommand? The coordinate resolution might already prevent huge values. Let me also wrap the value that’s checked. But I think for /tp ~ (relative), the Y value is just the entity’s Y + whatever was specified, and for absolute coordinates it’s the literal value. Neither of these should be inherently limited to prevent huge values - only the world height check blocks it.

Let me finalize and create all files.

Now let me verify the file tree and use a subagent to check the actual TeleportCommand Yarn names to make sure my descriptor is right:

Now I have all the Yarn mapping info I need. Key findings:

  • World.isValid(BlockPos) (method_25953) — “should be used for teleportation” — checks Y between ±20M, blocks Y=9 trillion

  • TeleportCommand has two execute methods in Yarn: the Location-based one (method_13765) calls isValid, the Entity-based one (method_13771) doesn’t

  • requestTeleport(x, y, z) takes doubles so it can handle 9 trillion — the problem is only the validation check

Let me create all the project files:

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
7 129
src/main/java/com/tpuncapper/TPUncapper.java
package com.tpuncapper;

import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TPUncapper implements ModInitializer {
    public static final String MOD_ID = "tpuncapper";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        LOGGER.info("TPUncapper initialized — /tp Y-height limit removed");
    }
}