Options
All
  • Public
  • Public/Protected
  • All
Menu

A module that adds some new features that can be applied to custom blocks. Remember that you cannot use this module's methods on vanilla blocks, as they don't support them because of some technical peculiarities.

since

4.0

Index

Type Aliases

OnStepOffCallback: OnStepOnCallback

Function used in BlocksModule.registerOnStepOffCallback. The parameters are completely the same as in OnStepOnCallback, so instead of rewriting their description here, just an alias is declared.

since

4.0

Functions

  • getLightEmission(id: number, data: number): number
  • since

    4.0

    Parameters

    • id: number
    • data: number

    Returns number

    light level value for the block with given ID and data

  • Registers the block with given numeric ID as a comparator signal emitter.

    since

    5.0

    Parameters

    • id: number
    • callback: ComparatorSignalCallbackJava

      the function that will be called on every block with given ID in the world, several times a second, and must return comparator signal strength based on given circumstances

    • Optional isCallbackForced: boolean

      Comparator signal callback is called by Minecraft on a block every 2 ticks (10 times a second). For optimization purposes, KEX increases this interval to 10 ticks (2 times a second). If high call frequency is important for your block, you can set this parameter to true, and the interval between calls for your block will be set back to 2 ticks. By default this parameter is set to false.

    Returns void

  • Registers the block with given numeric ID as a comparator signal emitter.

    since

    4.0

    Parameters

    • id: number
    • callback: ComparatorSignalCallback

      the function that will be called on every block with given ID in the world, several times a second, and must return comparator signal strength based on given circumstances

    • Optional isCallbackForced: boolean

      Comparator signal callback is called by Minecraft on a block every 2 ticks (10 times a second). For optimization purposes, KEX increases this interval to 10 ticks (2 times a second). If high call frequency is important for your block, you can set this parameter to true, and the interval between calls for your block will be set back to 2 ticks. By default this parameter is set to false.

    Returns void

  • Registers the function that will be called when an entity steps off a block with given numeric ID

    since

    4.0

    Parameters

    Returns void

  • Registers the function that will be called when an entity steps on a block with given numeric ID

    Note: as of June 2023 (latest InnerCore version being 2.3.1b115), InnerCore's Block.registerEntityStepOnFunction is broken, so it's patched by this method in order for it to properly function. If it will be fixed in a future InnerCore update, the patch will be removed.

    since

    4.0

    Parameters

    Returns void

  • registerStateForBlock(id: number, state: Property<any>): void
  • Registers the block with given numeric ID as a possible holder of given block property. You can't add any properties to your custom block's block state object, if you don't specify all the properties held by your block using this method.

    since

    5.0

    Parameters

    Returns void

  • setLightEmission(id: number, data: number, lightLevel: number): void
  • Unlike the InnerCore's Block.SpecialType's lightlevel parameter, this method allows to set separate light level values for different data values of a block with the same ID.

    since

    4.0

    Parameters

    • id: number
    • data: number
    • lightLevel: number

      light level value for the block with given ID and data, clamped between 0 and 15 inclusively

    Returns void

Generated using TypeDoc