HyperScript
Docs

← All of the Docs HyperModels

Items HyperModels

effectgive model <id> to <who>HyperModels

Give one of a custom item. What does not fit is dropped at their feet

give model "ruby" to player
effectgive <n> of model <id> to <who>HyperModels

Give several

give {_amount} of model "ruby" to arg.1
expressiontake model <id> from <who>HyperModels

Take one out of their inventory, if they have it

take model "ruby" from player
expressiontake <n> of model <id> from <who>HyperModels

Take up to that many

take {_have} of model "ruby" from player
effectdrop model <id> at <location>HyperModels

Drop one on the ground

drop model "ruby" at player's location
expressionheld model of <who>HyperModels

The id of the custom item in their main hand; unset for an ordinary item or an empty hand

if held model of player is "magic_wand":
    cancel event
    strike lightning at target block of player
expressionamount of model <id> of <who>HyperModels

How many of it they carry

set {_have} to amount of model "ruby" of player
expressionmodel exists <id>HyperModels

Whether any of the plugins has an item of that id

if not model exists "ruby":
    send "&cThere is no item called ruby."
    stop
expressionall modelsHyperModels

A list of every id, in alphabetical order

send "&7%size of all models% custom items: &f" + join all models with ", "
Guide and examples
command /ruby <player> <amount>:
    permission: "models.give"
    trigger:
        if not model exists "ruby":
            send "&cThere is no item called ruby."
            stop
        set {_amount} to parse arg.2 as integer
        give {_amount} of model "ruby" to arg.1
        send "&aGiven."

command /sellrubies:
    players only: true
    trigger:
        set {_have} to amount of model "ruby" of player
        if {_have} < 1:
            send "&cYou have no rubies."
            stop
        take {_have} of model "ruby" from player
        add {_have} * 25 to {%player%.coins}
        send "&aSold %{_have}% rubies."

on right click:
    if held model of player is "magic_wand":
        cancel event
        strike lightning at target block of player

command /payruby:
    players only: true
    trigger:
        if amount of model "ruby" of player < 1:
            send "&cThat costs one ruby."
            stop
        take model "ruby" from player
        send "&aPaid."

on player death:
    drop model "ruby" at player's location

command /models:
    permission: "models.give"
    trigger:
        send "&7%size of all models% custom items: &f" + join all models with ", "
SyntaxEffect
give model <id> to <who>Give one of a custom item. What does not fit is dropped at their feet
give <n> of model <id> to <who>Give several
take model <id> from <who>Take one out of their inventory, if they have it
take <n> of model <id> from <who>Take up to that many
drop model <id> at <location>Drop one on the ground
held model of <who>The id of the custom item in their main hand; unset for an ordinary item or an empty hand
amount of model <id> of <who>How many of it they carry
model exists <id>Whether any of the plugins has an item of that id
all modelsA list of every id, in alphabetical order
  • An id that no plugin knows is reported in the console and nothing is given.
  • These are the plugin's own items, with their name, look and abilities; nothing is copied.