Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Data Api Data Pack Wiki › Guides › How to Build a Custom GUI Using Marker Entities

How to Build a Custom GUI Using Marker Entities

The Marker Entity Approach

The pack's custom GUI support works by spawning marker entities as invisible anchors. Each marker sits at a fixed position and acts as a clickable or displayable slot. You place markers where you want GUI elements to appear, then attach your own functions to react when a player interacts near them.

Step-by-Step Setup

1. Enable developer mode with /function gamerule:data_api/developer_mode.

2. Decide the world coordinates where your GUI should appear (usually in front of the player or at a fixed shop/terminal location).

3. Summon marker entities at those coordinates using /summon marker with the pack's custom tags applied so the pack recognizes them as GUI elements. Check the settings book for the exact tag names.

4. Write a function that detects player interaction (right-click or proximity) with each marker and runs your logic — opening a menu, giving an item, or teleporting the player.

5. Use the pack's glow objective to make relevant markers visible during testing so you can see where they actually are.

Debugging Tips

Markers are invisible by default, which makes them hard to place. Turn on the glow objective while building so you can see each anchor, then turn it off once everything works. If clicks aren't registering, verify the marker's tags match what the pack expects and that your detection function is actually being called.