Skip to main content

โŒจ๏ธ Skript

tip

For advanced skript users, please use reflection to achieve more advanced functions. If you encounter problems when using the Skript features provided by CraftEngine, please give us feedback in time. If you'd like to request a new Skript feature and you know Java, consider contributing your code via a pull request!

warning

Please note that if you get an error when loading the server, it is probably because the skript script is loaded before the craftengine. This cannot be fixed at this time and can only be solved by reloading.

Eventsโ€‹

๐Ÿ“…

Place/Break CraftEngine Block Event

Event

Triggers when placing and breaking CraftEngine blocks

Syntax:

[on] (break[ing]|1ยฆmin(e|ing)) of (custom|ce|craft-engine) block[s] [[of] %-unsafeblockstatematchers%][on] (plac(e|ing)|build[ing]) of (custom|ce|craft-engine) block[s] [[of] %-unsafeblockstatematchers%]

Field:

event-blockevent-locationevent-playerevent-world

Example:

on break of ce block default:palm_log[axis=y]:
    send "You broke the custom block!" to event-player
๐Ÿ“…

Place/Break CraftEngine Furniture Event

Event

Triggers when placing and breaking CraftEngine furniture

Syntax:

[on] (break[ing]) of [(custom|ce|craft-engine)] furniture[s] [[of] %-strings%][on] (plac(e|ing)|build[ing]) of [(custom|ce|craft-engine)] furniture[s] [[of] %-strings%]

Field:

event-entityevent-locationevent-playerevent-world

Example:

on place of custom furniture default:chinese_lantern:
    send "You clicked the custom block!" to event-player
๐Ÿ“…

Click CraftEngine Block/Furniture Event

Event

Triggers when clicking on CraftEngine block and furniture

Syntax:

[on] [(" + RIGHT + ":right|" + LEFT + ":left)(| |-)][mouse(| |-)]click[ing] of (ce|craft-engine) [on %-unsafeblockstatematchers/strings%] [(with|using|holding) %-itemtype%][on] [(" + RIGHT + ":right|" + LEFT + ":left)(| |-)][mouse(| |-)]click[ing] of (ce|craft-engine) (with|using|holding) %itemtype% on %unsafeblockstatematchers/strings%

Field:

event-blockevent-entityevent-locationevent-playerevent-world

Example:

on right-click of craft-engine on default:chinese_lantern:
     send "You clicked the custom block!" to event-player
๐Ÿ“…

CraftEngine Reload Event

Event

Triggers when CraftEngine is loaded

Syntax:

[on] (ce|craft(engine|-engine)) [first] (load[ed]|reload)

Example:

on craft-engine loaded:
    send "Ho, CraftEngine has been loaded, you can get ce items now!" to console
on craft-engine first loaded:
    send "Ho, CraftEngine has been loaded on server enable, script will init something now!" to console

Conditionsโ€‹

โ“

CraftEngine has been loaded

Condition

Checks CraftEngine has been loaded

Syntax:

(ce|craft[-]engine) (has been|is) load[ed](ce|craft[-]engine) (has not been|is not) load[ed] [yet](ce|craft[-]engine) (hasn't been|isn't) load[ed] [yet]

Example:

on script load:
    stop if craft-engine has not been loaded yet
    send "script init something!" to console
โ“

Is Custom Item

Condition

Checks item is a custom item from CraftEngine

Syntax:

%itemstack/itemtype/slot% (is [a[n]]|are) (custom|ce|craft-engine) item[s]%itemstack/itemtype/slot% (isn't|is not|aren't|are not) [a[n]] (custom|ce|craft-engine) item[s]

Example:

on mine:
    if event-player's tool is a custom item:
      send "you are mine with a custom item" to event-player
โ“

Is Custom Block

Condition

Checks block is a custom block from CraftEngine

Syntax:

%blocks% (is|are) [a[n]] (custom|ce|craft-engine) block[s]%blocks% (is|are) (n't| not) [a[n]] (custom|ce|craft-engine) block[s]

Example:

on mine:
    if event-block is custom block:
      send "you break a custom block" to event-player
โ“

Is Custom Furniture

Condition

Checks entity is a custom furniture from CraftEngine

Syntax:

%entities% (is|are) [a[n]] [(custom|ce|craft-engine)] furniture[s]%entities% (is|are) (n't| not) [a[n]] [(custom|ce|craft-engine)] furniture[s]

Example:

on click:
    set {_entity} to nearest pig
    if {_entity} is a ce furniture:
      send "What am I doing?" to event-player

Expressionsโ€‹

๐Ÿ”ง

Custom Item

Expression

Get custom item from namespace id

Syntax:

[(the|a)] (custom|ce|craft-engine) item [with [namespace] id] %strings%

Example:

set {_item} to custom item with namespace id "default:topaz"
๐Ÿ”ง

Custom Item Id

Expression

Get a namespace id of custom item

Syntax:

(custom|ce|craft-engine) item [namespace] id of %itemstack/itemtype/slot%%itemstack/itemtype/slot%'[s] (custom|ce|craft-engine) item [namespace] id

Example:

set {_itemId} to craft-engine item id of player's tool
๐Ÿ”ง

Custom Block Id

Expression

Get a namespace id of custom block

Syntax:

%blocks/blockdata/customblockstates%'s (custom|ce|craft-engine) block [namespace] id(custom|ce|craft-engine) block [namespace] id of %blocks/blockdata/customblockstates%

Example:

on mine:
    if event-block's ce block id is "default:chinese_lantern":
      send "break a chinese_lantern block" to event-player
๐Ÿ”ง

Custom Block State

Expression

Get block state of custom block

Syntax:

%blocks/blockdata/customblockstates%'s (custom|ce|craft-engine) block[ ]state(custom|ce|craft-engine) block[ ]state of %blocks/blockdata/customblockstates%

Example:

on mine:
    send event-block's block state to event-player
๐Ÿ”ง

Furniture Id

Expression

Get furniture id from entity

Syntax:

%entities%'s [(custom|ce|craft-engine)] furniture [namespace] id

Example:

set {_furnitureId} to {_entity}'s craft-engine furniture id

Effect

โšก

Place Custom Block

Effect

Place a custom block

Syntax:

place (custom|ce|craft-engine) block %customblockstates% [at] [%directions% %locations%]

Example:

place custom block default:palm_log[axis=x] at location of the player
โšก

Place Furniture

Effect

Place a furniture

Syntax:

place [(custom|ce|craft-engine)] furniture[s] %strings% [at] [%directions% %locations%]

Example:

place furniture "default:bench" at location of player
โšก

Remove Furniture

Effect

Remove a furniture

Syntax:

remove [(custom|ce|craft-engine)] furniture %entities%

Example:

remove craft-engine furniture target entity