โจ๏ธ Skript
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!
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
EventTriggers 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-worldExample:
on break of ce block default:palm_log[axis=y]:
send "You broke the custom block!" to event-playerPlace/Break CraftEngine Furniture Event
EventTriggers 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-worldExample:
on place of custom furniture default:chinese_lantern:
send "You clicked the custom block!" to event-playerClick CraftEngine Block/Furniture Event
EventTriggers 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-worldExample:
on right-click of craft-engine on default:chinese_lantern:
send "You clicked the custom block!" to event-playerCraftEngine Reload Event
EventTriggers 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 consoleon craft-engine first loaded:
send "Ho, CraftEngine has been loaded on server enable, script will init something now!" to consoleConditionsโ
CraftEngine has been loaded
ConditionChecks 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 consoleIs Custom Item
ConditionChecks 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-playerIs Custom Block
ConditionChecks 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-playerIs Custom Furniture
ConditionChecks 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-playerExpressionsโ
Custom Item
ExpressionGet 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
ExpressionGet 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] idExample:
set {_itemId} to craft-engine item id of player's toolCustom Block Id
ExpressionGet 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-playerCustom Block State
ExpressionGet 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 ce block state to event-playerFurniture Id
ExpressionGet furniture id from entity
Syntax:
%entities%'s [(custom|ce|craft-engine)] furniture [namespace] idExample:
set {_furnitureId} to {_entity}'s craft-engine furniture idEffect
Place Custom Block
EffectPlace 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 playerPlace Furniture
EffectPlace a furniture
Syntax:
place [(custom|ce|craft-engine)] furniture[s] %strings% [at] [%directions% %locations%]Example:
place furniture "default:bench" at location of playerRemove Furniture
EffectRemove a furniture
Syntax:
remove [(custom|ce|craft-engine)] furniture %entities%Example:
remove craft-engine furniture target entity