Skip to content

0.22 ➝ 0.23

Contexts

Contexts have been completely reworked to make them more flexible and reusable. Most notably, parameter types are now found on the intention object itself:

val ctx = Context.intention(DefaultContextIntentions.BlockPlace)
    .param(DefaultContextParamTypes.BLOCK_POS, pos)
    .param(DefaultContextParamTypes.BLOCK_TYPE_NOVA, Blocks.EXAMPLE_BLOCK)
    .build()
val ctx = Context.intention(BlockPlace)
    .param(BlockPlace.BLOCK_POS, pos)
    .param(BlockPlace.BLOCK_TYPE_NOVA, Blocks.EXAMPLE_BLOCK)
    .build()

For custom parameter types and intentions, check out the updated contexts page.

Item- and block interactions

Item and block interactions no longer use WrappedPlayerInteractEvent (or any bukkit event). Interaction handling is now closer to vanilla behavior. This resolves several issues, like off-hand events only being fired sometimes. Interaction handling is now predictable and consistent. (Check out the flowcharts on the item behavior page)

  • In ItemBehavior, the methods handleInteract and handleEntityInteract were replaced with use, useOnBlock, and useOnEntity.
  • Additionally, modifyUseRemainder was removed. Instead, handleUseFinished now returns an ItemAction (as used in InteractionResult.Success) that can be used to create the remaining item stack.
  • In BlockBehavior, handleInteract was replaced with use and useItemOn. Check out the updated item behavior and block behavior pages for a detailed overview of the new interaction system.
  • Block behaviors are no longer called when right-clicking a block while sneaking. This aligns with vanilla behavior.

Entity variants

  • WolfVariantBuilder: Texture functions (wild(), trame(), etc.) are now grouped for adult and baby model under adultTextures { } and babyTextures { } blocks
  • CatVariantBuilder, CowVariantBuilder, ChickenVariantBuilder, PigVariantBuilder: texture was renamed to adulTexture and babyTexture was added.
  • WolfSoundVariantBuilder: Like for the textures, sounds are now grouped under adultSounds { ... } and babySounds { ... } blocks. Unlike textures, baby sounds default to adult sounds. stepSound() is now available.

Notable dependency updates

The following dependencies were updated and include breaking changes: