SQL/Database

Server and Player data that is for historic data should be stored in the database instead of YAML files

Drustcraft generates a ton of historical data for administrators for monitoring usage and trends that should be stored in the drustcraft database instead of YAML files.

To determine where you should store your information, use the following guide:

  • Is the following data required by a denizen script within the next 24 hours or when the next logs in?

    • Yes - store in YAML

    • No - store in the Database

Retrieveing from the Database

proc[drustcraftp.db.get].context[server|

Connect

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.connect

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Connected

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- <proc[drustcraftp.sql.connected]>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Disconnect

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.disconnect

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Install or Update

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.install_or_update

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Session Start

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.session_start def:<player>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Session End

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.session_end def:<player>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Session AFK Start

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.session_afk_start def:<player>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Session AFK End

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.session_afk_end def:<player>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Player Change Gamemode

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.player_change_gamemode def:<player>|<gamemode>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Player Kill

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.player_kill def:<player(damager)>|<entity>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Player Death

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.player_death def:<entity>|<entity(damager or empty)>|<cause>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Update TPS

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.update_tps

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Update Ping

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.update_ping

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Uptime Start

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.uptime_start

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Uptime Update

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.uptime_update

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Player Change World

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.player_change_world def:<player>|<world-name>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.

Player Update World Time

Command
Script
Command

/kit create <id> [mode] [-i]

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • -i will set the kits contents to the items in your inventory

Script

- run drustcraft.sql.player_update_world_time def:<player>

Creates a new kit with a given ID and adds an optional kit mode (see Kit Modes)

Kit IDs are case-insensitive. Only one kit can exist with a given id.

  • items A list of items to use to set the kits contents.