Interface IZonedBE

All Superinterfaces:
IBE

public interface IZonedBE extends IBE
A block entity with a "working zone."
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Predicate<net.minecraft.world.entity.LivingEntity>
    Returns `true` when the entity is an animal and is an adult.
    static final Predicate<net.minecraft.world.entity.LivingEntity>
    Returns `true` when the entity is a baby.
    static final Predicate<net.minecraft.world.entity.LivingEntity>
    Returns `true` when the entity is an animal and is a baby.
    static final Predicate<net.minecraft.world.entity.Entity>
    Returns `true` when the entity is an ItemEntity.
    static final Predicate<net.minecraft.world.entity.Entity>
    Returns `true` when the entity is a Player.
    static final Predicate<net.minecraft.world.entity.LivingEntity>
    Returns `true` when the entity is **NOT** a baby.
    static final Predicate<net.minecraft.world.entity.Entity>
    Returns `true` when the entity is **NOT** Player.
    static final Predicate<net.minecraft.world.entity.Entity>
    Returns `true` when the entity is **NOT** a Player.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.neoforged.neoforge.common.util.Lazy<net.minecraft.world.phys.AABB>
    Get the cached work zone for the block entity.
    default <T extends net.minecraft.world.entity.Entity>
    List<T>
    getEntitiesInWorkZone(Class<T> class_, Predicate<T> filter)
    Get all entities in the work zone that are of class_ and match filter.
    default <T extends net.minecraft.world.entity.Entity>
    Optional<T>
    getFirstEntityInWorkZone(Class<T> class_, Predicate<T> filter)
    Finds the first entity within the work zone.
    default net.minecraft.world.phys.AABB
    Gets the work zone for the block entity.
    default int
    Get the work zone AABB's height in blocks.
    default int
    Get the work zone AABB's range in blocks.
    default void
    Invalidates the cached work zone.

    Methods inherited from interface top.girlkisser.lazuli.api.block.IBE

    getBlockPos, getBlockState, getLevel, setChanged
  • Field Details

    • IS_PLAYER

      static final Predicate<net.minecraft.world.entity.Entity> IS_PLAYER
      Returns `true` when the entity is a Player.
    • NOT_PLAYER

      static final Predicate<net.minecraft.world.entity.Entity> NOT_PLAYER
      Returns `true` when the entity is **NOT** a Player.
    • IS_ITEM

      static final Predicate<net.minecraft.world.entity.Entity> IS_ITEM
      Returns `true` when the entity is an ItemEntity.
    • NOT_ITEM

      static final Predicate<net.minecraft.world.entity.Entity> NOT_ITEM
      Returns `true` when the entity is **NOT** Player.
    • IS_BABY

      static final Predicate<net.minecraft.world.entity.LivingEntity> IS_BABY
      Returns `true` when the entity is a baby.
    • NOT_BABY

      static final Predicate<net.minecraft.world.entity.LivingEntity> NOT_BABY
      Returns `true` when the entity is **NOT** a baby.
    • IS_ADULT_ANIMAL

      static final Predicate<net.minecraft.world.entity.LivingEntity> IS_ADULT_ANIMAL
      Returns `true` when the entity is an animal and is an adult.
    • IS_BABY_ANIMAL

      static final Predicate<net.minecraft.world.entity.LivingEntity> IS_BABY_ANIMAL
      Returns `true` when the entity is an animal and is a baby.
  • Method Details

    • getWorkZone

      default net.minecraft.world.phys.AABB getWorkZone()
      Gets the work zone for the block entity. Generally you should prefer getCachedWorkZone()
      Returns:
      The work zone for the block entity.
    • getWorkZoneRange

      default int getWorkZoneRange()
      Get the work zone AABB's range in blocks.
      Returns:
      The range.
    • getWorkZoneHeight

      default int getWorkZoneHeight()
      Get the work zone AABB's height in blocks.
      Returns:
      The height.
    • getCachedWorkZone

      net.neoforged.neoforge.common.util.Lazy<net.minecraft.world.phys.AABB> getCachedWorkZone()
      Get the cached work zone for the block entity.
      Returns:
      The AABB.
    • invalidateWorkZone

      default void invalidateWorkZone()
      Invalidates the cached work zone.
    • getFirstEntityInWorkZone

      default <T extends net.minecraft.world.entity.Entity> Optional<T> getFirstEntityInWorkZone(Class<T> class_, @Nullable Predicate<T> filter)
      Finds the first entity within the work zone.
      Type Parameters:
      T - The entity type to find.
      Parameters:
      class_ - The entity class to find. Use Entity.class for "any."
      filter - A filter to apply.
      Returns:
      The first entity, if any.
    • getEntitiesInWorkZone

      default <T extends net.minecraft.world.entity.Entity> List<T> getEntitiesInWorkZone(Class<T> class_, @Nullable Predicate<T> filter)
      Get all entities in the work zone that are of class_ and match filter.
      **This method will throw an exception if the level is null.**
      Type Parameters:
      T - The entity type to find.
      Parameters:
      class_ - The entity class to find. Use Entity.class for "any."
      filter - A filter to apply.
      Returns:
      The first entity, if any.