General - New Packet (Expression) — skPackets
Addon: skPackets · Category: Expression · Since: 1.0.0
Syntax
[a] [new] %*packettype%Description
Create a new packet from a packet type. ### Available Packets and their fields * **open sign editor** fields: - `block position (block pos, position, pos)` - `sign side (side)` * **camera** fields: - `entity id (camera id, id)` * **interact entity** fields: - `entity id (id)` - `interaction hand (hand)` - `location vector (location, loc)` - `sneaking state (sneaking)` * **update sign** fields: - `location vector (location)` - `sign lines (lines)` - `sign side (side)` * **block break animation** fields: - `entity id` - `block position (position, pos)` - `destroy stage (breaking stage, stage)` * **block entity data** fields: - `block position (block pos, position, pos)` - `block entity type (entity type, type)` - `nbt compound (nbt, compound)` * **entity metadata** fields: - `entity id (id)` - `entity metadata (entity meta, metadata, meta)` * **destroy entities** fields: - `entity ids (ids)` * **effect** fields: - `effect id` - `position` - `data` - `global event` * **entity velocity** fields: - `entity id (id)` - `velocity vector (vector, velocity)` * **game test highlight pos** fields: - `absolute position (absolute pos, abs position, abs pos, position, pos)` - `relative position (relative pos, rel position, rel pos)` * **teams** fields: - `name (team name)` - `entries` - `display name` - `prefix` - `suffix` - `color` - `name tag visibility` - `collision rule` - `friendly fire` - `see invisible teammates` * **hurt animation** fields: - `entity id` - `yaw` * **block action** fields: - `block position (position, pos)` - `action id` - `action data` - `block type id` * **entity status** fields: - `entity id (id)` - `status` * **select bundle item** fields: - `slot id (id)` - `selected item index (selected index, item index, index)` * **block change** fields: - `block position (block pos, position, pos)` - `block state (state, block data, data)`
Examples
command killTargetForMe:
trigger:
set {_packet} to a new clientbound destroy entities packet:
entity ids: protocol id of target entity
silently send packet {_packet} to the player
command /start-cracking:
trigger:
set {_block} to target block of player
set {_pos} to vector(x-coordinate of {_block}, y-coordinate of {_block}, z-coordinate of {_block})
set {_random} to random integer between 100000 and 999999
loop 9 times:
set {_packet} to a new clientbound block break animation packet:
entity id: {_random}
block position: {_pos}
destroy stage: loop-number
silently send packet {_packet} to player
wait 1 tick
set {_packet} to a new clientbound block break animation packet:
entity id: {_random}
block position: {_pos}
destroy stage: -1
silently send packet {_packet} to player