Create a complete Minecraft Java Fabric 1.21.4 mod called ChannelWaypoints. Press 0 to open a GUI with five global channels, a keybind settings tab, and private channels with create and join buttons using invitation codes. Press / to place a waypoint. Players on the same server and channel must see each other's waypoints with a large player skin head, nickname and distance. Each player can have only one active waypoint, replaced when creating another. Play a short plop sound when creating a waypoint. Implement client-server synchronization and provide a compiled, working JAR for both client and server.
Set up the Fabric 1.21.4 project and shared channel/network protocol.
Implement the client GUI, editable keybinds, and waypoint display.
Add server channel/invitation handling, synchronization, and waypoint replacement.
Created the ChannelWaypoints Fabric 1.21.4 project. It includes five global channels, invite-code private channels, a keybind settings tab, and server-synchronized waypoints with player heads, nicknames, distances, and a plop sound. Each player’s next waypoint replaces their previous one.
The same mod JAR is intended for both clients and the server. To get it, click Compile in the top bar, click Compile in the window, then click Download when the build succeeds. Private channels and waypoints are currently held in server memory and reset when the server restarts.
generating
When the build finishes generating, click Download on the successful build to get the JAR.
Fix the issue where waypoints don't display when I press '\', update the GUI to show who else is on the channel with you, and change the language to Polish.
Fix waypoint placement on
\by tracing the client keybind and packet path.Add current channel members to the GUI.
Translate the interface to Polish.
Naprawiono: klawisz \ tworzy punkt, a HUD wyświetla również Twój własny punkt. GUI pokazuje innych graczy na kanale i aktualizuje listę przy dołączaniu, rozłączaniu oraz zmianie kanału. Przetłumaczono interfejs i komunikaty na polski, a nazwy kanałów prywatnych obsługują polskie znaki.
Aby pobrać zaktualizowany JAR: na komputerze kliknij Compile na górnym pasku, potem Compile w oknie i Download po zakończeniu. Na telefonie wybierz ⋮ → Compile Project, następnie Compile i Download. Tego samego JAR-a użyj po stronie klienta i serwera.
📄
pasted-code-1792251638798.txt
txt
87 lines
▶
Create a complete Minecraft Java mod called **ChannelWaypoints** for **Minecraft 1.21.4 using Fabric**. The mod must work in multiplayer and include all the features described below. Do not leave unfinished features, placeholder buttons, TODO comments, or fake functionality. Generate the complete source code and a compiled `.jar` file.
## 1. Main GUI
- Pressing **0** opens the ChannelWaypoints menu.
- The menu contains five global channels: Channel 1, Channel 2, Channel 3, Channel 4, and Channel 5.
- Players can select a channel by clicking its button.
- Players in the same channel on the same Minecraft server can see each other's active waypoints.
- The GUI has a second tab called **Binds**, which displays the key bindings for opening the menu and creating waypoints.
- All key bindings must be configurable through Minecraft's Controls settings.
- The interface must be centered, organized, readable, and compatible with different screen resolutions.
## 2. Private Channels
Below the five global channels, add a private-channel section.
- On the left, add a **D (Join)** button.
- On the right, add an **S (Create)** button.
- Clicking **S** creates a private channel and generates a unique invitation code.
- Display the code in the center of the screen and provide a button to copy it.
- Clicking **D** opens a centered text field where the player can enter an invitation code.
- After entering a valid code, the player joins that private channel.
- Players in the same private channel can see each other's waypoints.
- Players outside that private channel must never see its waypoints.
- Invalid codes must produce a clear error message.
- Private channels must work between different players connected to the same Minecraft server.
## 3. Creating Waypoints
- Pressing **/** creates a waypoint at the player's current position.
- The waypoint must be synchronized with the server and other authorized players.
- Every player can have only one active waypoint at a time.
- Creating a new waypoint automatically removes that player's previous waypoint.
- The creator must also see their own waypoint.
- Waypoints must contain the owner's Minecraft UUID, nickname, position, dimension, and channel.
- Waypoints must update correctly when players change channels, disconnect, or change dimensions.
## 4. Waypoint Appearance
Render waypoints directly in the Minecraft world in 3D, not only on the screen.
Every waypoint must display three elements in this exact order:
1. **A large head using the waypoint owner's actual Minecraft skin**, at the very top.
2. **The owner's nickname**, directly underneath the head.
3. **The distance to the waypoint**, at the bottom, measured in blocks or meters.
The marker must face the camera so it remains readable from different viewing angles. The distance must update as the viewer moves. Markers must only appear to players authorized to see them, and markers from other dimensions must not display misleading distances.
## 5. Sound
- When a waypoint is successfully created or replaced, play a short, soft plup or pling sound.
- The creator must hear the sound.
- The sound should play only after the server confirms that the waypoint was created successfully.
- Do not play the sound multiple times for one waypoint creation.
## 6. Multiplayer and Server Synchronization
- Implement complete client-server networking using APIs compatible with Fabric 1.21.4.
- The server must manage channel membership, private invitation codes, and waypoint data.
- Synchronize waypoint creation, replacement, removal, and channel changes between authorized players.
- Players in different channels must not receive private waypoint data.
- The creator must see their own waypoint, just like other authorized players.
- Remove stale waypoint markers when players disconnect or change channels.
- Global channels must be separate for each Minecraft server.
- Include the necessary server-side code. A client-only implementation is not sufficient.
- Clearly explain that clients need the mod installed and that the server needs the required server-side component.
## 7. Technical Requirements
- Minecraft Java Edition 1.21.4.
- Fabric Loader and compatible Fabric API.
- Java 21.
- Complete Gradle project with all required Java files, resources, and `fabric.mod.json`.
- Correctly register the mod's entry points, key bindings, networking payloads, GUI, and rendering.
- Ensure the mod can run on a dedicated Fabric server without client-only classes causing crashes.
- Provide the compiled mod `.jar` and the complete source project in a ZIP file.
## 8. Testing and Delivery
Before delivering the mod, compile it and fix all compilation errors.
Test the mod with at least two players on the same test server. Verify that global channels work, private invitation codes work, waypoint markers display the correct skin head, nickname, and distance, new waypoints replace old ones, the sound plays correctly, and players in different channels cannot see each other's waypoints.
Provide installation instructions for Minecraft clients and the server.
**Do not claim that the mod works unless it has actually been compiled and tested. If any feature cannot be implemented or tested, clearly explain what remains incomplete.**
Plan:
Replace the HUD-only markers with camera-facing 3D skin-head markers, nickname, and live distance.
Make waypoint sync dimension-aware and preserve private-channel membership across disconnects.
Set
/as the configurable waypoint-key default and retain Polish UI translations.
Zaktualizowałem ChannelWaypoints:
Punkty są teraz renderowane w świecie jako głowy z teksturą skina właściciela, z nickiem i aktualizowaną odległością. Domyślny klawisz tworzenia punktu to
/; skróty pozostają konfigurowalne.Serwer synchronizuje punkty tylko dla graczy z tego samego kanału i wymiaru. Po rozłączeniu usuwa punkt, ale zachowuje członkostwo w kanałach prywatnych do czasu zatrzymania serwera.
Zachowałem polski interfejs i dodałem
README.mdz instrukcjami instalacji. Ten sam mod JAR musi być zainstalowany u klientów i na serwerze, razem z Fabric API.
Nie mam potwierdzenia kompilacji ani testu z dwoma graczami, więc nie mogę twierdzić, że te testy przeszły. Osobny ZIP ze źródłami nie został utworzony. Aby wygenerować JAR w Kodari: kliknij Compile na górnym pasku, następnie Compile w oknie i Download po zakończeniu kompilacji.
9. Dynamic Waypoint Size, Outlines, and Vertical Light Beam
A. Distance-Based Waypoint Scaling
- The entire waypoint marker must become progressively larger as the viewer moves farther away from it.
- This scaling must apply to all waypoint elements together: the player's skin head, nickname, distance text, and their outlines.
- When the viewer is close to a waypoint, the marker should be relatively small and unobtrusive.
- As the viewer moves farther away, the marker must smoothly increase in size so it remains easy to see.
- Use smooth, continuous scaling rather than sudden size changes.
- Implement a configurable minimum size and maximum size.
- The marker must never grow infinitely large. Once it reaches its maximum size, it must remain at that size regardless of further distance.
- At a distance of approximately 100,000 blocks, the waypoint must still be clearly visible and recognizable.
- Design the scaling system specifically to make long-distance waypoint detection practical, including across large multiplayer worlds.
- Do not use a fixed maximum render distance of only a few hundred blocks. The waypoint marker should remain renderable at approximately 100,000 blocks, subject to Minecraft rendering limitations.
- Optimize rendering so that distant waypoints do not cause significant FPS drops.
- Keep the head, nickname, distance text, outline thickness, and light beam visually consistent as the marker scales.
B. Outlined Player Head
- Add a clearly visible outline around the entire player head icon.
- The outline must follow the shape of the head icon and remain visible against bright skies, dark terrain, caves, and other backgrounds.
- Use a high-contrast outline, preferably black or dark gray with a subtle bright edge.
- Do not cover or distort the actual Minecraft skin texture.
- Keep the outline crisp and properly aligned as the head changes size with distance.
C. Outlined Nickname and Distance Text
- Add a clear outline or stroke around the nickname displayed below the head.
- Add the same type of outline around the distance text displayed at the bottom.
- The outlines must improve readability against any background without making the text excessively thick.
- Use a dark outline with light-colored text for strong contrast.
- Keep all text centered relative to the player head.
- Ensure that the nickname and distance remain readable at extreme distances, including approximately 100,000 blocks.
- Prevent text clipping, overlapping, flickering, and disappearing when the waypoint scales.
D. White Vertical Light Beam
- Every active waypoint must emit a bright white vertical beam of light extending upward into the sky.
- The beam must originate precisely at the waypoint's world position.
- The beam must extend high into the sky and be visible from very long distances, ideally up to approximately 100,000 blocks away when the waypoint is within the supported world-rendering range.
- Use a clean, luminous white appearance with a slightly translucent outer glow.
- The beam must be easy to distinguish from the environment and must remain visible during daytime, nighttime, rain, and different weather conditions.
- The beam should resemble a tall beacon-like column of white light, not a short particle effect.
- Keep the beam vertically aligned with the waypoint coordinates.
- The beam must not obscure the player's head, nickname, or distance text.
- Ensure that the beam renders correctly in the Overworld, Nether, and End, while respecting dimension boundaries.
- The beam must be rendered client-side for performance, using an appropriate Fabric-compatible world-rendering method. It must not require sending thousands of particles every tick.
- The beam should have a narrow, bright central column and a subtle transparent glow around it.
- Optimize the beam rendering to avoid excessive GPU usage or FPS drops when many waypoints are visible.
- Only display beams for waypoints that the server has authorized the player to see.
E. Long-Distance Visibility and Performance
- Optimize waypoint rendering for extreme distances.
- Use camera-facing billboards for the head and text where appropriate.
- Ensure that distant markers remain visible without causing excessive flickering or visual distortion.
- Use appropriate depth testing and rendering settings so markers and beams are visible against the world while still behaving predictably behind terrain.
- If Minecraft's rendering engine or server configuration prevents visibility at exactly 100,000 blocks, document the limitation clearly and implement the best achievable behavior.
- Do not falsely guarantee visibility through unloaded chunks, across dimensions, or beyond the engine's practical rendering limits.
Final visual result: A distant waypoint should appear as a clearly visible white vertical light column, topped by a large outlined player-skin head, with an outlined nickname directly beneath it and an outlined distance label at the bottom. The entire marker must grow smoothly as the viewer moves farther away, up to a defined maximum size, while remaining recognizable at extreme distances.
Plan:
Inspect the existing waypoint renderer and locate its world-render hook.
Verify the exact 1.21.4 rendering APIs needed for billboards, outlines, and the beam.
Add capped distance scaling and client-side beam rendering, respecting authorized waypoint data and render limits.
Updated waypoint rendering with smooth distance-based scaling, outlined skin heads and text, and a translucent white vertical beam. Markers reach their configured maximum size at 100,000 blocks; the renderer adds no short-distance cutoff and keeps terrain depth testing.
The client creates config/channelwaypoints-render.properties with minimum-size and maximum-size settings (defaults: 0.75 and 1024; maximum allowed: 4096). Minecraft’s far plane and rendering precision can still prevent visibility at extreme distances, so 100,000-block visibility is not guaranteed.
I haven’t compiled or multiplayer-tested this change.
10. Extremely Large Waypoint Markers and Maximum Visibility
- Make the player's head and all waypoint text 5 times larger than the previous design. The head, nickname, and distance text must all be scaled up by exactly 5× relative to their original base size.
- Keep the head and text clearly readable, with a strong contrasting outline around the head, nickname, and distance.
- The waypoint must be designed for maximum possible visibility at any distance, including 100,000 blocks and beyond.
- The white vertical beacon beam must extend as high as technically possible and remain bright, distinctive, and easy to locate.
- Do not impose an artificial distance limit on waypoint rendering. The waypoint system should attempt to display authorized waypoints regardless of their distance from the player.
- Use distance-based scaling so the head and text become larger as the viewer moves farther away, while keeping the marker readable and limiting excessive growth.
- Optimize rendering so distant waypoints do not cause major performance problems.
- Important: Do not hide waypoints merely because they exceed a hardcoded distance threshold. However, if Minecraft's render distance, unloaded chunks, server synchronization, or engine limitations prevent truly infinite-distance visibility, implement the closest technically possible solution and clearly explain the remaining limitations. No finite rendering system can guarantee literal infinite visibility.
Inspect the current waypoint renderer and its documented limits.
Verify the exact Minecraft/Fabric rendering signatures it uses.
Apply the 5× base-size increase and preserve uncapped-distance rendering.
Applied a 5× multiplier to the complete waypoint scale, enlarging the head, nickname, distance label, outlines, and beam while preserving smooth distance scaling. Rendering still has no waypoint-distance cutoff; size saturates at the configured maximum, reached at 100,000 blocks.
Minecraft’s render distance, terrain occlusion, unloaded chunks, and rendering precision can still limit visibility at extreme distances. I haven’t compiled or tested this change.
📄
pasted-code-1792256222757.txt
txt
33 lines
▶
### 10. Unlimited-Distance Waypoint Visibility and Distance-Based Scaling
**A. Visibility at ANY distance**
- Waypoints must remain visible at every possible distance, whether the viewer is 100,000 blocks away, 10 million blocks away, or even farther.
- Do not use any maximum waypoint-rendering distance or distance-based culling.
- The waypoint system must support extremely long-distance server synchronization. Do not rely on nearby chunk loading to determine whether a waypoint exists.
- Use a suitable custom rendering and networking system to display distant waypoints even when the waypoint's chunk is not loaded.
- The waypoint's direction and position must remain accurate at extreme distances.
- Use a highly visible marker with an extra-large player head, nickname, and distance label, all with clear outlines.
- The system must attempt to display waypoints at every distance. If Minecraft's coordinate precision, rendering engine, network limits, or floating-point accuracy makes literal infinite-distance visibility impossible, implement the strongest technically feasible solution and explain any unavoidable limitations. Do not silently hide distant waypoints.
**B. Dynamic waypoint size**
- When the viewer is within **15 blocks** of a waypoint, the player's head and all text must use a small, compact size.
- At exactly 15 blocks, use the small base size.
- As the viewer moves farther away than 15 blocks, smoothly increase the size of the head, nickname, and distance text.
- At long distances, the marker must reach the large size specified in the previous requirements, with the head and text 5 times larger than the original design.
- Keep the scaling smooth and stable, without sudden jumps or flickering.
- The marker must remain easy to recognize from extremely far away. Avoid shrinking it to the point where it becomes invisible.
- Calculate the scaling from the actual distance between the viewer and the waypoint. Do not use a fixed size at all distances.
**C. Remove the white beam below the head**
- Remove the white light beam completely from the area below the player's head. There must be no visible white beam extending downward from the head toward the ground.
- Keep the white vertical beacon beam **only above the player's head**, extending upward into the sky as far as the rendering system allows.
- The beam must start at the top of the head or immediately above it and extend vertically upward.
- Do not render the beam through or below the head.
- Keep the beam bright and easy to locate from a great distance, with a narrow white core and a subtle glow.
**D. Final visual behavior**
- Nearby waypoint, 0 to 15 blocks: small head and small text, with the white beam visible only above the head.
- Distant waypoint: progressively larger head and text, eventually reaching the specified large size.
- Extremely distant waypoint, including 100,000 blocks and 10 million blocks: continue attempting to display the marker, nickname, distance, and upward white beam without an artificial distance cutoff.
- Preserve the player's actual skin on the head, keep the nickname and live distance readable, and ensure that only players authorized to see the waypoint can view it.
- Optimize the renderer and networking for performance, even when many distant waypoints exist.
Inspect the current renderer and registration path.
Verify the Minecraft/Fabric rendering signatures it uses before editing.
Implement 15-block small sizing, smooth growth to the existing 5× cap, and an upward-only beam; document unavoidable distance limits.
Updated waypoint scaling and beam rendering:
Markers remain at
minimum-sizethrough 15 blocks, then smoothly grow to 5×maximum-sizeat 100,000 blocks.Removed the beam segments below the head; the white beam now starts just above it and extends upward.
Kept distance-based rendering uncapped. Server sync sends authorized waypoints for the recipient’s current dimension without checking distance or chunk loading.
Documented that Minecraft’s render distance, terrain occlusion, and floating-point precision still prevent guarantees at extreme or infinite distances.
📄
pasted-code-1792256825224.txt
txt
36 lines
▶
### 11. Off-Screen Waypoint Indicator and Constant Marker Size
**A. Waypoint indicator when outside render distance**
- If a waypoint is farther away than the player's current Minecraft render distance, display a waypoint indicator directly in the center of the screen.
- The indicator must contain, vertically arranged:
1. The waypoint owner's player-skin head.
2. The owner's nickname directly underneath the head.
3. The remaining distance in blocks underneath the nickname, for example: `100,000 blocks away`.
- Keep the entire indicator centered horizontally on the screen, with the head at the top, the nickname below it, and the distance at the bottom.
- This indicator must work even when the waypoint is 100,000 blocks, 10 million blocks, or more away. It must not depend on the waypoint's chunk being loaded or the waypoint being inside the normal render distance.
- Calculate the direction and distance using accurate waypoint coordinates synchronized by the server.
- If multiple authorized waypoints are outside render distance, provide a way to identify the selected waypoint and switch between available waypoints. Never overlap multiple indicators in a confusing way.
- The off-screen indicator should be approximately **50% of the current normal waypoint head size**, making it about two times smaller than the current in-world waypoint head. Keep the nickname and distance text proportionally sized and readable.
- Give the head, nickname, and distance text a contrasting outline for readability.
**B. Switch to the normal waypoint automatically**
- When the selected waypoint enters the player's current render distance, automatically hide the centered screen indicator.
- At that point, display the waypoint in the Minecraft world using the normal waypoint rendering system, including the player's head, nickname, live distance, outline, and the white beam extending upward only.
- When the waypoint leaves render distance again, automatically restore the centered screen indicator.
- The transition must be seamless, with no flickering, duplicate indicators, or periods when the waypoint disappears.
- Determine whether to use the centered indicator or the in-world marker based on the actual configured render distance and the waypoint's position, not a hardcoded distance such as 100 or 1,000 blocks.
**C. Constant head size at every distance**
- Remove all distance-based shrinking of the waypoint head.
- The head must stay at a **constant visual size** regardless of whether the viewer is 1 block, 15 blocks, 100 blocks, or thousands of blocks away.
- Do not make the head smaller when the player approaches the waypoint.
- The normal in-world waypoint head must retain its current size at every distance. Keep the nickname and distance text consistently sized and readable as well.
- The smaller 50% size applies only to the centered off-screen indicator, not to the normal in-world waypoint.
- Keep the marker stable and readable without sudden size changes.
**D. Final behavior**
- Waypoint inside render distance: show the normal waypoint in the world, with a constant-size head and the white beam only above it.
- Waypoint outside render distance: show the smaller indicator in the center of the screen, with the head, nickname, and remaining distance.
- Waypoint entering or leaving render distance: switch automatically between these two display modes.
- Preserve server-authoritative coordinates, channel/private-channel permissions, and accurate distance calculations.
- Do not impose an artificial maximum distance for the centered indicator. Continue displaying it at extreme distances wherever the Minecraft client can represent the coordinates accurately.
Trace waypoint state, rendering, and client tick/screen hooks.
Check the exact Fabric/Minecraft APIs needed for render-distance switching and centered HUD rendering.
Add the off-screen indicator, automatic mode switch, and constant-size in-world markers.
Implemented the off-screen waypoint indicator.
Waypoints outside the configured render distance switch to a centered HUD marker with the owner’s skin head, outlined nickname, live distance, and compass direction. It uses synchronized waypoint data and does not require the waypoint’s chunk to be loaded.
The marker uses a fixed in-world scale; the HUD head is 24 px. When several waypoints are outside render distance, the indicator shows the selection count and N cycles through them. A waypoint returning within render distance switches back to the in-world marker.
The mode switch uses the configured view distance in chunks × 16, not a hardcoded waypoint limit. The HUD continues attempting to show distant waypoints, but Minecraft’s coordinate precision and rendering constraints mean infinite-distance visibility cannot be guaranteed.
I haven’t compiled this change.
📄
pasted-code-1792257916530.txt
txt
27 lines
▶
### 12. Final Waypoint Size and Off-Screen Indicator Design
**A. Normal waypoint inside render distance**
- The normal in-world waypoint must remain **large, bold, and highly visible**, using the large head and text size specified in the earlier requirements.
- Keep the player's head, nickname, and distance label at this large, constant visual size regardless of how close or far the viewer is.
- Do not shrink the normal waypoint when approaching it. Do not apply distance-based shrinking to its head or text.
- Keep the outline around the head and all text.
- The white beacon beam must appear only above the head, never below it.
**B. Off-screen indicator outside render distance**
- When the waypoint is outside the current render distance, show its indicator slightly below the exact center of the screen, rather than directly on the center point.
- Make the entire off-screen indicator slightly smaller than the previous version, while keeping it easy to read.
- The off-screen indicator must contain the player's skin head at the top, the nickname directly underneath, and the remaining distance below the nickname.
- Give the indicator a **transparent or semi-transparent background**. Do not use an opaque rectangle or solid panel. The Minecraft world must remain visible through the background.
- Keep the head and text clearly readable with subtle contrasting outlines or shadows.
- The off-screen indicator should be compact and unobtrusive, but the nickname and distance must remain legible.
- This smaller size applies only to the screen indicator outside render distance. It must never affect the size of the normal in-world waypoint.
**C. Automatic transition**
- Outside render distance: show the slightly smaller indicator below screen center with a transparent background.
- Inside render distance: hide the screen indicator and show the large normal in-world waypoint.
- Switch between these modes smoothly without flickering or temporarily losing the waypoint.
- Do not impose an artificial maximum distance on the off-screen indicator.
**D. Important size rule**
- The normal waypoint must retain the large size specified earlier. The only size reduction is for the off-screen indicator, which is slightly smaller than its previous screen-indicator version.
- Preserve the large, high-visibility head and text for the normal waypoint, along with the upward-only white beam.
Plan:
Preserve the fixed in-world marker scale.
Make the off-screen HUD marker slightly smaller and place it just below screen center.
Remove its panel fills so the world shows through, keeping the existing head and text outlines.
Updated the off-screen indicator: reduced the head from 24 to 20 px, shifted the layout 14 px below screen center, and removed the opaque panel. Head and text outlines remain; the fixed-size in-world marker is unchanged.
15. Always-Visible Directional Hologram, Red Backward Indicator, and 3.5× Size
A. Hologram must always indicate the correct direction
- The off-screen waypoint hologram must always remain visible whenever the waypoint is outside the player's render distance.
- Never hide the hologram because the player is looking in the wrong direction.
- Calculate the waypoint's actual compass direction relative to the player's viewing direction.
- Position the hologram around the screen according to the horizontal angle between the player's view and the waypoint's direction.
- If the player looks directly toward the waypoint, show the hologram near the center of the screen, slightly below center.
- If the player looks away from the waypoint, keep the hologram visible near the appropriate screen edge, indicating the direction in which the player must turn.
- The hologram must move smoothly as the player rotates, always representing the correct direction.
B. Correct left/right positioning
- Example: If the waypoint is directly east and the player looks south, the waypoint must appear near the far-left edge of the screen, because east is to the player's left when facing south.
- If the player faces north while the waypoint is east, the waypoint must appear near the far-right edge.
- If the waypoint is west while the player faces south, it must appear near the far-right edge.
- If the waypoint is behind the player, position the hologram on the side corresponding to the direction the player must turn toward.
- Use correct 360-degree angle calculations, including transitions across north, south, east, and west. Never reverse the left/right direction or make the hologram jump unpredictably.
C. Red hologram when facing the wrong direction
- When the waypoint is outside the player's forward viewing direction, display the entire hologram in red, including the head frame or outline, nickname, distance text, and directional indicator.
- Red means the player is not facing toward the waypoint and needs to turn.
- When the player turns toward the waypoint and it comes into the forward viewing direction, smoothly change the hologram back to its normal colors.
- The color must update continuously according to the actual angle between the player's view and the waypoint.
- Do not use red merely because the waypoint is far away. Use red specifically to indicate that the player is facing away from its direction.
- Keep all text readable against the game world, using a contrasting outline.
D. Increase waypoint size to 3.5×
- Increase the normal in-world waypoint's head, nickname, and distance text to 3.5 times their original base size.
- The large normal waypoint must remain at this 3.5× size regardless of the player's distance from it. Do not shrink it when the player approaches.
- Apply the same 3.5× scale to the off-screen hologram's head and text so it remains easy to see at extreme distances.
- Preserve the transparent background of the off-screen hologram.
- Do not multiply an already enlarged 5× size by another 3.5×. Set the final target to exactly 3.5× the original base size, replacing previous conflicting size multipliers.
- Keep the white beacon beam only above the head on the normal in-world waypoint.
E. Final behavior examples
- Waypoint east, player looking south: hologram near the far-left edge, red because the player is not facing east.
- Waypoint east, player looking north: hologram near the far-right edge, red.
- Waypoint east, player looking east: hologram near the center, in normal colors.
- Waypoint west, player looking south: hologram near the far-right edge, red.
- Waypoint outside render distance: always show its directional hologram, with nickname, remaining distance, transparent background, and the correct color.
- Waypoint inside render distance: show the large normal in-world waypoint instead of the off-screen hologram.
Plan:
Inspect the renderer’s current size, direction, and HUD logic.
Verify any Minecraft/Fabric API signatures needed for the adjustment against the 1.21.4 source.
Update direction placement/color and set both marker modes to exactly 3.5× base size.
Updated WaypointRenderer with the requested behavior:
The off-screen hologram now tracks the waypoint’s horizontal angle: east appears left when facing south and right when facing north. It stays visible at the corresponding screen edge when the waypoint is outside the horizontal view.
The hologram turns red outside the calculated horizontal FOV and returns to its normal colors when the player faces it. Its transparent background and skin image are preserved.
The in-world marker is fixed at 3.5× its previous base scale; the HUD head is 70 px and its text is scaled 3.5×. Removed the configurable marker-size override so it can’t conflict with that size.
The upward-only white beam remains in place.
📄
pasted-code-1792259590950.txt
txt
8 lines
▶
### Final Size Adjustments
- **Normal in-world waypoint:** Increase the player's head, nickname, and distance text to **5 times their current size**. The waypoint must be large, prominent, and easy to see. Keep this size constant at every distance. Do not shrink the waypoint when approaching it.
- **Off-screen directional hologram:** Make the entire hologram smaller than its current version. Reduce the head, nickname, distance text, and surrounding visual elements proportionally, keeping everything readable.
- The hologram must remain smaller than the normal in-world waypoint at all times.
- Preserve the transparent hologram background, dynamic screen positioning, correct directional indicators, and red coloring when the player is facing away from the waypoint.
- These are two separate size settings: the normal waypoint becomes **5× its current size**, while the off-screen hologram becomes smaller. Do not apply the 5× multiplier to the hologram.
- Apply these final size requirements instead of any conflicting earlier size instructions.
Set the in-world marker multiplier to 17.5× base, which is 5× its current 3.5× size.
Reduce the off-screen hologram multiplier from 3.5× to 2× so its head, text, spacing, and bounds shrink together.
Updated WaypointRenderer: the in-world marker is now 5× its previous size (17.5× base), while the off-screen hologram is reduced from 3.5× to 2×. Its head, text, spacing, and frame shrink proportionally; transparent background, directional positioning, and red facing-away indicator are unchanged.
📄
pasted-code-1792259948187.txt
txt
22 lines
▶
### 17. Server Separation and Final Size Adjustment
**A. Waypoints must disappear on other servers**
- Every waypoint must be associated with the exact Minecraft server on which it was created.
- If a player disconnects from that server and joins a different Minecraft server, all waypoints and off-screen holograms belonging to the previous server must immediately disappear.
- Do not display, synchronize, or retain visible waypoint markers from another server.
- When the player reconnects to the original server, load the currently valid waypoints for that server again, provided the player still has permission to see them.
- Treat different server addresses as separate waypoint environments, even if the servers use the same Minecraft world name or coordinates.
- Clear stale waypoint data on disconnect and server change to prevent markers from one server appearing on another.
- Global channels and private channels must also remain isolated between different servers.
**B. Make both markers slightly smaller**
- Make the normal in-world waypoint **slightly smaller than its current size**, reducing the player's head, nickname, and distance text proportionally.
- Make the off-screen directional hologram **slightly smaller than its current size** as well, reducing its head, nickname, and distance text proportionally.
- Keep both versions large enough to remain clearly visible and readable at their intended display distances.
- The normal waypoint must remain significantly larger than the off-screen hologram.
- Keep the normal waypoint's size constant regardless of the viewer's distance. Do not shrink it when approaching the waypoint.
- Preserve the hologram's transparent background, dynamic directional positioning, correct red/normal color behavior, and live distance display.
- These slight size reductions replace the most recent size settings. Do not apply the previous 5× increase on top of the new sizes.
**C. Final expected behavior**
- On the server where a waypoint was created, show the normal waypoint when
Trace waypoint storage and synchronization to find where server identity must be enforced.
Adjust the in-world and off-screen marker sizes while preserving their existing behavior.
Clear stale client waypoint state on disconnect/server changes and keep server/channel data isolated.
Updated disconnect cleanup and marker sizing.
On server disconnect, the client clears cached waypoints, channels, members, notices, and the selected off-screen marker. Joining a server requests fresh state, so old-server markers are not shown while connected elsewhere.
Reduced both marker sizes by 10%: the in-world scale is now 15.75× base, and the off-screen hologram is 1.8× base. The hologram remains proportionally smaller, with its transparent background and directional colors preserved.
Waypoint and channel data remain server-side; each server’s current channel permissions determine what is sent to a reconnecting player.
📄
pasted-code-1792261001074.txt
txt
213 lines
▶
# Channel Waypoints Mod for Minecraft Java 1.21.4
## 1. Project Requirements
Create or fix a complete Minecraft Java mod called **Channel Waypoints** using Fabric for Minecraft 1.21.4 and Java 21. The project must be compatible with IntelliJ IDEA and include all necessary source files, configuration files, networking code, rendering code, and build instructions.
Do not create only a visual mockup. All buttons, channels, waypoints, keybinds, and networking features must be implemented.
Preserve existing functionality wherever possible and incorporate every requirement below.
## 2. Main GUI
- Pressing the `0` key opens the Channel Waypoints GUI.
- The GUI must contain two tabs:
1. Public and private channels.
2. Keybind settings.
- Display five public channels, numbered 1 through 5.
- Clearly indicate the currently selected channel.
- Allow players to switch channels easily.
- Use a clean, modern Minecraft-style interface.
- Keep the GUI functional at different screen resolutions.
- Store user interface preferences and keybind settings where appropriate.
### Private channels
Under the five public channels, add a private-channel section.
- Place a button labeled `S` on the right to create a private channel.
- Place a button labeled `D` on the left to join a private channel.
- Clicking either button must open an input field centered on the screen for entering a private channel code.
- Creating a private channel generates a code that can be shared with other players.
- Joining requires the correct code.
- Validate private channel membership on the server.
- Players who are not members of a private channel must not receive or see its waypoint data.
## 3. Public Channel System
Implement five functional public channels that work in multiplayer.
- Players on the same supported Minecraft server can join any public channel.
- Players in the same channel can see each other's active waypoints.
- Players in different channels cannot see each other's waypoints.
- When a player joins a channel, immediately synchronize all existing waypoints in that channel.
- Switching channels must update actual membership, not just the GUI.
- Keep channel data isolated between different Minecraft servers.
- Clear stale waypoint data when disconnecting or switching servers.
- Use player UUIDs for identity instead of usernames alone.
### Multiplayer networking
Implement proper client-server networking for channel membership, waypoint creation, updates, deletion, and synchronization.
Include the necessary server-side component for supported servers. Do not claim that a client-only mod can synchronize custom waypoint data through every unmodified public server. If the server does not support the required networking, show a clear error message.
## 4. Waypoint Creation
- Pressing the `/` key creates a waypoint at the player's current position.
- Use a configurable keybind so the player can change this key in the settings tab.
- The player who creates a waypoint must see their own waypoint.
- Other eligible players in the same channel must receive it.
- Every player can have only one active waypoint at a time.
- Creating a new waypoint automatically replaces that player's previous waypoint.
- Waypoints must contain the owner's UUID, nickname, coordinates, dimension, channel, and server identity.
- Synchronize waypoint creation, replacement, and removal with eligible players.
- Handle multiplayer correctly rather than storing all data only on the local client.
## 5. Normal In-World Waypoint
Render a waypoint directly in the Minecraft world.
The waypoint must contain, from top to bottom:
1. A large 3D-rendered head using the owner's actual Minecraft skin.
2. The owner's nickname beneath the head.
3. The distance to the waypoint beneath the nickname.
### Rendering requirements
- Keep the head, nickname, and distance label at a constant apparent size on the screen, regardless of how far away the waypoint is.
- Do not make the normal waypoint shrink with distance.
- Make the waypoint clearly visible without blocking too much of the surrounding world.
- Keep the labels readable against different backgrounds.
- The head must use the correct player's skin, not a generic icon.
- Keep the waypoint's position accurate as the player moves.
- Ensure the rendering works in multiplayer and does not cause rendering errors.
### Beam
- Render a white beam above the player's head marker.
- The beam must extend upward only.
- Never render the beam below the head.
- Do not let the beam obscure the nickname or distance label.
## 6. Off-Screen Directional Hologram
When a waypoint is outside the normal Minecraft rendering distance, display an off-screen directional hologram on the player's screen.
The hologram must remain visible even when the waypoint is extremely far away.
### Hologram appearance
- Transparent background.
- Player's Minecraft skin head.
- Player's nickname.
- Remaining distance to the waypoint.
- Smaller than the normal in-world waypoint.
- Clean, readable text.
- No large opaque panel behind the hologram.
### Direction and screen position
Calculate the hologram's position from the actual direction and angle between the player's view and the waypoint.
- When the waypoint is in front of the player, position the hologram toward the center of the screen.
- When the waypoint is to the left, move it toward the left edge.
- When it is to the right, move it toward the right edge.
- When the waypoint is behind the player, position it at the appropriate screen edge.
- Do not hardcode separate behavior for north, south, east, or west.
- The position must work for every direction and every player rotation.
- The hologram must remain within the visible screen boundaries.
### Colors
- Use normal colors when the player is facing toward the waypoint.
- Turn the hologram red when the player is facing away from the waypoint.
- Calculate this using the relative direction between the player's camera and the waypoint, not fixed compass directions.
### Automatic transition
- When the waypoint is outside the normal rendering distance, show the directional hologram.
- When it enters the normal rendering distance, automatically switch to the normal in-world waypoint.
- Avoid flickering or rapid switching around the rendering-distance boundary.
- Continue displaying the hologram at distances such as 100,000 or 10,000,000 blocks, provided the server supplies valid waypoint coordinates.
- Do not introduce an arbitrary maximum waypoint distance.
- Use appropriate numeric precision and distance calculations to prevent overflow or rendering instability at large coordinates.
## 7. Waypoint Sound
- Play a short, subtle plopping sound when a new waypoint is created.
- The sound should resemble a small water droplet or soft notification.
- Play the sound for the creator and eligible players who receive the waypoint.
- Avoid playing the sound repeatedly during ordinary rendering or synchronization updates.
## 8. Keybind Settings Tab
The second GUI tab must display all relevant keybinds.
Include settings for:
- Opening the main GUI, default key `0`.
- Creating a waypoint, default key `/`.
Allow players to change the keybinds using Minecraft's standard keybinding behavior. Avoid conflicts with existing controls where possible.
## 9. Server and Session Isolation
- Waypoint data must belong to the current server session and the appropriate channel.
- Never display waypoint data from a different server.
- Clear client-side waypoint caches when leaving a server.
- Re-request valid data when reconnecting.
- Handle dimension changes and player disconnects.
- Prevent stale waypoint markers from remaining on screen.
- Ensure public and private channel data cannot leak between channels or servers.
## 10. Technical Requirements
- Minecraft Java Edition 1.21.4.
- Fabric Loader and a compatible Fabric API version.
- Java 21.
- IntelliJ IDEA project.
- Correct `fabric.mod.json`, Gradle configuration, entrypoints, keybindings, GUI classes, networking classes, waypoint storage, and rendering implementation.
- Use the correct APIs for Minecraft 1.21.4.
- Separate client-only rendering from server-side logic.
- Register networking payloads correctly for the selected Fabric API version.
- Validate all server requests and handle missing server support gracefully.
- Avoid placeholder methods, fake synchronization, unimplemented buttons, and pseudocode in the final implementation.
## 11. Required Testing
Test or provide a reproducible test procedure for all of the following:
1. Open the GUI with `0`.
2. Switch between all five public channels.
3. Create a waypoint with `/`.
4. Replace an existing waypoint with a new one.
5. Confirm the creator sees their own waypoint.
6. Confirm two players on the same supported server and in the same channel see each other's waypoints.
7. Confirm players in different channels cannot see each other's waypoints.
8. Confirm a newly joined player receives existing channel waypoints.
9. Create and join private channels using the `S` and `D` buttons.
10. Confirm private-channel isolation.
11. Confirm the white beam appears only above the head.
12. Confirm the normal waypoint stays the same apparent size at different distances.
13. Confirm the off-screen hologram follows the correct direction and turns red when the player faces away.
14. Confirm the automatic transition between the normal waypoint and off-screen hologram.
15. Confirm the waypoint sound plays only when appropriate.
16. Confirm switching servers clears old waypoints.
17. Compile the complete project successfully.
## 12. Final Deliverables
Provide:
- The complete project source code.
- Every required Java class and resource file.
- The complete project directory structure.
- Exact IntelliJ IDEA setup instructions.
- Instructions for building the mod using Gradle.
- The compiled JAR if the build succeeds.
- Instructions for installing the client mod and the required server-side component.
- A clear explanation of which features work on ordinary servers and which require server-side support.
Do not remove any requirement above. Do not silently replace multiplayer synchronization with local-only waypoint storage. Do not claim that the project compiles or works unless that has actually been verified.
Audit the existing mod against this specification and identify incomplete or broken features.
Verify the relevant Minecraft/Fabric signatures against the 1.21.4 source before changing code.
Implement the needed fixes, then report what is complete and what still needs server-side testing.
Updated the existing Channel Waypoints mod rather than replacing it with a mockup.
Added server-session and channel identity to waypoint synchronization. Client caches clear on server changes and reject waypoint data tagged for another session or channel; server lifecycle resets prevent stale data crossing server instances.
Added a clear warning when the connected server lacks the required mod support. Channel membership, private-channel authorization, and waypoint synchronization remain server-side.
Reworked the private-channel UI:
Djoins by invite code,Screates a channel, inputs open in a centered dialog, and the private-channel list can be scrolled. The settings tab now exposes all three keybinds.Updated waypoint rendering for constant apparent in-world marker size, a smaller off-screen hologram, camera-relative direction and red-facing-away tint, plus a transition buffer to reduce flicker. Eligible same-channel players in the same dimension receive the creation sound.
Corrected English localization and replaced outdated README claims with current behavior and a manual test procedure.
Compilation and multiplayer testing are not verified here. Waypoint and channel state is in memory: an owner’s waypoint is removed on disconnect, and server state resets on server stop. To build in Kodari, click Compile in the top bar (desktop) or ⋮ → Compile Project (phone); download the JAR from the successful build.
📄
pasted-code-1792320513503.txt
txt
687 lines
▶
# COMPLETE PROJECT SPECIFICATION: CHANNEL WAYPOINTS
## Minecraft Java Edition 1.21.4 | Fabric | Java 21
Create a complete, functional Minecraft Fabric mod called **Channel Waypoints** from scratch. This is a full implementation task, not a prototype or visual mockup.
The project must include the complete Minecraft client mod, an external multiplayer synchronization backend, all required resources and configuration files, build scripts, and detailed installation instructions.
Generate all source files automatically. Do not require me to create Java files, manually assemble the project, or write additional code.
Use Minecraft Java Edition 1.21.4, a compatible Fabric Loader and Fabric API version, and Java 21. Use APIs that actually exist in this Minecraft version.
---
# 1. CRITICAL BUG FIX: WAYPOINTS MUST WORK IN MULTIPLAYER
The current implementation has a serious bug: pressing the waypoint creation key does not create a waypoint when playing on a multiplayer Minecraft server. The feature may work in singleplayer, but it fails on multiplayer servers.
**Fix this problem before considering the mod complete.**
Investigate the actual cause rather than hiding the problem or simply rewriting the GUI.
Possible causes to investigate include:
- The keybinding is registered only in singleplayer or in the wrong client entrypoint.
- The key press is not detected correctly while connected to a multiplayer server.
- The waypoint creation method depends on an integrated singleplayer server.
- The code incorrectly requires direct access to server-side Minecraft classes.
- A multiplayer connection check prevents waypoint creation.
- The rendering code depends on local server data that is unavailable on a remote server.
- The external backend connection is missing, fails to connect, or does not handle errors.
- The client does not receive its own waypoint update.
- An exception occurs when the player or world is not yet available.
- The waypoint is created but immediately removed or filtered out.
- Client-only and common/server classes are incorrectly mixed.
- The networking implementation is incompatible with Fabric or Minecraft 1.21.4.
Implement the correct fix in the actual code.
### Required behavior
When a player joins any compatible multiplayer server and presses `/`:
1. Detect the key press reliably.
2. Check that the player and world are available.
3. Read the player's current coordinates and dimension.
4. Create the waypoint locally immediately.
5. Render the waypoint without waiting for a response from the backend.
6. Send the waypoint to the external synchronization backend asynchronously.
7. Synchronize the waypoint with eligible connected mod users.
8. Show a clear error message if synchronization fails, but do not silently discard the local waypoint.
9. Replace the player's previous waypoint if one already exists.
10. Log diagnostic information without flooding the chat.
The waypoint must also work in singleplayer.
Do not use singleplayer-only APIs as the foundation of waypoint creation. Do not require the Minecraft server to install this mod merely to display a locally created waypoint.
The creation key must work consistently in singleplayer, multiplayer, and supported dedicated-server environments.
---
# 2. PROJECT ARCHITECTURE
Build the project as two connected components.
## Component A: Fabric client mod
The client mod handles:
- GUI and channel selection.
- Keybindings.
- Local waypoint creation.
- Rendering player heads and labels.
- White waypoint beams.
- Directional off-screen holograms.
- Distance calculations.
- Sound effects.
- Backend connection.
- Receiving and displaying remote players' waypoints.
- Local cache management.
- Connection status and error messages.
## Component B: External synchronization backend
The backend handles:
- Client connections.
- Public channel membership.
- Private channel membership.
- Waypoint distribution.
- Synchronization of existing waypoints.
- Reconnection and session cleanup.
- Isolation between Minecraft servers.
- Basic abuse prevention and input validation.
- Authentication or another reliable way to prevent clients from impersonating other players.
The backend must be a separate application that can run on an internet-accessible host.
The Fabric mod must connect to a configurable backend address using a documented protocol.
Do not place backend source code inside the Minecraft JAR and assume it will automatically run on an external server. Provide separate deployment instructions.
Use a reliable asynchronous connection with reconnection handling, timeouts, heartbeat or connection health checks, and useful diagnostic logs.
---
# 3. COMPATIBILITY WITH ORDINARY MINECRAFT SERVERS
The primary objective is to let players use Channel Waypoints on ordinary Minecraft multiplayer servers without requiring the Minecraft server owner to install this mod.
The mod must not rely on custom server-side Fabric packets being accepted by every Minecraft server.
Instead, use the external synchronization backend to exchange waypoint data between mod clients.
### Server identification
Create a stable identifier for the current Minecraft server.
- Use the normalized server address where appropriate.
- Handle explicit ports consistently.
- Avoid accidentally mixing data from different servers.
- Use a documented identifier strategy for unusual addresses.
- Keep local singleplayer sessions separate from multiplayer servers.
- Do not use a player's nickname as the only server identifier.
All clients intending to share waypoints on the same Minecraft server must derive or configure compatible server identifiers.
Where possible, let users inspect and correct the server identifier if automatic detection produces inconsistent results.
### Important compatibility rules
- Do not require the Minecraft server to install the mod.
- Do not attempt to bypass server permissions, anti-cheat restrictions, or network security controls.
- Respect the server's rules and any restrictions on client modifications.
- Do not assume that every server permits external network connections.
- Show a useful message if the backend is unavailable or the connection is blocked.
- Explain that sharing waypoints requires the other players to use a compatible mod and connect to the same backend.
A client-only mod cannot magically obtain another player's private client data. The other player's mod must share that player's waypoint through the backend.
---
# 4. PUBLIC CHANNEL SYSTEM
Implement exactly five public channels:
- Channel 1
- Channel 2
- Channel 3
- Channel 4
- Channel 5
Players can join any public channel.
Players who are connected to the same Minecraft server and belong to the same public channel must be able to share their active waypoints.
Players in different channels must not receive each other's waypoint updates.
### Required synchronization
When a player joins a channel:
1. Register the player's channel membership with the backend.
2. Request the currently active waypoints for that channel and server.
3. Receive and display the existing waypoints.
4. Subscribe to new waypoint updates.
5. Remove or hide waypoints that do not belong to the selected channel.
When a player switches channels:
- Update membership immediately.
- Remove markers that are no longer visible to the player.
- Receive the waypoint list for the newly selected channel.
- Avoid duplicating waypoint entries.
- Ensure that updates from the previous channel cannot reappear afterward.
Channel membership must be maintained by the backend, not just by the local GUI.
Do not simulate channel functionality by changing a label without changing actual membership.
---
# 5. PRIVATE CHANNELS
Under the five public channels, add a private-channel section.
The GUI must contain:
- A `D` button on the left for joining a private channel.
- A `S` button on the right for creating a private channel.
- A centered code-entry interface.
- A clear display of the current private channel.
- A way to copy the invitation code.
### Creating a private channel
When the user presses `S`:
1. Create a private channel through the backend.
2. Generate a sufficiently random invitation code.
3. Register the creator as a member.
4. Display the code clearly.
5. Provide a copy-to-clipboard option.
### Joining a private channel
When the user presses `D`:
1. Display the code-entry field.
2. Let the user enter the invitation code.
3. Validate the code with the backend.
4. Join the channel only if the code is valid.
5. Display an understandable error for invalid or expired codes.
Private-channel membership must be validated by the backend.
Do not trust a client simply because it claims to know a channel identifier.
Players outside a private channel must not receive its waypoint data.
The backend must enforce private-channel isolation even if a modified client attempts to subscribe to another channel.
---
# 6. MAIN GUI
Pressing `0` opens the main Channel Waypoints GUI.
The interface must include two tabs.
## Tab 1: Channels
Display:
- Five public channels.
- The currently selected channel.
- A private-channel section.
- The `D` and `S` buttons.
- The private-channel code-entry interface.
- A clear connection indicator showing whether the external backend is connected.
## Tab 2: Keybinds
Display all relevant keybindings and allow the user to change them.
Required default bindings:
- Open GUI: `0`.
- Create waypoint: `/`.
Use Minecraft's standard keybinding system and avoid duplicate registrations.
The GUI must:
- Work at different screen resolutions.
- Have readable text and consistent spacing.
- Clearly show selected states.
- Handle mouse clicks correctly.
- Never freeze the game while waiting for backend responses.
- Display meaningful error messages.
- Preserve settings where appropriate.
The `0` and `/` bindings must not stop working after joining a multiplayer server.
---
# 7. WAYPOINT CREATION AND REPLACEMENT
Pressing `/` creates a waypoint at the player's current position.
Every player may have only one active waypoint at a time.
When that player creates another waypoint:
- Replace the old waypoint.
- Remove the previous marker from eligible viewers.
- Publish the new waypoint.
- Ensure that the old marker cannot return because of a delayed update.
Each waypoint must contain:
- Player UUID or another reliable authenticated player identifier.
- Player nickname.
- X coordinate.
- Y coordinate.
- Z coordinate.
- Minecraft dimension.
- Channel identifier.
- Minecraft server identifier.
- A unique waypoint revision or update identifier.
- A timestamp or session identifier where necessary.
The creator must immediately see their own waypoint.
Eligible players must receive the new waypoint through the backend.
Use asynchronous networking. Do not block the rendering thread while waiting for the backend.
Handle failed requests, disconnections, reconnects, duplicate messages, stale updates, and malformed payloads.
---
# 8. PLAYER SKIN HEAD
The normal waypoint must show a large head using the actual Minecraft skin of the player who created it.
Requirements:
- Use the correct skin texture.
- Support standard Minecraft skins.
- Handle skin loading delays.
- Handle missing or unavailable textures gracefully.
- Cache textures safely.
- Avoid downloading the same texture repeatedly.
- Never substitute another player's skin accidentally.
The skin head must remain readable at different distances.
---
# 9. NORMAL IN-WORLD WAYPOINT
The normal waypoint must contain three elements arranged vertically:
1. A large player head.
2. The player's nickname underneath.
3. The distance to the waypoint beneath the nickname.
### Constant apparent size
The head, nickname, and distance label must maintain a constant apparent screen size as the camera moves closer to or farther from the waypoint.
Do not allow the marker to shrink into an unreadable speck at long distances.
Implement distance-aware scaling or another appropriate rendering technique that preserves the intended screen-space size.
The waypoint must remain anchored to its actual world position and must not drift when the player moves.
### Text readability
- Use a contrasting outline or shadow around the nickname.
- Use a contrasting outline or shadow around the distance.
- Keep labels readable against bright and dark terrain.
- Avoid unnecessary opaque backgrounds.
- Keep the head, nickname, and distance aligned.
Do not let the waypoint obstruct the entire screen.
---
# 10. WHITE VERTICAL BEAM
Render a white beam above the waypoint head.
Requirements:
- The beam extends upward only.
- It must never extend below the head.
- It must be visually white.
- It must not cover the nickname or distance text.
- It must follow the waypoint's world position.
- It must render correctly at different distances.
- It must not create excessive rendering or performance costs.
Do not implement the beam as a line that extends in both directions from the head.
---
# 11. OFF-SCREEN DIRECTIONAL HOLOGRAM
When the waypoint is outside the normal rendering range, display a directional hologram on the screen.
The hologram must contain:
- The player's skin head.
- The player's nickname.
- The remaining distance.
- A transparent or semi-transparent background.
- A size slightly smaller than the normal in-world waypoint.
The hologram must remain visible even when the waypoint is far beyond the normal world rendering distance.
### Dynamic positioning
Calculate the relative angle between the camera's viewing direction and the horizontal direction toward the waypoint.
Use this angle to determine the hologram's screen position.
- Waypoint in front: position toward the center of the screen.
- Waypoint to the left: move toward the left edge.
- Waypoint to the right: move toward the right edge.
- Waypoint behind the player: position at the appropriate screen edge.
Do not hardcode specific behaviors for north, south, east, or west.
The system must work across the full 360-degree horizontal rotation and for every player orientation.
Keep the hologram within the screen boundaries and ensure that it does not flicker as the player rotates.
### Color behavior
- Use normal colors when the player faces toward the waypoint.
- Turn the hologram red when the player faces away from the waypoint.
- Calculate this using the relative camera direction and waypoint direction.
Do not determine red or normal status using fixed compass directions.
### Transition between modes
When the waypoint enters the normal in-world rendering range:
- Hide the directional hologram.
- Display the normal in-world waypoint.
When the waypoint leaves that range:
- Hide the normal marker if appropriate.
- Display the directional hologram.
Use a small hysteresis margin or equivalent logic to prevent rapid switching near the range boundary.
### Very large distances
Support waypoint distances such as:
- 100,000 blocks.
- 10,000,000 blocks.
Do not impose an arbitrary small maximum distance.
Use robust distance and angle calculations to avoid numeric overflow and unnecessary precision loss.
The backend must continue transmitting valid coordinates regardless of how far away the waypoint is. A waypoint cannot be displayed if its data is unavailable, invalid, or deliberately blocked by the server or network.
---
# 12. WAYPOINT SOUND
When a new waypoint is created, play a short, subtle sound resembling a small water droplet or soft plop.
The sound must:
- Play for the creator.
- Play for eligible connected players receiving the new waypoint.
- Not repeat on ordinary rendering frames.
- Not repeat for every synchronization heartbeat.
- Not play when the same waypoint is received repeatedly as a duplicate update.
Use a suitable Minecraft sound or implement an appropriate sound resource if needed.
---
# 13. EXTERNAL BACKEND IMPLEMENTATION
Generate the entire backend source code automatically.
Use a maintainable server implementation with a documented protocol. A Node.js backend using WebSockets is acceptable.
Generate all required backend files, including:
- `package.json`.
- Backend entrypoint such as `server.js`.
- Configuration and environment-variable handling.
- Message validation.
- Connection management.
- Channel membership management.
- Waypoint storage and synchronization.
- Error handling.
- Tests where practical.
- A complete README with setup and deployment instructions.
### WebSocket protocol
Implement messages for:
- Connecting and authenticating.
- Joining a public channel.
- Creating a private channel.
- Joining a private channel.
- Changing channels.
- Requesting existing waypoints.
- Creating or replacing a waypoint.
- Removing a waypoint.
- Receiving waypoint updates.
- Receiving waypoint lists.
- Reporting errors.
- Reconnecting and restoring membership.
Define the exact JSON schema for every message and use the same schema in the Fabric client and backend.
Do not leave the protocol ambiguous.
### Synchronization rules
The backend must:
- Route waypoint updates only to authorized users in the same Minecraft server group and channel.
- Send existing active waypoints when a user joins.
- Replace the previous waypoint when its owner creates a new one.
- Remove stale waypoints when the owner disconnects or the session expires, according to a documented policy.
- Clear or invalidate data from obsolete sessions.
- Avoid sending duplicate updates unnecessarily.
- Enforce private-channel permissions on the backend.
- Validate message sizes and all coordinate values.
- Rate-limit waypoint creation and other sensitive operations.
- Handle unexpected client disconnections.
- Avoid exposing internal errors, secrets, or other users' private data.
### Identity and security
Do not treat a client-provided UUID or nickname as proof of identity.
Design an authentication mechanism that prevents trivial impersonation and document its limitations. If the system uses guest identities, explicitly state that they are not equivalent to verified Minecraft account identities.
Never request or transmit Minecraft account passwords, session tokens, or other Minecraft authentication secrets to the backend.
Use secure WebSockets (`wss://`) for public internet deployment.
Include a configurable backend URL rather than hardcoding localhost into the release build.
Do not ship a public server with an embedded administrator secret.
### Hosting
Provide instructions to run the backend locally for development and to deploy it to an internet-accessible host.
Explain that `localhost` works only for programs running on the same machine.
The Minecraft client mod must be configurable to connect to the deployed backend.
If the hosting platform requires a particular port, environment variable, or start command, document it.
Do not claim that a backend is publicly hosted unless it has actually been deployed and tested.
---
# 14. BACKEND AND CLIENT MUST ACTUALLY CONNECT
This is a critical requirement.
Do not generate a backend that is never used by the mod.
Do not generate a client that connects to a nonexistent endpoint.
The client and backend must share the exact same message schemas, field names, protocol version, and channel semantics.
Implement:
- Connection initialization.
- Connection status tracking.
- Asynchronous sending and receiving.
- JSON serialization and deserialization.
- Reconnection with reasonable backoff.
- Timeout handling.
- Error reporting.
- Session cleanup.
- Safe main-thread scheduling for Minecraft rendering and GUI changes.
If the backend is disconnected, local waypoint creation should still work and the GUI should explain that sharing is temporarily unavailable.
After reconnecting, the mod should rejoin the selected channel and request fresh waypoint data.
Prevent stale messages from previous sessions or channels from restoring obsolete waypoint markers.
---
# 15. SERVER AND DIMENSION ISOLATION
Waypoints must not leak between unrelated Minecraft servers.
Store the server identifier and dimension with every waypoint.
The backend must use the normalized server identifier and channel membership to determine which users may receive a waypoint.
Handle:
- Connecting to a different server.
- Disconnecting.
- Reconnecting to the same server.
- Changing channels.
- Changing dimensions.
- Backend reconnections.
- Stale cached waypoints.
- Duplicate player sessions.
Do not assume that two servers are the same because they share a hostname pattern or because the player uses the same nickname.
For dimension changes, follow a consistent documented policy. Do not show a waypoint as if it were in the current dimension when it belongs to another dimension unless the GUI explicitly identifies it as a different-dimension waypoint.
---
# 16. PERFORMANCE AND RELIABILITY
The mod must not noticeably reduce Minecraft performance.
Requirements:
- Do not create a new thread every frame.
- Do not open a new network connection for every waypoint update.
- Do not perform blocking network operations on the render thread.
- Cache skin textures.
- Avoid rendering invisible or unauthorized waypoints.
- Clean up unused resources.
- Limit duplicate packets and repeated notifications.
- Avoid memory leaks during repeated server changes.
- Handle missing textures and network errors safely.
- Use thread-safe communication between networking and rendering.
- Keep rendering and GUI changes on the appropriate Minecraft client thread.
Add useful logs for debugging the multiplayer waypoint creation problem.
Avoid flooding the console or chat with repeated errors.
---
# 17. TESTS AND DEBUGGING
Create automated tests for backend functionality where practical.
Provide a reproducible test plan for the Fabric client and backend.
At minimum, verify or explicitly document how to test:
1. Launching the mod in singleplayer.
2. Creating a waypoint with `/` in singleplayer.
3. Joining a remote multiplayer server.
4. Creating a waypoint with `/` on that multiplayer server.
5. Confirming that the waypoint immediately appears for its creator.
6. Confirming that the waypoint is sent to the backend.
7. Confirming that another client receives the waypoint.
8. Confirming that two players in public Channel 2 can see each other's waypoints.
9. Confirming that different public channels remain isolated.
10. Creating and joining a private channel.
11. Confirming that non-members cannot receive private-channel waypoints.
12. Replacing a previous waypoint.
13. Removing stale waypoint markers after disconnection.
14. Switching Minecraft servers.
15. Reconnecting to the backend.
16. Rendering player skin heads.
17. Rendering the white upward-only beam.
18. Keeping the normal waypoint at a constant apparent size.
19. Showing directional holograms outside rendering range.
20. Testing hologram direction and red status while rotating through 360 degrees.
21. Testing large waypoint distances.
22. Testing invalid messages and backend failures.
23. Testing the project build with the required Java version.
Include clear diagnostic logs for the multiplayer creation failure. The logs should make it possible to determine whether the key press was detected, the local waypoint was created, the backend connection was available, the message was sent, and a response was received.
Do not mark a test as passed unless it has actually been run successfully.
---
# 18. FINAL PROJECT DELIVERABLES
Generate the complete project automatically.
Deliver:
1. Full Fabric client mod source code.
2. Full external backend source code.
3. All Java classes.
4. All required resource files.
5. Correct `fabric.mod.json`.
6. Complete Gradle configuration.
7. Correct dependency declarations.
8. Backend package configuration.
9. The documented WebSocket protocol.
10. Automated tests where practical.
11. README files with step-by-step instructions.
12. Instructions for opening the project in IntelliJ IDEA.
13. Instructions for building the Fabric JAR.
14. Instructions for installing the mod.
15. Instructions for deploying and configuring the backend.
16. Troubleshooting instructions for multiplayer waypoint creation.
17. A downloadable ZIP containing the complete source project, if the platform supports file generation.
18. The compiled JAR, only if the build actually succeeds.
Keep the Fabric client mod and backend organized in clearly separated directories inside the project.
The result must be a real implementation, not merely a plan or a set of disconnected code snippets.
Do not omit features because they are difficult. Do not replace networking with fake local-only synchronization. Do not silently remove any requirements.
If a feature cannot be completed or tested in the current environment, clearly identify the limitation and provide the most complete correct implementation possible.
**Highest priority: fix the multiplayer waypoint creation bug, implement working client-to-backend communication, and verify the complete flow with two separate mod clients.**
Inspect the existing project and trace why waypoint creation fails in multiplayer.
Implement the client-side waypoint, GUI, and backend synchronization using verified 1.21.4 APIs.
Add the separate backend, shared protocol, configuration, and essential documentation/tests.
Multiplayer creation fixed: the
/handler previously required the Minecraft server to support the mod’s custom payloads, so it did nothing on ordinary servers. It now creates, replaces, renders, and plays the sound for a local waypoint immediately; backend sharing happens asynchronously and failures leave the local marker intact.Added the separate WebSocket backend: public and private channel membership, server/channel isolation, waypoint snapshots and updates, disconnect cleanup, rate limits, heartbeat handling, reconnects, and private-code restoration are implemented. The mod is client-only; Minecraft servers do not need it.
Updated the GUI and documentation: connection status, current channel, invite copying, keybind settings, backend configuration, protocol, deployment guidance, and manual test steps are included.
Verification limits: backend tests are included but could not be run because Node.js is unavailable here. I did not verify a Fabric build or a live two-client session, and no public backend or compiled JAR is claimed. The backend URL must be configured; without it, waypoints remain local.
📄
pasted-code-1792323068971.txt
txt
49 lines
▶
## Waypoint Head, Nickname Position, and Distance Scaling Fix
Modify the existing waypoint rendering while preserving all other features.
### 1. 2D Player Head
- Render the player's Minecraft skin head as a flat 2D image, not a 3D model.
- Keep the head centered horizontally above the nickname.
- When the player moves farther away from the waypoint, the head must become smaller.
- At a greater distance, while the waypoint is still within Minecraft's normal render distance, the head must be approximately 2 times smaller than its current size at the closer reference distance.
- Implement smooth, distance-based scaling rather than an abrupt size change.
- Keep the head visible and recognizable.
- Do not make the head grow beyond its original close-range size.
### 2. Nickname Position
- Place the player's nickname directly below the head.
- Center the nickname horizontally relative to the head.
- Keep the nickname readable with a contrasting outline or shadow.
- Do not place the nickname beside the head.
### 3. Correct World Y Coordinate
- The waypoint head must remain anchored to the exact world-space Y coordinate at which the waypoint was created.
- The head must not move vertically when the player approaches, moves away, or changes camera angle.
- The nickname must be rendered directly below the head as part of the waypoint's visual layout.
- Calculate the nickname's screen position relative to the head without changing the waypoint's underlying world coordinates.
- Do not add artificial vertical offsets to the waypoint's actual world position.
- Distance-based scaling must not cause the waypoint to drift away from its original world position.
### 4. Distance Label
- Display the distance below the nickname.
- Keep it centered and readable.
- Update the displayed distance as the player moves.
### 5. Rendering Behavior
- Apply the same 2D head style to the normal waypoint and the off-screen directional hologram.
- For the normal in-world waypoint, scale the head smoothly with distance, reaching approximately half its current size at a suitably greater distance within render distance.
- Preserve the correct world-space anchor while scaling the visual elements.
- Prevent flickering, sudden jumps, and inconsistent alignment.
### 6. Preserve Existing Functionality
Do not modify:
- Waypoint creation using `/`.
- Multiplayer waypoint synchronization.
- Public or private channels.
- Backend networking.
- The white beam above the head.
- Waypoint sounds.
- GUI or keybindings.
Only change the waypoint's head rendering, distance-based head scaling, nickname placement, and associated visual alignment.
Plan:
Flatten the in-world skin head to the same 2D face-and-overlay style as the HUD indicator.
Smoothly taper head and label scale with distance while keeping the waypoint anchor fixed and leaving the beam unchanged.
Keep nickname and live distance centered beneath the head in both render paths.
Updated WaypointRenderer:
Replaced the in-world 3D head with a flat skin-face and overlay, matching the HUD indicator’s 2D style.
Anchored the head’s center at the waypoint’s exact world position. Nickname and distance are centered below it with smooth distance-based scaling; the head reaches half size at render distance and never grows beyond its close-range size.
Left the white beam and off-screen indicator behavior unchanged.
📄
pasted-code-1792324333861.txt
txt
80 lines
▶
# WAYPOINT VISUAL IMPROVEMENTS AND WALL-PENETRATING RENDERING
Modify the existing Minecraft Java Edition 1.21.4 Fabric mod. Do not remove or break any existing features. Implement all changes directly in the actual rendering code.
## 1. Smaller, symmetrical player head
- Reduce the waypoint player head to approximately **50% of its current size**.
- Make it perfectly symmetrical, with equal width and height.
- Keep it flat and 2D, centered, without stretching or distortion.
- Display the correct Minecraft skin head of the player who created the waypoint.
- Preserve the correct skin texture and orientation.
## 2. Nickname and distance
Arrange all elements vertically and center them:
1. Player's head.
2. Creator's Minecraft nickname directly below the head.
3. Distance to the waypoint directly below the nickname.
Display the distance dynamically, updating as the player moves. Keep the text readable and properly aligned. Add a subtle outline or shadow to the nickname and distance text so they remain legible against any background.
## 3. Outline and overall size
- Add a clean, subtle outline around the player head.
- Give the nickname and distance text a readable outline or shadow.
- Reduce the overall waypoint size to approximately 50% of its current size.
- Keep the design compact and consistent.
## 4. Constant apparent size at different distances
The waypoint must maintain approximately the same apparent screen size regardless of its distance from the player.
- Compensate for perspective so the waypoint does not become progressively smaller when far away.
- Clamp the maximum scale so that the waypoint does not grow excessively at long distances.
- Avoid sudden jumps in size when the distance changes.
- Keep the waypoint anchored to its correct world coordinates. Do not make it drift or float toward the camera.
## 5. Smooth transition at very close range
When the player approaches a waypoint, smoothly reduce the normal world-space waypoint until it matches the size and proportions of the directional hologram.
- Apply the transition to the head, nickname, distance text, and outline.
- Use smooth interpolation rather than an abrupt size change.
- Avoid flickering, duplicate markers, and sudden jumps.
- Ensure the normal waypoint and directional hologram look consistent in design, proportions, and text layout.
## 6. Make waypoints visible through walls and blocks
**Waypoints must remain clearly visible even when solid blocks completely obstruct the line of sight.**
- Render the player head, nickname, distance text, outlines, and white vertical beam through walls, terrain, buildings, caves, and other solid blocks.
- Use a suitable through-wall rendering technique compatible with Fabric and Minecraft 1.21.4, such as controlled depth-test handling or an appropriate rendering layer.
- Do not simply make the waypoint transparent. It must remain clearly visible through solid objects.
- Keep the waypoint at its correct world position. Do not move it to the camera or attach it to the surface of a wall.
- Apply this behavior to both locally created waypoints and waypoints received from other players through the multiplayer backend.
- Restore all modified rendering states after rendering, including depth testing, depth writing, blending, and shader state, to avoid affecting normal Minecraft graphics.
## 7. Preserve existing features
Do not break or remove any of the following:
- Press `/` to create a waypoint.
- Show the creator's own waypoint immediately.
- Play the waypoint creation sound.
- Allow only one active waypoint per player, replacing the previous one when a new one is created.
- Keep the five public channels and private channels with invitation codes.
- Synchronize waypoints between players using the existing multiplayer backend.
- Preserve the GUI, keybind settings, white beam, and directional hologram.
- Keep the existing server and channel isolation.
- Ensure waypoint creation works in multiplayer and singleplayer.
- Do not make waypoint creation depend on a successful backend response. Display the local waypoint immediately and synchronize it asynchronously.
## 8. Compatibility and testing
Implement the changes in the actual Java rendering code. Do not provide only pseudocode, design suggestions, or configuration values.
Check compatibility with Minecraft Java 1.21.4, Fabric, and Java 21. Test the result at close and long distances, through solid blocks, underground, and in multiplayer. Verify that the waypoint does not flicker, distort, drift, grow excessively, or disappear behind walls.
**Expected result:** A compact, symmetrical waypoint with a bordered player head, nickname, and distance underneath. It stays approximately the same size at different distances, smoothly transitions to the directional hologram when very close, and remains visible through walls and solid blocks without breaking normal Minecraft rendering.
Plan:
Inspect the current waypoint renderer and identify the normal and directional render paths.
Verify the 1.21.4 rendering APIs needed for fixed-size, through-wall drawing from the source.
Update only the rendering code, preserving waypoint creation, synchronization, beam, and controls.
Updated WaypointRenderer only. The in-world head is half its previous base size and smoothly shrinks near the waypoint to match the smaller directional HUD head. The HUD panel is also halved; creator name and live distance remain centered below the head with outlines.
The skin head, text, and white beam now render through blocks. Depth state is captured and restored around buffered draws, and the waypoint’s world-space head anchor and beam placement are preserved. I haven’t run live in-game checks for distance, occlusion, or multiplayer behavior.
📄
pasted-code-1792325957966.txt
txt
50 lines
▶
# FIX: FULL WAYPOINT VISIBILITY THROUGH WALLS + 3-BLOCK VERTICAL OFFSET
Modify the existing Minecraft Java 1.21.4 Fabric mod and implement the following changes directly in the rendering code.
## 1. Make the ENTIRE waypoint visible through walls
The complete waypoint must be visible through all solid blocks, including walls, terrain, floors, ceilings, and buildings.
This applies to every visual element:
- The entire player head.
- The complete nickname.
- The distance text.
- All outlines and borders.
- The entire white vertical beam.
- Every other visual element belonging to the waypoint.
Technical requirements:
- Use a proper through-wall rendering method compatible with Fabric and Minecraft 1.21.4.
- Ensure every waypoint component is rendered without being hidden by the Minecraft depth buffer.
- If necessary, use a dedicated rendering pass with depth testing disabled, then restore all Minecraft rendering states correctly.
- Check every separate rendering layer. It is not sufficient to make only the head or beam visible through walls.
- Keep the waypoint fully readable and correctly oriented, with no clipping, flickering, missing text, or disappearing borders.
- Apply this to both local and multiplayer waypoints, including directional holograms.
- Do not change the waypoint's horizontal position or make it follow the camera.
## 2. Position the entire waypoint exactly 3 blocks above its creation position
When a player creates a waypoint, display the entire waypoint **3.0 Minecraft blocks above the original creation position**.
Example:
- Original waypoint Y coordinate: `56`
- Displayed waypoint Y coordinate: `59`
Implementation requirements:
- Calculate the displayed position using `displayY = originalY + 3.0`.
- Apply the offset consistently to the head, nickname, distance label, outline, and vertical beam.
- Keep the original waypoint coordinates stored separately from the displayed coordinates.
- Use the same offset for local waypoints and waypoints received from other players.
- Ensure the distance calculation uses the displayed waypoint position, so the displayed distance matches the marker's actual visual location.
- Do not add the offset repeatedly every frame or every time the waypoint updates. Apply it exactly once when calculating the rendered position.
- Preserve the original X and Z coordinates.
- Keep the waypoint anchored to the correct world location.
## 3. Preserve all existing features
Do not break the reduced symmetrical head, nickname and distance layout, outlines, consistent apparent size, smooth close-range transition to the hologram, creation key `/`, sounds, channels, private invitation codes, multiplayer synchronization, or GUI.
Implement and test the actual code. Do not merely describe the changes.
**Expected result:** The complete waypoint, including all text and the white beam, remains visible through every wall and solid block. A waypoint created at Y=56 is displayed at Y=59, exactly three blocks higher.
Plan:
Trace waypoint rendering and coordinate flow, including every layer and distance calculation.
Verify the exact 1.21.4 rendering signatures needed to make every component render through blocks.
Apply the one-time +3 Y display offset and complete through-wall rendering without changing stored coordinates.
Updated WaypointRenderer so local and multiplayer waypoints render at their stored X/Z coordinates and Y + 3.0, without changing stored waypoint data. The world and directional-HUD distance calculations now use that displayed position.
The head, outlined labels, and beam use an isolated render buffer with depth set to always-pass during waypoint rendering, then restore the shader and depth function. I haven’t verified the result in a live game.
📄
pasted-code-1792337325511.txt
txt
30 lines
▶
# WAYPOINT SIZE REDUCTION: 3 TIMES SMALLER
Modify the existing Minecraft Java 1.21.4 Fabric mod.
Reduce the **entire waypoint to one-third of its current apparent size (scale = 0.333)**.
Apply this reduction consistently to every component:
- Player head.
- Nickname.
- Distance text.
- All outlines and borders.
- White vertical beam.
- Directional hologram and its contents.
Requirements:
- Keep the head symmetrical and undistorted.
- Preserve the layout: head on top, nickname below, distance underneath.
- Keep all elements centered and proportional.
- Preserve readability and ensure text does not overlap.
- Maintain the existing constant apparent size at different distances, with the same maximum scale limits.
- Preserve the smooth transition to the directional hologram at close range.
- Keep the entire waypoint visible through walls and solid blocks.
- Preserve the vertical offset of exactly +3.0 blocks from the original waypoint position.
- Do not change the waypoint's actual stored coordinates.
- Avoid shrinking the waypoint repeatedly every frame. Apply the scale reduction consistently in the rendering calculations.
- Do not alter waypoint creation, multiplayer synchronization, channels, private codes, sounds, or GUI functionality.
Implement the change in the actual rendering code and test all waypoint components.
**Expected result:** The complete waypoint is approximately three times smaller than it is now, with all proportions preserved.
Plan:
Read the current renderer to locate each world and directional-hologram scale.
Apply a single 0.333 multiplier consistently without changing existing distance limits, transitions, or waypoint coordinates.
Reduced the rendered waypoint to approximately one-third size in WaypointRenderer. The world head, labels, outline, and beam scale down through the existing marker scale; the offscreen directional hologram’s head, text, and layout use the corresponding one-third multiplier. Existing distance scaling, close-range transition, through-wall rendering, and +3 Y display offset are unchanged. I haven’t run live in-game testing.
package com.kodari.channelwaypoints;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.Text;
import org.lwjgl.glfw.GLFW;
import java.net.IDN;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.UUID;
import java.util.logging.Logger;
public class ChannelWaypointsClient implements ClientModInitializer {
private static final Logger LOGGER = Logger.getLogger("channelwaypoints");
private static final BackendClient BACKEND = new BackendClient();
private static KeyBinding openMenuKey;
private static KeyBinding createWaypointKey;
private static KeyBinding nextWaypointKey;
static String selectedChannel = "global_1";
static String notice = "";
static String connectionStatus = "Not connected";
static final List<ChannelEntry> channels = new ArrayList<>();
static final List<String> channelMembers = new ArrayList<>();
static final List<WaypointEntry> waypoints = new ArrayList<>();
static String activeServerIdentity = "";
static boolean backendConnected;
private static WaypointEntry localWaypoint;
private static boolean sessionActive;
@Override
public void onInitializeClient() {
openMenuKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.channelwaypoints.open", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_0, "key.categories.channelwaypoints"
));
createWaypointKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.channelwaypoints.waypoint", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_SLASH,
"key.categories.channelwaypoints"
));
nextWaypointKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.channelwaypoints.next_waypoint", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_N,
"key.categories.channelwaypoints"
));
ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> {
BACKEND.stopSession();
sessionActive = false;
clearSessionState();
startSessionWhenReady(client);
});
ClientPlayConnectionEvents.DISCONNECT.register((handler, client) -> {
BACKEND.stopSession();
sessionActive = false;
clearSessionState();
});
WaypointRenderer.register();
ClientTickEvents.END_CLIENT_TICK.register(client -> {
startSessionWhenReady(client);
if (openMenuKey.wasPressed()) {
client.setScreen(new ChannelScreen());
}
if (createWaypointKey.wasPressed()) {
createWaypoint(client);
}
if (nextWaypointKey.wasPressed()) {
WaypointRenderer.cycleOffscreenWaypoint(client);
}
});
}
private static void startSessionWhenReady(MinecraftClient client) {
if (sessionActive || client.player == null || client.world == null) {
return;
}
String baseServerId;
if (client.isInSingleplayer()) {
baseServerId = "singleplayer:" + UUID.randomUUID();
} else {
ServerInfo serverInfo = client.getCurrentServerEntry();
baseServerId = serverInfo == null
? "unknown:" + UUID.randomUUID()
: normalizeServerAddress(serverInfo.address);
}
activeServerIdentity = BACKEND.start(baseServerId, client.player.getUuid(),
client.player.getName().getString());
sessionActive = true;
LOGGER.info("Minecraft session ready for waypoint use; server group is " + activeServerIdentity + ".");
}
private static String normalizeServerAddress(String address) {
String value = address.trim();
String host;
int port = -1;
if (value.startsWith("[")) {
int closingBracket = value.indexOf(']');
if (closingBracket < 0) {
return "minecraft:" + value.toLowerCase(Locale.ROOT);
}
host = value.substring(1, closingBracket);
String suffix = value.substring(closingBracket + 1);
if (suffix.startsWith(":")) {
port = parsePort(suffix.substring(1));
}
} else {
int firstColon = value.indexOf(':');
int lastColon = value.lastIndexOf(':');
if (firstColon >= 0 && firstColon == lastColon) {
host = value.substring(0, firstColon);
port = parsePort(value.substring(firstColon + 1));
} else {
host = value;
}
}
host = host.trim().toLowerCase(Locale.ROOT);
if (host.indexOf(':') < 0) {
host = host.replaceAll("\\.$", "");
try {
host = IDN.toASCII(host);
} catch (IllegalArgumentException exception) {
return "minecraft:" + address.trim().toLowerCase(Locale.ROOT);
}
}
if (host.isEmpty() || port == -2) {
return "minecraft:" + address.trim().toLowerCase(Locale.ROOT);
}
String normalized = host.indexOf(':') >= 0 ? "[" + host + "]" : host;
if (port > 0 && port != 25565) {
normalized += ":" + port;
}
return "minecraft:" + normalized;
}
private static int parsePort(String value) {
try {
int port = Integer.parseInt(value);
return port >= 1 && port <= 65535 ? port : -2;
} catch (NumberFormatException exception) {
return -2;
}
}
private static void createWaypoint(MinecraftClient client) {
LOGGER.info("Waypoint key press detected.");
if (client.player == null || client.world == null) {
LOGGER.warning("Waypoint creation skipped: the client player or world is unavailable.");
return;
}
UUID playerId = client.player.getUuid();
localWaypoint = new WaypointEntry(playerId, client.player.getName().getString(), client.player.getX(),
client.player.getY(), client.player.getZ(),
client.world.getRegistryKey().getValue().toString(), selectedChannel, activeServerIdentity,
"local", "", 0L);
waypoints.removeIf(waypoint -> waypoint.playerId().equals(playerId));
waypoints.add(localWaypoint);
WaypointRenderer.clearSelection();
client.player.playSound(SoundEvents.BLOCK_SNIFFER_EGG_PLOP, 0.55F, 1.3F);
LOGGER.info("Created and cached local waypoint for " + playerId + " at " + localWaypoint.x() + ", "
+ localWaypoint.y() + ", " + localWaypoint.z() + " in " + localWaypoint.dimension() + ".");
BACKEND.publishWaypoint(localWaypoint);
if (!backendConnected) {
setNotice("Waypoint created locally; sharing is unavailable until the synchronization backend connects.", true);
LOGGER.warning("Waypoint remains local because the synchronization backend is not connected.");
}
}
private static void clearSessionState() {
selectedChannel = "global_1";
notice = "";
connectionStatus = "Not connected";
channels.clear();
channelMembers.clear();
waypoints.clear();
localWaypoint = null;
activeServerIdentity = "";
backendConnected = false;
WaypointRenderer.clearSelection();
}
static KeyBinding openMenuKey() {
return openMenuKey;
}
static KeyBinding createWaypointKey() {
return createWaypointKey;
}
static KeyBinding nextWaypointKey() {
return nextWaypointKey;
}