API Reference
Overview
Section titled “Overview”EverHytale plugins expose APIs that allow you to extend functionality and integrate with other plugins.
EverEssentials API
Section titled “EverEssentials API”Plugin Instance
Section titled “Plugin Instance”// Get the plugin instanceEverEssentialsPlugin plugin = EverEssentialsPlugin.getInstance();Command Registration
Section titled “Command Registration”EverEssentials uses the native Hytale command system:
public class EverEssentialsPlugin extends JavaPlugin { @Override protected void setup() { this.getCommandRegistry().registerCommand(new YourCommand()); }}Custom UI Pages
Section titled “Custom UI Pages”Create custom admin pages by extending InteractiveCustomUIPage:
public class YourCustomPage extends InteractiveCustomUIPage<YourEventData> {
public YourCustomPage(@Nonnull PlayerRef playerRef) { super(playerRef, CustomPageLifetime.CanDismiss, EVENT_CODEC); }
@Override public void build(@Nonnull Ref<EntityStore> ref, @Nonnull UICommandBuilder commandBuilder, @Nonnull UIEventBuilder eventBuilder, @Nonnull Store<EntityStore> store) { // Build your UI here commandBuilder.append("Pages/YourPage.ui"); }
@Override public void handleDataEvent(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull YourEventData data) { // Handle UI events here }}Player Management
Section titled “Player Management”// Get all online playersList<PlayerRef> players = Universe.get().getPlayers();
// Get a specific player by UUIDPlayerRef player = Universe.get().getPlayer(uuid);
// Send a message to a playerplayer.sendMessage(Message.raw("§aHello!"));
// Disconnect a playerplayer.getPacketHandler().disconnect("Reason");Teleportation
Section titled “Teleportation”// Get player transformTransformComponent transform = store.getComponent(ref, TransformComponent.getComponentType());Vector3d position = transform.getPosition();
// Teleport a playerTeleport teleport = new Teleport(world, targetPosition, targetRotation);store.addComponent(ref, Teleport.getComponentType(), teleport);Event Handling
Section titled “Event Handling”UI Event Codecs
Section titled “UI Event Codecs”Define codecs for UI event data:
public static final BuilderCodec<YourEventData> EVENT_CODEC = BuilderCodec.builder(YourEventData.class, YourEventData::new) .addField(new KeyedCodec<>("Action", Codec.STRING), (e, v) -> e.action = v, e -> e.action) .build();Best Practices
Section titled “Best Practices”- Use proper null checks - Always validate player references before operations
- Handle disconnected players - Players may disconnect during operations
- Respect permissions - Check player permissions before sensitive actions
- Clean up resources - Close UI pages and release resources properly