Actions Reference
Complete reference of all available Pilaf actions, including what gets logged in the HTML report.
Logged Information
Every action logs:
-
ACTION - The raw action that was performed
-
RESPONSE - The raw response received
These are displayed in the HTML report as:
* → action (yellow) - The action performed
* ← response (green) - The response received
Player Actions
chat
Send a chat message as a player.
{
name: '[player: testplayer] Send chat message',
action: 'chat',
player: 'testplayer',
message: 'Hello, world!'
}
Logs:
→ testplayer chat: Hello, world!
← Message sent
Parameters:
* player (string, required) - Player username
* message (string, required) - Chat message to send
execute_player_command
Execute a command as a player.
{
name: '[player: testplayer] Execute plugin command',
action: 'execute_player_command',
player: 'testplayer',
command: '/myplugin subcommand arg1'
}
Logs:
→ testplayer execute command: /myplugin subcommand arg1
← Command sent
Parameters:
* player (string, required) - Player username
* command (string, required) - Command to execute
move_forward
Move the player forward for a specified duration.
{
name: '[player: testplayer] Move forward',
action: 'move_forward',
player: 'testplayer',
duration: 2
}
Logs:
testplayer moved forward for 2s
Parameters:
* player (string, required) - Player username
* duration (number, optional) - Duration in seconds (default: 1)
Query Actions
get_entities
Get all entities visible to a player.
{
name: '[player: testplayer] Get nearby entities',
action: 'get_entities',
player: 'testplayer',
store_as: 'entities'
}
Logs:
→ getEntities() for testplayer
← Found 152 entities: zombie, skeleton, sheep, sheep, sheep...
Parameters:
* player (string, required) - Player username
Returns: Array of entity objects with position, type, name
get_player_inventory
Get a player’s inventory contents.
{
name: '[player: testplayer] Get player inventory',
action: 'get_player_inventory',
player: 'testplayer',
store_as: 'inventory'
}
Logs:
→ getPlayerInventory() for testplayer
← 3 items (895, 926, 941)
Parameters:
* player (string, required) - Player username
Returns: Inventory object with items array
get_player_location
Get a player’s current position.
{
name: '[player: testplayer] Get player position',
action: 'get_player_location',
player: 'testplayer',
store_as: 'position'
}
Logs:
→ testplayer getLocation()
← x=8.61, y=78.00, z=2.49
Parameters:
* player (string, required) - Player username
Returns: Position object with x, y, z, yaw, pitch
get_entity_location
Get a specific entity’s position.
{
name: '[player: testplayer] Get entity position',
action: 'get_entity_location',
player: 'testplayer',
entity_name: 'zombie',
store_as: 'entity_position'
}
Logs:
→ getEntityLocation() for zombie
← Entity "zombie" location: x=100.5, y=64.0, z=200.3
Parameters:
* player (string, required) - Player username to query from
* entity_name (string, required) - Entity name to find
Returns: Position object with x, y, z
Calculation Actions
calculate_distance
Calculate distance between two positions.
{
name: 'Calculate distance',
action: 'calculate_distance',
from: '{start_position}',
to: '{end_position}',
store_as: 'distance'
}
Logs:
Distance calculated: 0.21 blocks
💾 Saved: "distance"
Parameters:
* from (object, required) - Starting position with x, y, z
* to (object, required) - Ending position with x, y, z
Returns: Distance in blocks (number)
Lifecycle Actions
login
Create a new TCP connection for a player (real reconnection).
{
name: 'Reconnect player',
action: 'login',
player: 'testplayer'
}
Parameters:
* player (string, required) - Player username to reconnect
logout
Disconnect a player’s TCP connection (real disconnection).
{
name: 'Disconnect player',
action: 'logout',
player: 'testplayer'
}
Parameters:
* player (string, required) - Player username to disconnect
Assertion Actions
See Assertions Guide for complete assertion reference.
Parameter Reference
Action Parameters by Type
player parameter-
chat
-
execute_player_command
-
move_forward
-
get_entities
-
get_player_inventory
-
get_player_location
-
get_entity_location
-
login
-
logout
-
kill
-
respawn
store_as support-
get_entities
-
get_player_inventory
-
get_player_location
-
get_entity_location
-
calculate_distance
duration parameter-
wait
-
move_forward
-
execute_command
-
chat
-
execute_player_command
-
get_entities
-
get_player_inventory
-
get_player_location
-
get_entity_location
Next Steps
-
Assertions Guide - Learn about assertion conditions
-
Writing Tests - Test patterns and examples