HyperScript
Docs

← All of the Docs More

Kits

structureitems:since 1.7.54

yes · A line for each item, written as give takes them

kit "miner":
    cooldown: 6 hours
    items:
        1 iron pickaxe
        16 bread
        3 diamond
Try it
structurecooldown: <duration>

no · How long until the same player may claim it again

kit "starter":
    cooldown: 1 day
    items:
        1 stone sword
        16 bread
        1 diamond sword named "&bFrost"
Try it
expressiononce: truesince 1.7.54

no · It can be claimed one time only

kit "founder":
    once: true
    permission: "kit.founder"
    items:
        1 diamond sword named "&6Founder's blade"

command /founder:
    trigger:
        claim kit "founder"
Try it
structurepermission: "<node>"since 1.7.54

no · Who may claim it

command /fly:
    permission: "server.fly"
    trigger:
        execute console command "fly %player.name%"
Try it
structuretrigger:

no · What else happens when the kit is handed over, after the items

command /kit:
    trigger:
        claim kit "starter"
Try it
expressionclaim kit <name>since 1.7.54

The player gets the kit if they may, and is told why if not: the cooldown with how long is left, that they had it already, or that they lack the permission. for <who> for somebody else

kit "tools":
    cooldown: 1 hour
    items:
        1 iron pickaxe

command /tools:
    trigger:
        claim kit "tools"
Try it
effectgive kit <name> to <who>since 1.7.54

Hands the items over without asking: no cooldown, no permission, nothing written down

kit "welcome":
    items:
        3 diamond

on first join:
    give kit "welcome" to player
Try it
expression<who> can claim kit <name>since 1.7.54

A condition: whether claim kit would hand it over now. Also cannot claim kit

kit "daily":
    cooldown: 1 day
    items:
        3 diamond

command /daily:
    trigger:
        if player can claim kit "daily":
            claim kit "daily"
            send "&aSee you tomorrow."
        else:
            set {_wait} to cooldown of kit "daily"
            send "&7Come back in %{_wait}%."
Try it
structurecooldown of command <name>since 1.7.63

How long until the player may use a command again that has a cooldown:, as a duration; unset if they may now. for <who> for somebody else. The name is the command's own, with or without its slash: cooldown of command "/kit"

command /kitstatus:
    trigger:
        set {_left} to cooldown of command "/kit"
        if {_left} is set:
            send "&7Your kit is ready in &f%{_left}%"
        else:
            send "&aYour kit is ready."
Try it
structurecooldown of kit <name>since 1.7.54

How long until the player may claim it again, as a duration; unset if they may now. for <who> for somebody else

kit "daily":
    cooldown: 1 day
    items:
        3 diamond

command /when:
    trigger:
        set {_wait} to cooldown of kit "daily"
        if {_wait} is set:
            send "&7In %{_wait}%."
        else:
            send "&aNow."
Try it
effectreset kit <name>since 1.7.54

The player may claim it again now; for <who> for somebody else

kit "daily":
    cooldown: 1 day
    items:
        3 diamond

command /resetdaily <target:player>:
    permission: op
    trigger:
        reset kit "daily" for arg.1
Try it
expressionkitssince 1.7.54

The names of all kits, as a list

kit "starter":
    items:
        1 stone sword

command /kits:
    trigger:
        send "&7Kits: &f%kits%"
Try it
Guide and examples

A kit is a handful of items under a name, with how often it may be taken. It is written at the left margin, like a command:

kit "starter":
    cooldown: 1 day
    items:
        1 stone sword
        16 bread
        1 diamond sword named "&bFrost"

command /kit:
    trigger:
        claim kit "starter"
Under kit "<name>":NeededMeaning
items:yesA line for each item, written as give takes them
cooldown: <duration>noHow long until the same player may claim it again
once: truenoIt can be claimed one time only
permission: "<node>"noWho may claim it
trigger:noWhat else happens when the kit is handed over, after the items
SyntaxMeaning
claim kit <name>The player gets the kit if they may, and is told why if not: the cooldown with how long is left, that they had it already, or that they lack the permission. for <who> for somebody else
give kit <name> to <who>Hands the items over without asking: no cooldown, no permission, nothing written down
<who> can claim kit <name>A condition: whether claim kit would hand it over now. Also cannot claim kit
cooldown of command <name>How long until the player may use a command again that has a cooldown:, as a duration; unset if they may now. for <who> for somebody else. The name is the command's own, with or without its slash: cooldown of command "/kit"
cooldown of kit <name>How long until the player may claim it again, as a duration; unset if they may now. for <who> for somebody else
reset kit <name>The player may claim it again now; for <who> for somebody else
kitsThe names of all kits, as a list
  • What claim kit says when it does not hand the kit over is in config.yml under messages: (kit-cooldown, kit-once, kit-permission); leave one empty to say nothing.
  • When a player last claimed a kit is kept with their saved variables, as {%player%.hs.kit.<name>}, so it lasts through restarts.
  • A kit's name is its own: two scripts cannot both make a kit "starter".