Interface ICapabilityGetter<C>
public interface ICapabilityGetter<C>
Abstraction over Items, Entities, and Levels.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandleCapabilityType
(net.neoforged.neoforge.capabilities.BaseCapability<?, ?> capability) static <C> ICapabilityGetter
<C> forBlock
(net.neoforged.neoforge.common.extensions.ILevelExtension level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.entity.BlockEntity blockEntity) static <C> ICapabilityGetter
<C> forBlockEntity
(net.minecraft.world.level.block.entity.BlockEntity blockEntity) static <C> ICapabilityGetter
<C> forEntity
(net.minecraft.world.entity.Entity entity) static <C> ICapabilityGetter
<C> forItem
(net.minecraft.world.item.ItemStack itemStack) <T> T
getCapability
(net.neoforged.neoforge.capabilities.BaseCapability<T, C> capability, C context)
-
Method Details
-
getCapability
-
canHandleCapabilityType
boolean canHandleCapabilityType(net.neoforged.neoforge.capabilities.BaseCapability<?, ?> capability) -
forBlock
static <C> ICapabilityGetter<C> forBlock(net.neoforged.neoforge.common.extensions.ILevelExtension level, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.level.block.state.BlockState state, @Nullable net.minecraft.world.level.block.entity.BlockEntity blockEntity) -
forBlockEntity
static <C> ICapabilityGetter<C> forBlockEntity(net.minecraft.world.level.block.entity.BlockEntity blockEntity) -
forEntity
-
forItem
-