Kits

Kits allow you to group items together and give them to players directly on certain events such as when a player first logs in or at the beginning of an activity.

Creating and Removing Kits

Create

Command
Scripting
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

Scripting

- run drustcraft.kit.create def:<id>|[mode]|[list-of-items]

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.

  • ontents.

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_id_exists - Kit id already exists

  • err_kit_mode_invalid - Kit mode is not a valid mode (see Kit Modes)

Remove

Command
Scripting
Command

/kit remove <id>

Removes a kit

Scripting

- run drustcraft.kit.remove def:<id>

Removes a kit

Determinations

Update

Command
Scripting
Command

/kit update <id> [player] /kit replace <id> [player] /kit clear <id> /kit give <id> <item> [-q amount] /kit take <id> <item> [-q amount]

Updates a kit's items

  • update will append your inventory (or the inventory or [player]) contents to the current kits contents

  • replace will replace the kits contents with what is in your inventory (or the inventory or [player]).

  • clear will clear the kits contents

  • give will add <item> to the kits contents

  • take will take <item> from the kits contents

  • -q amount sets the amount of an item to give or take from the kit

/kit update and /kit replace require a player to be specified when run from the server console.

Scripting

Add

- run drustcraft.kit.add def:<id>|<item>

NOT A LIST Appends the list of <items> to the contents of kit <id>

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_id_doesnt_exist - Kit id doesnt exist

  • err_no_item_list - Command can only be run by a player

Remove

- run drustcraft.kit.replace def:<id>|[item]

Replaces the kit <id> items with the list of items in [items] . If [items] is empty, the kit's items are cleared. NOT A LIST

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_id_doesnt_exist - Kit id doesnt exist

Clear

- run drustcraft.kit.clear def:<id>

Adds the <item> to the contents of kit <id>

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_id_doesnt_exist - Kit id doesnt exist

Take-NONE NOW

- run drustcraft.kit.take def:<id>|<item>

Takes the <item> to the contents of kit <id>

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_id_doesnt_exist - Kit id doesnt exist

Applying

Command
Scripting
Command

/kit apply <id> [player]

Applies a kit to yourself or an optional player

The player parameter is required when this command is run from the server console

Scripting

- run drustcraft.kit.apply def:<id>|[player]

Applies a kit to the player

Determinations

  • e

Getting Information

Information

Command
Scripting
Command

/kit info <id>

Displays information about a particular kit including its:

  • Items

  • Mode

  • Attached events

Scripting

Items

- <proc[drustcraftp.kit.items].context[<id>]>

Returns a list of ItemTags for a particular kit id.

If the kit id does not exist, or if the kit contains no items, an empty list will be returned.

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_id_doesnt_exist - Kit id doesnt exist

Mode

- <proc[drustcraftp.kit.mode].context[<id>]>

Returns the mode for a particular kit id.

If the kit id does not exist, <empty> will be returned.

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_id_doesnt_exists - Kit id doesnt exist

Events

- <proc[drustcraftp.kit.events].context[<id>]>

Returns a list of events names for a particular kit id.

If the kit id does not exist, or no events are defined for the kit, an empty list will be returned.

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_id_doesnt_exists - Kit id doesnt exist

List

Command
Scripting
Command

/kit list [page]

Lists all the current kits with an optional page number.

Scripting

- <proc[drustcraftp.kit.list]>

Returns the list of current kit id's

Setting Kit Options

Mode

Command
Scripting
Command

/kit mode <id> <mode>

Allows you to change how a kit is applied to a players inventory. The following modes are available:

  • merge - (default) Gives all the items to the player

  • match - Adds each item in the kit into the players inventory up to the quantity within the kit (ie if the kit contains 5 gravel blocks and the player already has 4 gravel blocks, they will only receive 1 additional gravel block). Players will not loose items within their inventory if they have more of an item than within the kit.

  • replace - Replaces the players inventory with the contents of the kit

Items in a kit may be skipped if the player does not have enough room in their inventory.

Scripting

- run drustcraft.kit.mode def:<id>|<mode>

Sets the specified kits mode. See the command tab for mode names.

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_mode_invalid - Mode passed is invalid

  • err_id_doesnt_exist - Kit id doesnt exist

Events

Command
Scripting
Command

/kit addevent <id> <event> /kit removeevent <id> <event>

Allows you to add or remove when a kit is applied to a player on a certain event.

Events available:

  • firstlogin - The kit will be applied when a player first logins to the server

  • nextlogin - The kit will be applied the next time a player logins to the server

Items in a kit may be skipped if the player does not have enough room in their inventory.

Scripting

- run drustcraft.kit.event.add def:<id>|<event> - run drustcraft.kit.event.remove def:<id>|<event>

Sets what events the kit will be applied to a player. See the command tab for event names.

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_id_missing - No kit id was passed to the task

  • err_event_invalid - Event passed is invalid

  • err_id_doesnt_exist - Kit id doesnt exist

Advanced

Register Event

- run drustcraft.kit.event.register def:<event>

Will register the event with the Kit system, allowing the event to be used in commands and scripts.

Events should always be registered with Drustcraft on the drustcraft load event

Events may already be registered. If this is the case, then a script may apply a kit at the same or a different time for this event and may result in the kit being applied more than once to a player.

Kits that are saved with events that are not registered will continue to have that event saved against it (unless changed), and the player will be notified that it is an unregistered event

Apply Event

- run drustcraft.kit.event.apply def:<player>|<event>

Will apply any kits that have the <event> applied to <player>

The <event> parameter supports the types listed at Events.

Determinations

  • err_not_permitted - Player does not have permission for this command

  • err_event_invalid - Mode passed is invalid

Event Registered

- define registered:<proc[drustcraftp.kit.registered].context[<event>]>

Will determine if the passed <event> is currently registered or not.

Load

- run drustcraft.kit.load

Will reload kit data from disk and replace all kit data in memory

Save

- run drustcraft.kit.save

Will save kit data to disk