Skip to main content

Data Structures

Variables

There are different variables available within certain pages.

Player Page

Player pages have the following variables available:

$player An instance of the player

$fights An instance of the LengthAwarePaginator that contains a collection of fight models

Fight Page

$fight An instance of the fight with inventories included

Models

All models are documented using TypeScript types as it's a nice way to represent the respective types in an easy-to-read manner, there are no plans of moving to a typescript backend.

DateTimes are represented with Carbon

Player

type Player = {
"id": number
"username": string
"uuid": string

"kills": number
"deaths": number

"global_elo": number

"last_man_standing_wins": number
"party_vs_party_wins": number
"juggernaut_wins": number
"brackets_wins": number
"sumo_wins": number

"ladders": {[column: string]: number} // column_name => elo
}

Fight

type Fight = {
"id": number
"started_at": Carbon // When the fight started
"ended_at": Carbon // When the fight ended
"mode": Mode // Refer to Enums
"arena": Arena // Details about the arena
"kit": string // Name of the kit
"winners": Collection<FightPlayer> // Winners
"losers": Collection<FightPlayer> // Losers
}

FightPlayer

A player within a Fight, this contains metadata such as food and health as well as miscellaneous details that StrikePractice provides.

type FightPlayer = {
"player": Player // The global player that this fight player represents
"fight": Fight // The fight that the player was in
"username": string // The players username (at the time of the fight)
"uuid": string // UUID of the player
"dead": boolean // Whether the player is dead
"health": number // Health (0 - 20)
"food": number // Food (0 - 20)
"is_winner": boolean // Whether the player was a winner in the fight
"old_elo": number
"new_elo": number
"statistics": {
// Calculate accuracy with (int) Math.round(Math.ceil(this.potionIntensities / potionsThrown * 100))
"hits": number
"current_combo": number
"longest_combo": number
"potions_thrown": number
"potions_missed": number
"potion_intensities": number
}
}

Inventory

The inventory of a player within a Fight

type Inventory = {
"owner"?: FightPlayer // The player whos inventory this represents
"items": (Item | null)[]

"helmet": Item
"chestplate": Item
"leggings": Item
"boots": Item

"potions": { // Counts health potions or soup
"left": number // The number of potions left in the inventory
"crafted": number // The number of potions/soup the player crafted
}
}

Item

An item within an inventory

type Item = {
"type"?: number // Deprecated type number, id will always be provided even if not supported natively by the server
"id": string
"amount": number // Amount of items in the stack
"durability"?: number // Durability of the item
"enchantments": Enchant[] // Enchants on the item
}

Enchant

type Enchant = {
"type"?: number // Deprecated type number, id will always be provided even if not supported natively by the server
"id": string // ID of the enchant
"level": number // Level of the enchant
}

Arena

type Arena = {
"name": string
"stripped_name": string // The name with color codes stripped
"friendly_name": string // The translated name

"ffa": boolean
"build": boolean
}

Kit (Ladder)

type Kit = {
"name": string
"friendly_name": string // The translated name
"icon"?: Item

"best_of": number
"inventory"?: Inventory // May not be provided in the end

"elo": boolean // Whether the kit is ranked

"combo": boolean
"bedwars": boolean
"parkour": boolean
"only_bow": boolean

"flags": {
"editable": boolean
"build": boolean
"chest_access": boolean
"no_hunger": boolean
"stick_spawn": boolean

"horse": boolean
}
}

Enums

Enums are constant values with named types

Fight Mode

enum Mode {
DUEL,
DUEL_QUEUE,
DUEL_QUEUE_RANKED,
DUEL_QUEUE_PREMIUM,
}