NPCMessageCommand
Package: com.hypixel.hytale.server.npc.commands
public class NPCMessageCommand extends AbstractPlayerCommandImplements /npc message. Sends a beacon message to one or all NPCs. Beacon messages are processed by the NPC’s BeaconSupport component and can trigger beacon-type sensors in the behavior tree.
Arguments
Section titled “Arguments”| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
message | String | yes | — | The message string to send |
expiration | Double | no | 1.0 | Message expiration time in seconds |
--all | flag | no | — | Send to all NPCs with BeaconSupport |
entity | entity ID | no | — | Target NPC (defaults to player’s look-target) |
Behavior
Section titled “Behavior”--allmode: Iterates all entities withNPCEntityin parallel, posting the message to each entity’sBeaconSupportcomponent (if present) with the player as the sender.- Single target mode: Uses NPCCommandUtils to resolve the target NPC and posts the message to its
BeaconSupport.
Constructor
Section titled “Constructor”public NPCMessageCommand()Registers as sub-command "message" with translation key "server.commands.npc.message.desc".
Related Types
Section titled “Related Types”- NPCCommandUtils — used for target resolution
- NPCCommand — parent command collection
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.