HyperScript
Docs

← All of the Docs HyperPackets

Sending any packet HyperPackets

effectsend packet <name> to <who>HyperPackets

Sends that packet to a player, or to all players

send packet "change game state" with "win game", 1 to player
effectsend packet <name> with <value>, <value> to <who>HyperPackets

With the values the packet takes, in its order

send packet "change game state" with "win game", 1 to player
expressionpacket namesHyperPackets

Every packet there is, as a list

Guide and examples
SyntaxWhat it does
send packet <name> to <who>Sends that packet to a player, or to all players
send packet <name> with <value>, <value> to <who>With the values the packet takes, in its order
packet namesEvery packet there is, as a list

The packets are PacketEvents' own, about 160 of them, and are named as it names them: "ChangeGameState", "EntityAnimation", "SetTitleText". Spaces and capitals do not matter, so "change game state" is the same.

/hyperpackets lists them all, and /hyperpackets <name> says what one takes:

/hyperpackets entity animation
EntityAnimation takes, in this order:
  whole number, one of swing_main_arm/hurt/wake_up/swing_off_hand/critical_hit/magic_critical_hit

What a script gives is turned into what the packet asks for:

The packet asks forGive it
a whole number, a numberA number. Where it is the number of an entity, a player or an entity can be given instead: player
true/falsetrue or false
textA text; colours with & work where the packet shows it
one of ...One of the words listed, as text: "swing main arm"
a placeA location, or three numbers as a list: [0, 1, 0]
UUIDA player or an entity
ItemStackThe name of an item: "diamond sword"
a list of somethingSeveral values of that kind, as a list or one after another
command /swing:
    trigger:
        send packet "entity animation" with player, "swing main arm" to all players

command /credits:
    trigger:
        send packet "change game state" with "win game", 1 to player
  • A packet changes only what that player sees. The server does not know about it: rain sent by a packet does not water crops, and a block shown by one is not there.
  • A packet that is given what it does not take is not sent, and the console says what it takes.
  • A few packets take things a script has no way to give, such as a whole chunk. They are listed but cannot be made.
  • Packets a client sends to the server are not part of this: only those the server sends.
  • Sending the wrong thing can throw a player off the server or leave their game showing something that is not so until they join again. Try a packet on yourself first.