i113w's Camera Lib

i113w's Camera Lib

A Lib that provides the RTS Style Camera System which is used by Better Mine Team.

by
147 Downloads
forgeneoforge
Rent Server with this Mod

About this Mod

i113w's Camera Lib

A NeoForge 1.21.1 client-side library that provides a complete RTS-style camera system — including camera movement, entity box-selection, right-click command zones, ray casting, and highlight rendering.

Designed to be consumed by other mods (e.g., Better Mine Team) via a thin API layer.


Requirements

Item Version
Minecraft 1.21.1
NeoForge 21.1.209+
Java 21
Side Client-only

Importing the Library

Local JAR (place the JAR in your mod's libs/ directory):

dependencies {
    implementation files('libs/i113w_camera_lib-0.0.1.jar')
}

Declare the dependency in META-INF/neoforge.mods.toml:

[[dependencies."your_mod_id"]]
    modId = "i113w_camera_lib"
    type = "required"
    versionRange = "[0.0.1,)"
    ordering = "BEFORE"
    side = "CLIENT"

Key Interfaces & Classes

CameraLibAPI — singleton entry point

CameraLibAPI api = CameraLibAPI.get();

// Register your delegate
api.setInteractionDelegate(new MyDelegate());

// Sync selected entity IDs to the library (drives outline rendering)
api.setSelectedEntities(Set<Integer> ids);

// Query hovered entity (-1 if none)
int id = api.getHoveredEntityId();

// Clear selection and hover state
api.clearSelection();

IRTSInteractionDelegate — inject business logic

public interface IRTSInteractionDelegate {
    boolean isSelectable(Entity entity);
    ResourceLocation getCursorIcon(@Nullable Entity hoveredEntity, boolean isAttackDragging);
}

Register via CameraLibAPI.get().setInteractionDelegate(impl).


Events (fired on NeoForge.EVENT_BUS)

RTSBoxSelectEvent — left-click or drag-box completed

@SubscribeEvent
public static void onSelect(RTSBoxSelectEvent event) {
    List<Entity> candidates = event.getCandidates(); // pre-filtered by isSelectable()
}

RTSRightClickEvent — right-click or right-drag completed

@SubscribeEvent
public static void onRightClick(RTSRightClickEvent event) {
    if (event.isDrag()) {
        List<Entity> targets = event.getDragTargets();
    } else {
        HitResult hit = event.getSingleHitResult(); // BlockHitResult or EntityHitResult
    }
}

RTSCameraController — camera state

RTSCameraController cam = RTSCameraController.get();

cam.toggleRTSMode();      // activate / deactivate
cam.toggleCameraStyle();  // switch RTS <-> FREE (while active)
cam.isActive();           // boolean
cam.reset();              // force-exit, use on logout / level unload

Camera Modes

Mode FOV Zoom Yaw Rotation
RTS 25° (fixed) Scroll wheel Hold Left Ctrl + drag (snaps by rtsSnapAngle)
FREE Standard Scroll wheel (moves forward) Hold Left Ctrl + drag (continuous)

Highlight Rendering

The library automatically draws entity outlines when the camera is active. No rendering code is needed in the consumer mod — just keep CameraLibAPI.setSelectedEntities(...) in sync.

Color Condition
White Entity ID is in the selected set
Yellow Hovered entity (not in selected set)

Configuration

Player-adjustable values in .minecraft/config/i113w_camera_lib-client.toml:

Key Default Description
rtsPitchMin / Max 35 / 45 Pitch clamp range in RTS mode
freePitchMin / Max 10 / 90 Pitch clamp range in FREE mode
rtsZoomMin / Max 10 / 80 Zoom distance clamp in RTS mode
rtsZoomSpeedMultiplier 3.5 Scroll wheel zoom sensitivity
rtsSnapAngle 90 Degrees per yaw snap step
freeRotationSpeed 5.0 Mouse yaw sensitivity in FREE mode
thresholdPx 20 Edge-pan trigger distance (pixels from screen edge)
baseSpeed 1.0 WASD movement speed
sprintMultiplier 2.0 Speed multiplier when sprint key is held

License

MIT — see LICENSE

Author: i113w

Available Versions

i113w's Camera Lib 2612-0.0.1-alpha1release
MC 26.1.2neoforge
June 13, 2026
i113w's Camera Lib 0.0.3-alpha3release
MC 1.21.1neoforge
June 9, 2026
i113w's Camera Lib 1.20.1-0.0.3-alpha2release
MC 1.20.1forge
June 9, 2026
i113w's Camera Lib 1.20.1-0.0.3-alpha1release
MC 1.20.1forge
June 8, 2026
i113w's Camera Lib 0.0.3-alpha2release
MC 1.21.1neoforge
June 8, 2026

How to Install i113w's Camera Lib on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set forge Loader

In the panel under "Egg", select the forge loader and matching Minecraft version (26.1.2).

3

Install Mod

Open the mod browser in the dashboard and search for "i113w's Camera Lib". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

forgeneoforge

Minecraft Versions

26.1.2, 1.21.1, 1.20.1

Server-side

Unsupported

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

i113w's Camera Lib server crashes on startup – what to do?

Most common cause: wrong forge version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (26.1.2). You can switch loaders with one click in the panel.

Is i113w's Camera Lib compatible with forge and neoforge?

i113w's Camera Lib officially supports forge, neoforge for Minecraft 26.1.2, 1.21.1, 1.20.1. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with i113w's Camera Lib – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if i113w's Camera Lib consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install i113w's Camera Lib with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Unsupported

Supported Versions

26.1.21.21.11.20.1