Interface LandPathNodeTypesRegistry.DynamicPathNodeTypeProvider

All Superinterfaces:
LandPathNodeTypesRegistry.PathNodeTypeProvider
Enclosing class:
LandPathNodeTypesRegistry
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static non-sealed interface LandPathNodeTypesRegistry.DynamicPathNodeTypeProvider extends LandPathNodeTypesRegistry.PathNodeTypeProvider
A functional interface that provides the PathNodeType, given the block state world and position.
  • Method Details

    • getPathNodeType

      @Nullable @Nullable PathNodeType getPathNodeType(BlockState state, BlockView world, BlockPos pos, boolean neighbor)
      Gets the PathNodeType for the specified block state at the specified position.

      You can specify what to return if the block state is a direct target of an entity path, or a neighbor block of the entity path.

      For example, for a cactus-like block you should specify PathNodeType.DAMAGE_CACTUS if the block is a direct target (neighbor == false) to specify that an entity should not pass through or above the block because it will cause damage, and PathNodeType.DANGER_CACTUS if the cactus will be found as a neighbor block in the entity path (neighbor == true) to specify that the entity should not get close to the block because is dangerous.

      Parameters:
      state - Current block state.
      world - Current world.
      pos - Current position.
      neighbor - Specifies that the block is in a direct neighbor position to an entity path (directly next to a block that the entity will pass through or above).
      Returns:
      the custom PathNodeType registered for the specified block state at the specified position.