โจ๏ธ 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!
You need to install Skript 2.15.0+.
Typesโ
CraftEngine registers two extra types that can be stored in variables. Parse them from strings with parsed as:
# A full immutable block state (id + properties)
set {_state} to "default:table_lamp[lit=true,facing=east]" parsed as custom block state
# A block state matcher, mostly used in event filters
set {_matcher} to "default:table_lamp[lit=true]" parsed as unsafe block state matcher
Unquoted literals also work in effects and event filters, e.g. place custom block default:table_lamp[lit=true] at player.
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 consoleHit CraftEngine Furniture Event
EventTriggers when a player hits CraftEngine furniture. Cancellable
Syntax:
[on] hit[ting] [of] [(custom|ce|craft-engine)] furniture[s] [[of] %-strings%]Field:
event-entityevent-locationevent-playerevent-worldExample:
on hit of furniture "default:wooden_chair":
cancel eventAttempt Place CraftEngine Block/Furniture Event
EventTriggers when a player attempts to place a custom block or furniture, before it is actually placed. Cancellable
Syntax:
[on] attempt[ing] to place (custom|ce|craft-engine) block[s] [[of] %-unsafeblockstatematchers%][on] attempt[ing] to place [(custom|ce|craft-engine)] furniture[s] [[of] %-strings%]Field:
event-blockevent-locationevent-playerevent-worldExample:
on attempt to place custom block:
cancel eventConditionsโ
Is 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-playerIs Furniture Seat
ConditionChecks entity is a seat of a CraftEngine furniture
Syntax:
%entities% (is|are) [a[n]] [(custom|ce|craft-engine)] furniture seat[s]%entities% (is|are) (n't| not) [a[n]] [(custom|ce|craft-engine)] furniture seat[s]Example:
if target entity is a furniture seat:
send "This is a seat!" to event-playerIs Furniture Collider
ConditionChecks entity is a collision entity of a CraftEngine furniture
Syntax:
%entities% (is|are) [a[n]] [(custom|ce|craft-engine)] furniture (collider|collision entit(y|ies))%entities% (is|are) (n't| not) [a[n]] [(custom|ce|craft-engine)] furniture (collider|collision entit(y|ies))Example:
if target entity is a furniture collider:
send "This is a collider!" 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 idCustom Block State Property
ExpressionGet or set a single property of a custom block state. Block states are immutable: setting a property replaces the state stored in the variable
Syntax:
(custom|ce|craft-engine) block [state] propert(y|ies) %strings% of %customblockstates%%customblockstates%'[s] (custom|ce|craft-engine) block [state] propert(y|ies) %strings%Example:
set {_s} to "default:table_lamp[lit=true]" parsed as custom block state
set custom block property "facing" of {_s} to "south"
place custom block {_s} at target blockAll Custom Block States
ExpressionGet all possible states of custom blocks
Syntax:
[(all|the)] [possible] [block] states of (custom|ce|craft-engine) block[s] %strings%Example:
loop all states of custom block "default:table_lamp":
send "%loop-value%"Furniture Variant
ExpressionGet, set or reset the variant of a furniture entity. Resetting restores the default variant
Syntax:
(custom|ce|craft-engine) furniture variant of %entities%%entities%'[s] (custom|ce|craft-engine) furniture variantExample:
set furniture variant of target entity to "wall"reset furniture variant of target entityFurniture Variants
ExpressionGet all variant names of furniture definitions
Syntax:
[(all|the)] variants of [(custom|ce|craft-engine)] furniture %strings%Example:
send variants of furniture "default:flower_basket" to playerEffect
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, optionally with a specific variant
Syntax:
place [(custom|ce|craft-engine)] furniture[s] %strings% [with variant %-strings%] [at] [%directions% %locations%]Example:
place furniture "default:bench" at location of playerplace furniture "default:flower_basket" with variant "wall" at location of playerRemove Custom Block
EffectRemove custom blocks at the given locations. Non-custom blocks are ignored
Syntax:
(remove|break) (custom|ce|craft-engine) block[s] [at] [%directions% %locations%]Example:
remove custom block at target blockRemove Furniture
EffectRemove a furniture
Syntax:
remove [(custom|ce|craft-engine)] furniture %entities%Example:
remove craft-engine furniture target entityForce Set Furniture Variant
EffectForcefully set the variant of furniture entities, skipping the collision check. Compare with 'set furniture variant of ... to ...' which respects collision checks
Syntax:
force[fully] set [(custom|ce|craft-engine)] furniture variant of %entities% to %strings%Example:
force set furniture variant of target entity to "ceiling"