← Назад к ресурсам

stunnable

a mod that shows a box/outline around your enemy so you know when to start trying to stun slam

Modrinth game-mechanics utility

Описание

# 🟢 Stunnable Mod A minimal, high-performance client-side Fabric mod that adds highly customizable, reactive visual rendering boxes and outlines around target players within reach range. Perfect for maintaining spatial awareness and monitoring stun / interaction ranges with fluid animations, rainbow effects, and breathing transitions. 🌟 --- # 📋 Table of Contents - [⚡ Quick Start](#-quick-start) - [🧠 How It Works — Core Architecture](#-how-it-works--core-architecture) - [⚙️ Configuration Options](#️-configuration-options) - [✨ Visual Effects System](#-visual-effects-system) - [🔌 Integration & ModMenu](#-integration--modmenu) --- # ⚡ Quick Start 1. Ensure you have: - Fabric Loader - Fabric API - Cloth Config - AutoConfig 2. Drop the `stunnable.jar` file into your: ```text .minecraft/mods ``` 3. Launch the game. 4. Open the configuration screen directly through ModMenu. 🛠️ Customize: - Colors 🎨 - Rainbow rendering 🌈 - Breathing opacity transitions 🫁 - Outline width 📏 - Fill opacity 🔥 Perfectly tune the HUD style to your preference. --- # 🧠 How It Works — Core Architecture The mod operates entirely client-side, hooking directly into Minecraft's rendering lifecycle to draw smooth overlays around nearby targets. 🖥️ --- ## 🔄 Core Initialization The mod uses standard Fabric entry points for initialization and configuration setup. ### `StunnableClient` Implements: ```java ClientModInitializer ``` Responsible for: - Client-side initialization - Secondary configuration handling --- ### `Stunnable` Implements: ```java ClientModInitializer ``` Responsible for: - Registering AutoConfig schemas - Hooking into Fabric render lifecycle events --- # 🎨 Rendering Lifecycle Hook Inside `Stunnable.java`, the mod subscribes to: ```java WorldRenderEvents.END_MAIN.register(context -> { ... }); ``` This ensures: - Rendering updates every frame - No game tick delay - No block update dependency - Extremely smooth visual tracking --- # 📐 Positioning & Calculation Pipeline ## 🎯 Reach Restrictions The mod dynamically extracts player interaction range using entity attributes: ```java double reach = mc.player.getAttributeValue(Attributes.ENTITY_INTERACTION_RANGE); ``` --- ## 📦 Relative Delta Rendering Bounding boxes are translated into camera-relative local coordinates to eliminate render jitter: ```java AABB box = player.getBoundingBox().move(-camPos.x, -camPos.y, -camPos.z); ``` --- ## 🚫 Target Exclusions The renderer loops through loaded players while excluding the local player: ```java if (player != mc.player && playerPos.distanceTo(player.position()) { r = value; g = t; b = p; } case 1 -> { r = q; g = value; b = p; } case 2 -> { r = p; g = value; b = t; } case 3 -> { r = p; g = q; b = value; } case 4 -> { r = t; g = p; b = value; } case 5 -> { r = value; g = p; b = q; } default -> { r = 0; g = 0; b = 0; } } return ((int) (r * 255)