Interface LandPathTypeRegistry.StaticPathTypeProvider

All Superinterfaces:
LandPathTypeRegistry.PathTypeProvider
Enclosing class:
LandPathTypeRegistry
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 LandPathTypeRegistry.StaticPathTypeProvider extends LandPathTypeRegistry.PathTypeProvider
A functional interface that provides the PathType, given the block state.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.world.level.pathfinder.PathType
    getPathType(net.minecraft.world.level.block.state.BlockState state, boolean neighbor)
    Gets the PathType for the specified block state.
  • Method Details

    • getPathType

      @Nullable net.minecraft.world.level.pathfinder.PathType getPathType(net.minecraft.world.level.block.state.BlockState state, boolean neighbor)
      Gets the PathType for the specified block state.

      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 use PathType.DAMAGING if the block is a direct target in the entity path (neighbor == false) to specify that an entity should not pass through or above the block because it will cause damage, and you should use PathType.DAMAGING_IN_NEIGHBOR if the block is a neighbor block in the entity path (neighbor == true) to specify that the entity should not get close to the block because it is dangerous.

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