Interface LockAndKeyBehaviors


public interface LockAndKeyBehaviors
Holds the behaviors of the Lock and Key item for different block entities. Get via BibliocraftApi.getLockAndKeyBehaviors(). Register a new behavior by subscribing to RegisterLockAndKeyBehaviorEvent and calling register(...) on it. Make sure to put this call behind a ModList.isLoaded("bibliocraft") check, and in a separate class, to prevent accidental classloading (like you would with client classes).
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends net.minecraft.world.level.block.entity.BlockEntity>
    @Nullable LockAndKeyBehavior<T>
    get(T blockEntity)
     
  • Method Details

    • get

      @Nullable <T extends net.minecraft.world.level.block.entity.BlockEntity> @Nullable LockAndKeyBehavior<T> get(T blockEntity)
      Type Parameters:
      T - The type of the BlockEntity.
      Parameters:
      blockEntity - The BlockEntity to get the behavior for.
      Returns:
      The LockAndKeyBehavior associated with the given BlockEntity, or null if no such LockAndKeyBehavior has been registered.