Block

Use the block requirement in a KubeJS recipe

Use one of these methods to add a Block Requirement to the recipe.

.requireBlock(filter, whitelist, startX, startY, startZ, endX, endY, endZ)
.requireBlock(filter, whitelist, startX, startY, startZ, endX, endY, endZ, amount)
.requireBlock(filter, whitelist, startX, startY, startZ, endX, endY, endZ, amount, comparator)

.placeBlockOnStart("block", startX, startY, startZ, endX, endY, endZ)
.placeBlockOnStart("block", startX, startY, startZ, endX, endY, endZ, amount)

.placeBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ)
.placeBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ, amount)

.breakAndPlaceBlockOnStart("block", startX, startY, startZ, endX, endY, endZ)
.breakAndPlaceBlockOnStart("block", startX, startY, startZ, endX, endY, endZ, amount)
.breakAndPlaceBlockOnStart("block", startX, startY, startZ, endX, endY, endZ, amount, filter)
.breakAndPlaceBlockOnStart("block", startX, startY, startZ, endX, endY, endZ, amount, filter, whitelist)

.breakAndPlaceBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ)
.breakAndPlaceBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ, amount)
.breakAndPlaceBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ, amount, filter)
.breakAndPlaceBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ, amount, filter, whitelist)

.destroyAndPlaceBlockOnStart("block", startX, startY, startZ, endX, endY, endZ)
.destroyAndPlaceBlockOnStart("block", startX, startY, startZ, endX, endY, endZ, amount)
.destroyAndPlaceBlockOnStart("block", startX, startY, startZ, endX, endY, endZ, amount, filter)
.destroyAndPlaceBlockOnStart("block", startX, startY, startZ, endX, endY, endZ, amount, filter, whitelist)

.destroyAndPlaceBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ)
.destroyAndPlaceBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ, amount)
.destroyAndPlaceBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ, amount, filter)
.destroyAndPlaceBlockOnEnd("block", startX, startY, startZ, endX, endY, endZ, amount, filter, whitelist)

.destroyBlockOnStart(filter, whitelist, startX, startY, startZ, endX, endY, endZ)
.destroyBlockOnStart(filter, whitelist, startX, startY, startZ, endX, endY, endZ, amount)

.destroyBlockOnEnd(filter, whitelist, startX, startY, startZ, endX, endY, endZ)
.destroyBlockOnEnd(filter, whitelist, startX, startY, startZ, endX, endY, endZ, amount)

.breakBlockOnStart(filter, whitelist, startX, startY, startZ, endX, endY, endZ)
.breakBlockOnStart(filter, whitelist, startX, startY, startZ, endX, endY, endZ, amount)

.breakBlockOnEnd(filter, whitelist, startX, startY, startZ, endX, endY, endZ)
.breakBlockOnEnd(filter, whitelist, startX, startY, startZ, endX, endY, endZ, amount)
  • The block param must be a string defining a valid blockstate. Using the format namespace:block_id[property1=value1,property2=value2...]{tag1: value1, tag2: value2...} (The [] and {} are optional) This is the block that will be placed.

  • The filter param must be an array of string defining a valid blockstate. This is the blocks that can/can't be break by the machine depending of the whitelist property.

  • The whitelist param is a boolean, if true the filter list will be a whitelist, if false a blacklist. Default to false when not specified.

  • The startX, startY, startZ, endX, endY, endZ must be integer values defining the box where the machine will search for blocks. You can use the in-game Box Creator to select a box and put the values here.

  • The amount param must be a positive integer. This is the minimal amount of blocks that must be destroyed/placed. Default to 1 when not specified.

  • The comparator param must be a string defining a valid Comparator Mode. Default : ==

Example

ServerEvents.recipes(event => {

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireBlock("minecraft:stone", true, 0, -1, 0, 0, -1, 0)
  
})