đ Denizen
If you encounter problems when using the Denizen features provided by CraftEngine, please give us feedback in time. If you'd like to request a new Denizen feature and you know Java, consider contributing your code via a pull request!
You need to install Denizen.
In all event lines, the word ce can also be written as craftengine, e.g. on player breaks craftengine block block: works the same as on player breaks ce block block:.
CraftEngine ids (like default:wooden_chair) can be used directly in event lines and command arguments â the plugin registers all loaded namespaces with Denizen automatically, no extra escaping needed.
Eventsâ
Break CraftEngine Block Event
EventTriggers when a player breaks a CraftEngine custom block. Cancellable
Syntax:
on player breaks ce block <'block'>Field:
<context.location> - the location the block was broken at<context.id> - the CraftEngine block id, like "default:togglable_light_block"<context.should_drop_items> - whether the event will drop itemsSwitch: with:<item> - only when breaking with a specified itemDetermine: "NOTHING" - drop no items; ListTag(ItemTag) - drop the specified itemsExample:
on player breaks ce block block:
- narrate "You just broke a <context.id>!"on player breaks ce block default:togglable_light_block with:diamond_pickaxe:
- narrate "No drops for you!"
- determine NOTHINGBreak CraftEngine Furniture Event
EventTriggers when a player breaks a CraftEngine furniture. Cancellable
Syntax:
on player breaks ce furniture <'furniture'>Field:
<context.location> - the location the furniture was broken at<context.id> - the CraftEngine furniture id, like "default:wooden_chair"<context.entity> - the EntityTag of the furniture's base entity<context.should_drop_items> - whether the event will drop itemsSwitch: with:<item> - only when breaking with a specified itemDetermine: "NOTHING" - drop no items; ListTag(ItemTag) - drop the specified itemsExample:
on player breaks ce furniture default:wooden_chair:
- narrate "You just broke a wooden chair!"
- determine NOTHINGPlace CraftEngine Block Event
EventTriggers when a player places a CraftEngine custom block. Cancellable
Syntax:
on player places ce block <'block'>Field:
<context.location> - the location the block was placed at<context.id> - the CraftEngine block id<context.hand> - the used handSwitch: with:<item> - only when placing with a specified itemExample:
on player places ce block block:
- narrate "You just placed a <context.id>!"on player places ce block default:safe_block in:my_base:
- determine cancelledPlace CraftEngine Furniture Event
EventTriggers when a player places a CraftEngine furniture. Cancellable
Syntax:
on player places ce furniture <'furniture'>Field:
<context.location> - the location the furniture was placed at<context.id> - the CraftEngine furniture id<context.entity> - the EntityTag of the furniture's base entity<context.hand> - the used handSwitch: with:<item> - only when placing with a specified itemExample:
on player places ce furniture furniture:
- narrate "You just placed a <context.id>!"Attempt Place CraftEngine Block Event
EventTriggers when a player is about to place a CraftEngine custom block, before the placement happens. Cancelling prevents the placement
Syntax:
on player attempts to place ce block <'block'>Field:
<context.location> - the location the block would be placed at<context.id> - the CraftEngine block id<context.clicked_block> - the block that was clicked to trigger the placement<context.hand> - the used handSwitch: with:<item> - only when placing with a specified itemExample:
on player attempts to place ce block block in:no_build_zone:
- narrate "You can't place that here!"
- determine cancelledAttempt Place CraftEngine Furniture Event
EventTriggers when a player is about to place a CraftEngine furniture, before the placement happens. Cancelling prevents the placement
Syntax:
on player attempts to place ce furniture <'furniture'>Field:
<context.location> - the location the furniture would be placed at<context.id> - the CraftEngine furniture id<context.variant> - the name of the furniture variant being placed<context.clicked_block> - the block that was clicked to trigger the placement<context.hand> - the used handSwitch: with:<item> - only when placing with a specified itemExample:
on player attempts to place ce furniture furniture in:no_build_zone:
- narrate "You can't place that here!"
- determine cancelledClick CraftEngine Block Event
EventTriggers when a player clicks on a CraftEngine custom block. Cancellable. Note that CraftEngine treats left clicks in creative mode as block breaking, so LEFT_CLICK only fires in survival/adventure mode
Syntax:
on player (right|left) clicks ce block (<'block'>)Field:
<context.item> - the ItemTag the player is clicking with<context.location> - the location the player is clicking on<context.id> - the CraftEngine block id<context.relative> - the air block in front of the clicked block<context.click_type> - LEFT_CLICK or RIGHT_CLICK<context.hand> - the used handSwitch: with:<item> - only when clicking with a specified itemExample:
on player right clicks ce block:
- narrate "You just right-clicked a <context.id>!"on player right clicks ce block default:safe_block with:diamond_sword:
- narrate "Not with that sword!"
- determine cancelledClick CraftEngine Furniture Event
EventTriggers when a player clicks on a CraftEngine furniture. Cancellable
Syntax:
on player (right|left) clicks ce furniture (<'furniture'>)Field:
<context.item> - the ItemTag the player is clicking with<context.location> - the location of the clicked furniture<context.id> - the CraftEngine furniture id<context.entity> - the EntityTag of the furniture's base entity<context.click_type> - LEFT_CLICK or RIGHT_CLICK<context.hand> - the used handSwitch: with:<item> - only when clicking with a specified itemExample:
on player right clicks ce furniture:
- narrate "You just right-clicked a <context.id>!"CraftEngine Reloaded Event
EventTriggers when the CraftEngine plugin finishes reloading. Has no linked player
Syntax:
on ce reloadedExample:
on ce reloaded:
- announce "CraftEngine has been reloaded!"Tagsâ
Item: Is CraftEngine Item / Item Id
TagChecks whether the item is a CraftEngine custom item, and gets its CraftEngine item id
Syntax:
<ItemTag.is_ce_item> - returns ElementTag(Boolean)<ItemTag.ce_id> - returns ElementTag like "default:topaz_rod", nothing if not a custom itemExample:
- if <player.item_in_hand.is_ce_item>:
- narrate "You are holding <player.item_in_hand.ce_id>!"Location: Is CraftEngine Block / Block Id
TagChecks whether the block at the location is a CraftEngine custom block, and gets its CraftEngine block id
Syntax:
<LocationTag.is_ce_block> - returns ElementTag(Boolean)<LocationTag.ce_id> - returns ElementTag like "default:togglable_light_block", nothing if not a custom blockExample:
- if <player.cursor_on.is_ce_block>:
- narrate "You are looking at <player.cursor_on.ce_id>!"Location: CraftEngine Block States
TagReturns a MapTag of all block state properties of the CraftEngine custom block at the location. Returns nothing if not a custom block
Syntax:
<LocationTag.ce_block_states> - returns MapTagExample:
- narrate "The block you are looking at has light level <player.cursor_on.ce_block_states.get[light]>."Entity: Is CraftEngine Furniture / Furniture Id
TagChecks whether the entity is part of a CraftEngine furniture (base entity, seat, or collider), and gets its CraftEngine furniture id
Syntax:
<EntityTag.is_ce_furniture> - returns ElementTag(Boolean)<EntityTag.ce_id> - returns ElementTag like "default:wooden_chair", nothing if not a furnitureExample:
- if <player.precise_target.is_ce_furniture.if_null[false]>:
- narrate "You are looking at <player.precise_target.ce_id>!"Entity: Is Furniture Seat / Collider
TagChecks whether the entity is a seat or a collision entity of a CraftEngine furniture
Syntax:
<EntityTag.is_ce_furniture_seat> - returns ElementTag(Boolean)<EntityTag.is_ce_furniture_collider> - returns ElementTag(Boolean)Example:
- if <player.precise_target.is_ce_furniture_seat.if_null[false]>:
- narrate "This is a seat!"Entity: Furniture Variant / Variants
TagGets the current variant name of a CraftEngine furniture, or a list of all its variant names
Syntax:
<EntityTag.ce_furniture_variant> - returns ElementTag<EntityTag.ce_furniture_variants> - returns ListTagExample:
- narrate "The chair variant is <player.precise_target.ce_furniture_variant>, all: <player.precise_target.ce_furniture_variants>"Server: CraftEngine Id Lists
TagReturns lists of all loaded CraftEngine block, item and furniture ids
Syntax:
<server.ce_block_ids> - returns ListTag<server.ce_item_ids> - returns ListTag<server.ce_furniture_ids> - returns ListTagExample:
- narrate "Loaded <server.ce_block_ids.size> custom blocks!"CraftEngine Item
TagReturns a CraftEngine custom item object constructed from the input id
Syntax:
<ce_item[<item_id>]> - returns ItemTagExample:
- give <ce_item[default:topaz_rod]>CraftEngine Possible States
TagReturns a list of all possible block states of a CraftEngine block id, in the form directly usable by the placeceblock command
Syntax:
<ce_possible_states[<block_id>]> - returns ListTag like "default:togglable_light_block[light=15]"Example:
- foreach <ce_possible_states[default:togglable_light_block]> as:state:
- narrate "<[state]>"Mechanismsâ
Location: Set CraftEngine Block State
MechanismSets a block state property of the CraftEngine custom block at the location, used with the adjust command
Syntax:
- adjust <location> ce_block_state:<key=value>Example:
- adjust <player.cursor_on> ce_block_state:light=10Entity: Set CraftEngine Furniture Variant
MechanismSets the variant of a CraftEngine furniture, used with the adjust command. Does nothing if the variant doesn't exist or is blocked
Syntax:
- adjust <entity> ce_furniture_variant:<variant_name>Example:
- adjust <player.precise_target> ce_furniture_variant:oakCommandsâ
PlaceCEBlock
CommandPlaces CraftEngine custom blocks in the world. Blocks are specified as CraftEngine block ids, optionally with block state properties. ~waitable
Syntax:
placeceblock [<location>|.../<ellipsoid>/<cuboid>] [<craftengine_block>|...] (no_physics) (<percent chance>|...)Field:
no_physics - place without physics taking over the modified blocks(<percent chance>|...) - chances are rolled in order per location until one succeeds; if no roll succeeds, the location is left unchanged. "50|50" means 50% the first block, 25% the second, 25% unchangedExample:
- placeceblock <player.cursor_on> default:sugar_block- ~placeceblock <player.cursor_on> default:togglable_light_block[light=15] no_physics- placeceblock <player.location.to_cuboid[<player.cursor_on>]> default:sugar_block|default:cloud_block 50|50SpawnCEFurniture
CommandSpawns CraftEngine furniture in the world. ~waitable
Syntax:
spawncefurniture [<location>|.../<ellipsoid>/<cuboid>] [<craftengine_furniture>|...] (direction:north/east/south/west) (<percent chance>|...)Field:
direction: - controls the direction the furniture faces(<percent chance>|...) - chances are rolled in order per location until one succeeds; if no roll succeeds, nothing is spawned at that locationExample:
- spawncefurniture <player.cursor_on> default:wooden_chair- ~spawncefurniture <player.cursor_on> default:oak_lamp direction:westRemoveCEFurniture
CommandRemoves CraftEngine furniture from the world, without dropping loot or playing effects. Entities that are not part of a CraftEngine furniture are ignored. ~waitable
Syntax:
removecefurniture [<entity>|...]Example:
- removecefurniture <player.precise_target>RemoveCEBlock
CommandRemoves CraftEngine custom blocks from the world, without dropping loot or playing effects. Locations without a custom block are silently skipped. ~waitable
Syntax:
removeceblock [<location>|.../<ellipsoid>/<cuboid>]Example:
- removeceblock <player.cursor_on>- removeceblock <player.location.to_cuboid[<player.cursor_on>]>