Skip to content

BuilderToolsPacketHandler

Package: com.hypixel.hytale.builtin.buildertools

public class BuilderToolsPacketHandler implements SubPacketHandler

Handles all client-to-server packets for the builder tools system. Registered as a sub-packet handler via ServerManager.registerSubPacketHandlers() during BuilderToolsPlugin setup. If the plugin is disabled at registration time, all builder tool packet IDs are registered as no-op handlers.

All handlers require the base permission hytale.editor.builderTools. Some handlers require additional sub-permissions:

PermissionHandlers
hytale.editor.builderToolsEntity actions, entity transforms, entity scale, transformation mode, prefab unselect, entity pickup, entity light, NPC debug, entity collision
hytale.editor.brush.configTool argument updates
hytale.editor.brush.useOn-use interaction (brush click), line action
hytale.editor.selection.useSelection update
hytale.editor.selection.modifyExtrude action
hytale.editor.selection.clipboardRotate clipboard, paste clipboard, ask for clipboard, selection transform, stack area
hytale.editor.historyUndo/redo (via general action handler)

When permission is denied, the player receives the server.builderTools.usageDenied translation message.

public BuilderToolsPacketHandler(@Nonnull IPacketHandler packetHandler)
@Override
public void registerHandlers()

Registers all packet handlers with the parent IPacketHandler. When the plugin is disabled, registers no-op handlers for packet IDs 400, 401, 412, 409, 403, 406, 407, 413, 414, 417.

public void handleBuilderToolArgUpdate(
@Nonnull BuilderToolArgUpdate packet,
@Nonnull PlayerRef playerRef,
@Nonnull Ref<EntityStore> ref,
@Nonnull World world,
@Nonnull Store<EntityStore> store
)

Delegates to BuilderToolsPlugin.onToolArgUpdate() to update a builder tool’s argument value for the player.

public void handleBuilderToolEntityAction(
@Nonnull BuilderToolEntityAction packet,
@Nonnull PlayerRef playerRef,
@Nonnull Ref<EntityStore> ref,
@Nonnull World world,
@Nonnull Store<EntityStore> store
)

Handles Freeze, Clone, and Remove entity actions. Prevents targeting players. Freeze delegates to npc freeze --toggle command, Clone to EntityCloneCommand.cloneEntity(), and Remove to EntityRemoveCommand.removeEntity().

public void handleBuilderToolGeneralAction(
@Nonnull BuilderToolGeneralAction packet,
@Nonnull PlayerRef playerRef,
@Nonnull Ref<EntityStore> ref,
@Nonnull World world,
@Nonnull Store<EntityStore> store
)

Dispatches general builder tool actions: HistoryUndo, HistoryRedo, SelectionCopy, SelectionPosition1, SelectionPosition2, ActivateToolMode, and DeactivateToolMode. Each action checks its own sub-permission before executing.

public void handleBuilderToolSelectionUpdate(
@Nonnull BuilderToolSelectionUpdate packet,
@Nonnull PlayerRef playerRef,
@Nonnull Ref<EntityStore> ref,
@Nonnull World world,
@Nonnull Store<EntityStore> store
)

Updates the player’s selection bounds from the packet’s min/max coordinates.

public void handleBuilderToolOnUseInteraction(
@Nonnull BuilderToolOnUseInteraction packet,
@Nonnull PlayerRef playerRef,
@Nonnull Ref<EntityStore> ref,
@Nonnull World world,
@Nonnull Store<EntityStore> store
)

Queues a brush edit operation on the player’s builder state.

public void handleBuilderToolExtrudeAction(
@Nonnull BuilderToolExtrudeAction packet,
@Nonnull PlayerRef playerRef,
@Nonnull Ref<EntityStore> ref,
@Nonnull World world,
@Nonnull Store<EntityStore> store
)

Handles the Extrude tool, reading ExtrudeDepth, ExtrudeRadius, and ExtrudeMaterial from the active builder tool’s arguments.

public void handleBuilderToolLineAction(
@Nonnull BuilderToolLineAction packet,
@Nonnull PlayerRef playerRef,
@Nonnull Ref<EntityStore> ref,
@Nonnull World world,
@Nonnull Store<EntityStore> store
)

Draws a line of blocks between start and end coordinates using the Line tool’s parameters: width, height, shape, origin, wall thickness, spacing, density, and material.

  • Rotate Clipboard (ID 406): Rotates the player’s clipboard by the specified axis and angle.
  • Paste Clipboard (ID 407): Pastes the clipboard at the given coordinates.
  • Ask for Clipboard (ID 410): Sends clipboard block, fluid, and entity data back to the client for preview rendering.
  • Selection Transform (ID 405): Applies a rotation and translation transform to the selection, with optional cut of the original. Handles large selections (over 20,000 blocks) with warning messages.
  • Stack Area (ID 404): Stacks the selected area in a normal direction for a given number of repetitions.
  • Set Entity Transform (ID 402): Updates entity position, look orientation, and body orientation.
  • Set Entity Scale (ID 420): Sets the scale of a prop entity via EntityScaleComponent.
  • Set Entity Pickup Enabled (ID 421): Toggles the pickup interaction on a prop entity by adding/removing Interactable, Interactions, and PreventPickup components.
  • Set Entity Light (ID 422): Adds or removes DynamicLight and PersistentDynamicLight components on an entity.
  • Set NPC Debug (ID 423): Toggles NPC debug display via the npc debug command.
  • Set Entity Collision (ID 425): Sets or removes HitboxCollision component on prop/NPC entities.
  • Load Hotbar (ID 106): Loads a saved hotbar row.
  • Save Hotbar (ID 107): Saves the current hotbar row.
public void handlePrefabUnselectPrefab(
@Nonnull PrefabUnselectPrefab packet,
@Nonnull PlayerRef playerRef,
@Nonnull Ref<EntityStore> ref,
@Nonnull World world,
@Nonnull Store<EntityStore> store
)

Clears the selected prefab in the player’s active prefab editing session.

@Nonnull
public Vector3i fromBlockPosition(@Nonnull BlockPosition position)

Converts a protocol BlockPosition to a Vector3i.

Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.