HyperScript
Docs

← All of the Docs HyperModels

Events HyperModels

eventon model block break "<id>":HyperModels

Runs when a player breaks that custom block

on model block break "ruby_ore":
    give model "ruby" to player
    add 1 to {%player%.rubies_mined}

What this event gives a script

In the blockWhat it is
{_model}The id
{_location}Where it is
eventon model block place "<id>":HyperModels

Runs when a player places it

on model block place "ruby_ore":
    send "&7Ruby ore is for mines, not for walls."

What this event gives a script

In the blockWhat it is
{_model}The id
{_location}Where it is
eventon model block click "<id>":HyperModels

Runs when a player right-clicks it

on model block click "crate":
    execute player command "crate open"

What this event gives a script

In the blockWhat it is
{_model}The id
{_location}Where it is
eventon model item click "<id>":HyperModels

Runs when a player right-clicks while holding that custom item in their main hand, in the air or at a block. {_location} is the block that was clicked, or where they stand

What this event gives a script

In the blockWhat it is
{_location}The block that was clicked, or where they stand
{_model}The id
eventon model furniture click "<id>":HyperModels

Runs when a player clicks a piece of furniture

on model furniture click "chair":
    send "&7A comfortable chair."

What this event gives a script

In the blockWhat it is
{_model}The id
{_location}Where it is
Guide and examples
on model block break "ruby_ore":
    give model "ruby" to player
    add 1 to {%player%.rubies_mined}

on model block place "ruby_ore":
    send "&7Ruby ore is for mines, not for walls."

on model block place:
    log "%player.name% placed %{_model}% at %{_location}%"

on model block click "crate":
    execute player command "crate open"

on model furniture click "chair":
    send "&7A comfortable chair."
SyntaxEffect
on model block break "<id>":Runs when a player breaks that custom block
on model block place "<id>":Runs when a player places it
on model block click "<id>":Runs when a player right-clicks it
on model item click "<id>":Runs when a player right-clicks while holding that custom item in their main hand, in the air or at a block. {_location} is the block that was clicked, or where they stand
on model furniture click "<id>":Runs when a player clicks a piece of furniture
  • Without an id, a block runs for every custom block or piece of furniture.
  • Inside the blocks player is the player, {_model} the id and {_location} where it is.
  • These run after the plugin has made up its mind: a break or place that it refused does not reach a script, and cancel event does not undo one.