### Block API Lookup
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-api-lookup-api-v1/README.md
The primary way to query API instances for blocks in the world. It exposes a `find` function to retrieve an API instance and multiple `register*` functions to register APIs for blocks and block entities. Instances can be obtained using the `get` function.
```java
package net.fabricmc.fabric.api.lookup.v1.block;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface BlockApiLookup {
/**
* Finds an API instance for the given block state and context.
*
* @param pos The block position.
* @param context The context object.
* @return The API instance, or null if not found.
*/
A find(BlockPos pos, C context);
/**
* Registers an API provider for a specific block or block entity.
*
* @param api The API instance.
* @param block The block or block entity to register for.
*/
void registerForBlock(A api, Object block);
/**
* Registers an API provider for a specific block entity type.
*
* @param api The API instance.
* @param blockEntityType The block entity type to register for.
*/
void registerForBlockEntity(A api, Object blockEntityType);
/**
* Gets the API lookup instance for a given world.
*
* @param world The server world.
* @return The BlockApiLookup instance.
*/
static BlockApiLookup get(World world) {
// Implementation details omitted for brevity
return null;
}
}
```
--------------------------------
### Client Lifecycle Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Provides an overview of client-related lifecycle events in Fabric. These events are specific to the Minecraft client and cover startup and shutdown.
```java
package net.fabricmc.fabric.api.client.event.lifecycle.v1;
// ClientLifecycleEvents contains events related to the lifecycle of a Minecraft client.
// Currently, this contains events related to when the Minecraft Client is starting or stopping.
// Note: These events are only available on a client. Trying to access these events on a dedicated server will cause the game to crash.
```
--------------------------------
### Server Lifecycle Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Provides an overview of server-related lifecycle events in Fabric. These events are located in `net.fabricmc.fabric.api.event.lifecycle.v1` and cover server startup, data pack reloads, and shutdown.
```java
package net.fabricmc.fabric.api.event.lifecycle.v1;
// ServerLifecycleEvents contains lifecycle events related to a Minecraft server.
// This includes events which indicate when a server is starting up, is in a data pack reload or shutting down.
```
--------------------------------
### Fabric Transfer API Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-transfer-api-v1/README.md
Provides an overview of the Fabric Transfer API, including its core components like Transactions, Storages, Fluid Transfer, and Item Transfer. It explains the purpose and basic usage of each module.
```APIDOC
Fabric Transfer API (v1)
This module provides common facilities for the transfer of fluids and other game resources.
## Transactions
The `Transaction` system provides a scope that can be used to simulate any number of transfer operations, and then cancel or validate all of them at once. Every transfer operation requires a `Transaction` parameter. `SnapshotParticipant` is the reference implementation of a "participant", that is an object participating in a transaction.
## Storages
A `Storage` is any object that can store resources of type `T`. Its contents can be read, and resources can be inserted into it or extracted from it. `StorageUtil` provides helpful functions to work with `Storage`s. Implementors of inventories with a fixed number of "slots" or "tanks" can use `SingleVariantStorage`, and combine them with `CombinedStorage`.
## Fluid Transfer
A `Storage` is any object that can store fluids. Instances can be accessed through the API lookups defined in `FluidStorage`. The unit for fluid transfer is 1/81000ths of a bucket, also known as droplets. `FluidConstants` contains helpful constants. Client-side Fluid variant rendering will use regular fluid rendering by default. `Fluid`s that wish to render differently depending on the stored NBT data can register a `FluidVariantRenderHandler`.
## Item Transfer
A `Storage` is any object that can store items. Instances can be accessed through the API lookup defined in `ItemStorage`. The lookup already provides compatibility with vanilla inventories, however it may sometimes be interesting to use `InventoryStorage` or `PlayerInventoryStorage` when interaction with `Inventory`-based APIs is required.
## ContainerItemContext
`ContainerItemContext` is a context designed for `ItemApiLookup` queries that allows the returned APIs to interact with the containing inventory. Notably, it is used by the `FluidStorage.ITEM` lookup for fluid-containing items.
```
--------------------------------
### Item API Lookup
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-api-lookup-api-v1/README.md
The way to query API instances from item stacks. It exposes a `find` function to retrieve an API instance and multiple `register*` functions to register APIs for items. This allows items to provide specific functionalities.
```java
package net.fabricmc.fabric.api.lookup.v1.item;
import net.minecraft.item.ItemStack;
public interface ItemApiLookup {
/**
* Finds an API instance for the given item stack and context.
*
* @param stack The item stack.
* @param context The context object.
* @return The API instance, or null if not found.
*/
A find(ItemStack stack, C context);
/**
* Registers an API provider for a specific item.
*
* @param api The API instance.
* @param item The item to register for.
*/
void registerForItem(A api, Object item);
/**
* Gets the API lookup instance for item stacks.
*
* @return The ItemApiLookup instance.
*/
static ItemApiLookup get() {
// Implementation details omitted for brevity
return null;
}
}
```
--------------------------------
### Server World Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Covers events related to the lifecycle of a `ServerWorld`. This includes events for loading and unloading `ServerWorld`s.
```java
package net.fabricmc.fabric.api.event.lifecycle.v1;
// ServerWorldEvents are events related to the lifecycle a ServerWorld.
// Currently, this contains events related to loading and unloading ServerWorlds.
```
--------------------------------
### Client Entity Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Explains events related to the lifecycle of entities in a `ClientWorld`. This currently includes an event for an entity being loaded into the `ClientWorld`.
```java
package net.fabricmc.fabric.api.client.event.lifecycle.v1;
// ClientEntityEvents contains events related to the lifecycle of entities in a ClientWorld.
// Currently, this contains event for an entity being loaded into a ClientWorld.
```
--------------------------------
### Server Entity Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Explains events related to the lifecycle of entities in a `ServerWorld`. Currently, this includes an event for entity loading, with the unload event not yet implemented.
```java
package net.fabricmc.fabric.api.event.lifecycle.v1;
// ServerEntityEvents are events related to the lifecycle of entities in a ServerWorld.
// Currently, this only contains an event for an entity being loaded into a ServerWorld.
The unload event has not been implemented yet.
```
--------------------------------
### Server Block Entity Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Covers events related to the lifecycle of block entities in a `ServerWorld`. This includes events for loading and unloading block entities.
```java
package net.fabricmc.fabric.api.event.lifecycle.v1;
// ServerBlockEntityEvents are events related to the lifecycle of block entities in a ServerWorld.
// Currently, this contains events related to loading and unloading block entities in a ServerWorld.
```
--------------------------------
### Server Chunk Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Details events concerning the lifecycle of chunks within a `ServerWorld`. This covers events related to chunk loading and unloading.
```java
package net.fabricmc.fabric.api.event.lifecycle.v1;
// ServerChunkEvents are events related to the lifecycle of chunks in a ServerWorld.
// Currently, this contains events related to loading and unloading chunks in a ServerWorld.
```
--------------------------------
### Entity API Lookup
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-api-lookup-api-v1/README.md
The way to query API instances from entities. It exposes a `find` function to retrieve an API instance and multiple `register*` functions to register APIs for entity types. This enables entities to offer specific functionalities.
```java
package net.fabricmc.fabric.api.lookup.v1.entity;
import net.minecraft.entity.Entity;
public interface EntityApiLookup {
/**
* Finds an API instance for the given entity and context.
*
* @param entity The entity.
* @param context The context object.
* @return The API instance, or null if not found.
*/
A find(Entity entity, C context);
/**
* Registers an API provider for a specific entity type.
*
* @param api The API instance.
* @param entityType The entity type to register for.
*/
void registerForEntityType(A api, Object entityType);
/**
* Gets the API lookup instance for entities.
*
* @return The EntityApiLookup instance.
*/
static EntityApiLookup get() {
// Implementation details omitted for brevity
return null;
}
}
```
--------------------------------
### Custom API Lookup Helpers
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-api-lookup-api-v1/README.md
Helper classes in the `custom` subpackage to accelerate implementations of `ApiLookup`s for custom objects. These provide different query parameters compared to the standard block lookups.
```java
package net.fabricmc.fabric.api.lookup.v1.custom;
import java.util.Map;
public interface ApiLookupMap {
/**
* Retrieves an API instance from the map.
*
* @param key The key for the API.
* @param context The context object.
* @return The API instance, or null if not found.
*/
A find(Object key, C context);
/**
* Creates a new ApiLookupMap.
*
* @param The type of the API.
* @param The type of the context.
* @return A new ApiLookupMap instance.
*/
static ApiLookupMap create() {
// Implementation details omitted for brevity
return null;
}
}
public interface ApiProviderMap {
/**
* Registers a provider for a given key.
*
* @param key The key for the provider.
* @param provider The API provider.
*/
void register(Object key, A provider);
/**
* Creates a new ApiProviderMap.
*
* @param The type of the API.
* @param The type of the context.
* @return A new ApiProviderMap instance.
*/
static ApiProviderMap create() {
// Implementation details omitted for brevity
return null;
}
}
```
--------------------------------
### Client Chunk Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Covers events related to the lifecycle of chunks on a Minecraft client. This includes events for loading and unloading chunks in a `ClientWorld`.
```java
package net.fabricmc.fabric.api.client.event.lifecycle.v1;
// ClientChunkEvents contains events related to the lifecycle of chunks on a Minecraft client.
// Currently, this contains events related to loading and unloading chunks in a ClientWorld.
```
--------------------------------
### Client Block Entity Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Details events concerning the lifecycle of block entities in a `ClientWorld`. This includes events related to block entity loading and unloading.
```java
package net.fabricmc.fabric.api.client.event.lifecycle.v1;
// ClientBlockEntityEvents contains events related to the lifecycle of block entities in a ClientWorld.
// Currently, this contains events related to loading and unloading block entities in a ClientWorld.
```
--------------------------------
### Enhanced Loot Table and Loot Pool Builders
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-loot-api-v2/README.md
Enhances LootTable.Builder and LootPool.Builder with additional methods for handling existing objects and collections. These builders implement injected interfaces for extended functionality.
```APIDOC
FabricLootTableBuilder:
Description: Injected interface for LootTable.Builder with additional methods.
Methods:
copyOf(LootTable):
Description: Creates a copy of an existing loot table as a builder.
Parameters:
- LootTable: The loot table to copy.
Returns: A new LootTable.Builder instance.
FabricLootPoolBuilder:
Description: Injected interface for LootPool.Builder with additional methods.
Methods:
copyOf(LootPool):
Description: Creates a copy of an existing loot pool as a builder.
Parameters:
- LootPool: The loot pool to copy.
Returns: A new LootPool.Builder instance.
```
--------------------------------
### Block API Cache
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-api-lookup-api-v1/README.md
A `BlockApiLookup` bound to a position and a server world, allowing for much faster repeated API queries. It optimizes lookups by caching results for a specific block location.
```java
package net.fabricmc.fabric.api.lookup.v1.block;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface BlockApiCache {
/**
* Finds an API instance for the cached block position and context.
*
* @param context The context object.
* @return The API instance, or null if not found.
*/
A find(C context);
/**
* Creates a new BlockApiCache.
*
* @param lookup The BlockApiLookup to use.
* @param pos The block position.
* @param context The context object.
* @return A new BlockApiCache instance.
*/
static BlockApiCache create(BlockApiLookup lookup, BlockPos pos, C context) {
// Implementation details omitted for brevity
return null;
}
}
```
--------------------------------
### Client Tick Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Details events related to the ticking of a Minecraft client. These events indicate the beginning and end of a client tick and, if in game, the `ClientWorld` tick.
```java
package net.fabricmc.fabric.api.client.event.lifecycle.v1;
// ClientTickEvents contains events related to ticking of a Minecraft client.
// There are events that indicate the beginning and end of the tick for the client and the ClientWorld if in game.
```
--------------------------------
### Server Tick Events Overview
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-lifecycle-events-v1/README.md
Details events related to the ticking of a Minecraft server. These events signal the beginning and end of a server tick and individual `ServerWorld` ticks.
```java
package net.fabricmc.fabric.api.event.lifecycle.v1;
// ServerTickEvents contains events related to the ticking of a Minecraft server.
// There are events that indicate the beginning and end of the tick for the server and each ServerWorld.
```
--------------------------------
### Loot Table Events
Source: https://github.com/zhang-114/nothing/blob/1.20.4_fabric/Fabric_api_0.97.2/fabric-loot-api-v2/README.md
Provides events for modifying loot tables. LootTableEvents.REPLACE allows complete replacement, while LootTableEvents.MODIFY allows adding pools or functions to existing tables. Both events provide access to a LootTableSource to check the origin of the loot table.
```APIDOC
LootTableEvents.REPLACE:
Description: Runs first to completely replace loot tables.
Dependencies: None.
Inputs: Loot table, LootTableSource.
Outputs: Modified loot table.
LootTableEvents.MODIFY:
Description: Runs after REPLACE to modify loot tables, including adding new loot pools or functions.
Dependencies: LootTableEvents.REPLACE (optional).
Inputs: Loot table, LootTableSource.
Outputs: Modified loot table.
LootTableSource:
Description: An object that indicates where a loot table is loaded from.
Usage: Can be used to check if a loot table originates from a user data pack to avoid modifying user-provided data.
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.