Interface ICapabilityProvider

All Known Subinterfaces:
ICapabilityProviderImpl<B>, ICapabilitySerializable<T>, IForgeBlockEntity, IForgeEntity, IForgeItemStack, IForgeLevel, IForgeLevelChunk, IForgeLivingEntity
All Known Implementing Classes:
AbstractArrow, AbstractChestedHorse, AbstractClientPlayer, AbstractFish, AbstractFurnaceBlockEntity, AbstractGolem, AbstractHorse, AbstractHurtingProjectile, AbstractIllager, AbstractMinecart, AbstractMinecartContainer, AbstractPiglin, AbstractSchoolingFish, AbstractSkeleton, AbstractVillager, AgeableMob, Allay, AmbientCreature, Animal, AreaEffectCloud, ArmorStand, Arrow, Axolotl, BannerBlockEntity, BarrelBlockEntity, BaseContainerBlockEntity, Bat, BeaconBlockEntity, BedBlockEntity, Bee, BeehiveBlockEntity, BellBlockEntity, BlastFurnaceBlockEntity, Blaze, BlockEntity, Boat, Breeze, BrewingStandBlockEntity, BrushableBlockEntity, CalibratedSculkSensorBlockEntity, Camel, CampfireBlockEntity, CapabilityDispatcher, CapabilityProvider, CapabilityProvider.AsField, Cat, CaveSpider, ChestBlockEntity, ChestBoat, Chicken, ChiseledBookShelfBlockEntity, ClientLevel, Cod, CommandBlockEntity, ComparatorBlockEntity, ConduitBlockEntity, Cow, CrafterBlockEntity, Creeper, DaylightDetectorBlockEntity, DecoratedPotBlockEntity, DispenserBlockEntity, Display, Display.BlockDisplay, Display.ItemDisplay, Display.TextDisplay, Dolphin, Donkey, DragonFireball, DropperBlockEntity, Drowned, ElderGuardian, EmptyLevelChunk, EnchantmentTableBlockEntity, EndCrystal, EnderChestBlockEntity, EnderDragon, EnderDragonPart, EnderMan, Endermite, Entity, Evoker, EvokerFangs, ExperienceOrb, EyeOfEnder, FallingBlockEntity, Fireball, FireworkRocketEntity, FishingHook, FluidBucketWrapper, FluidHandlerBlockEntity, FluidHandlerItemStack, FluidHandlerItemStack.Consumable, FluidHandlerItemStack.SwapEmpty, FluidHandlerItemStackSimple, FluidHandlerItemStackSimple.Consumable, FluidHandlerItemStackSimple.SwapEmpty, FlyingMob, Fox, Frog, FurnaceBlockEntity, Ghast, Giant, GlowItemFrame, GlowSquid, Goat, Guardian, HangingEntity, HangingSignBlockEntity, Hoglin, HopperBlockEntity, Horse, Husk, Illusioner, Interaction, IronGolem, ItemEntity, ItemFrame, ItemStack, JigsawBlockEntity, JukeboxBlockEntity, LargeFireball, LeashFenceKnotEntity, LecternBlockEntity, Level, LevelChunk, LightningBolt, LivingEntity, Llama, LlamaSpit, LocalPlayer, MagmaCube, Marker, Minecart, MinecartChest, MinecartCommandBlock, MinecartFurnace, MinecartHopper, MinecartSpawner, MinecartTNT, Mob, Monster, Mule, MushroomCow, Ocelot, Painting, Panda, Parrot, PartEntity, PathfinderMob, PatrollingMonster, Phantom, Pig, Piglin, PiglinBrute, Pillager, PistonMovingBlockEntity, Player, PolarBear, PrimedTnt, Projectile, Pufferfish, Rabbit, Raider, RandomizableContainerBlockEntity, Ravager, RemotePlayer, Salmon, SculkCatalystBlockEntity, SculkSensorBlockEntity, SculkShriekerBlockEntity, ServerLevel, ServerPlayer, Sheep, ShoulderRidingEntity, Shulker, ShulkerBoxBlockEntity, ShulkerBullet, ShulkerItemStackInvWrapper, SignBlockEntity, Silverfish, Skeleton, SkeletonHorse, SkullBlockEntity, Slime, SmallFireball, SmokerBlockEntity, Sniffer, Snowball, SnowGolem, SpawnerBlockEntity, SpectralArrow, SpellcasterIllager, Spider, Squid, Stray, Strider, StructureBlockEntity, Tadpole, TamableAnimal, TheEndGatewayBlockEntity, TheEndPortalBlockEntity, ThrowableItemProjectile, ThrowableProjectile, ThrownEgg, ThrownEnderpearl, ThrownExperienceBottle, ThrownPotion, ThrownTrident, TraderLlama, TrappedChestBlockEntity, TrialSpawnerBlockEntity, TropicalFish, Turtle, VehicleEntity, Vex, Villager, Vindicator, WanderingTrader, Warden, WaterAnimal, WindCharge, Witch, WitherBoss, WitherSkeleton, WitherSkull, Wolf, Zoglin, Zombie, ZombieHorse, ZombieVillager, ZombifiedPiglin

public interface ICapabilityProvider
  • Method Details

    • getCapability

      @NotNull <T> @NotNull LazyOptional<T> getCapability(@NotNull @NotNull Capability<T> cap, @Nullable @Nullable Direction side)
      Retrieves the Optional handler for the capability requested on the specific side. The return value CAN be the same for multiple faces. Modders are encouraged to cache this value, using the listener capabilities of the Optional to be notified if the requested capability get lost.
      Parameters:
      cap - The capability to check
      side - The Side to check from, CAN BE NULL. Null is defined to represent 'internal' or 'self'
      Returns:
      The requested an optional holding the requested capability.
    • getCapability

      @NotNull default <T> @NotNull LazyOptional<T> getCapability(@NotNull @NotNull Capability<T> cap)