Interface IAttachmentHolder
- 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,AttachmentHolder,AttachmentHolder.AsField,Axolotl,BannerBlockEntity,BarrelBlockEntity,BaseContainerBlockEntity,Bat,BeaconBlockEntity,BedBlockEntity,Bee,BeehiveBlockEntity,BellBlockEntity,BlastFurnaceBlockEntity,Blaze,BlockEntity,Boat,Breeze,BrewingStandBlockEntity,BrushableBlockEntity,CalibratedSculkSensorBlockEntity,Camel,CampfireBlockEntity,Cat,CaveSpider,ChestBlockEntity,ChestBoat,Chicken,ChiseledBookShelfBlockEntity,ChunkAccess,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,FakePlayer,FallingBlockEntity,Fireball,FireworkRocketEntity,FishingHook,FlyingMob,Fox,Frog,FurnaceBlockEntity,Ghast,Giant,GlowItemFrame,GlowSquid,Goat,Guardian,HangingEntity,HangingSignBlockEntity,Hoglin,HopperBlockEntity,Horse,Husk,Illusioner,ImposterProtoChunk,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,ProtoChunk,Pufferfish,Rabbit,Raider,RandomizableContainerBlockEntity,Ravager,RemotePlayer,Salmon,SculkCatalystBlockEntity,SculkSensorBlockEntity,SculkShriekerBlockEntity,ServerLevel,ServerPlayer,Sheep,ShoulderRidingEntity,Shulker,ShulkerBoxBlockEntity,ShulkerBullet,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 IAttachmentHolder
An object that can hold data attachments.
- 
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TgetData(Supplier<AttachmentType<T>> type) Returns the data attachment of the given type.<T> TgetData(AttachmentType<T> type) Returns the data attachment of the given type.booleanReturnstrueif there is any data attachments,falseotherwise.default <T> booleanhasData(Supplier<AttachmentType<T>> type) Returnstrueif there is a data attachment of the give type,falseotherwise.booleanhasData(AttachmentType<?> type) Returnstrueif there is a data attachment of the give type,falseotherwise.default <T> TremoveData(Supplier<AttachmentType<T>> type) Removes the data attachment of the given type.<T> TremoveData(AttachmentType<T> type) Removes the data attachment of the given type.default <T> TsetData(Supplier<AttachmentType<T>> type, T data) Sets the data attachment of the given type.<T> TsetData(AttachmentType<T> type, T data) Sets the data attachment of the given type. 
- 
Method Details
- 
hasAttachments
boolean hasAttachments()Returnstrueif there is any data attachments,falseotherwise. - 
hasData
Returnstrueif there is a data attachment of the give type,falseotherwise. - 
hasData
Returnstrueif there is a data attachment of the give type,falseotherwise. - 
getData
Returns the data attachment of the given type.If there is no data attachment of the given type, the default value is stored in this holder and returned.
- Returns:
 - the data attachment of the given type
 
 - 
getData
Returns the data attachment of the given type.If there is no data attachment of the given type, the default value is stored in this holder and returned.
- Returns:
 - the data attachment of the given type
 
 - 
setData
Sets the data attachment of the given type.- Returns:
 - the previous value for that attachment type, if any, or 
nullif there was none 
 - 
setData
Sets the data attachment of the given type.- Returns:
 - the previous value for that attachment type, if any, or 
nullif there was none 
 - 
removeData
Removes the data attachment of the given type.- Returns:
 - the previous value for that attachment type, if any, or 
nullif there was none 
 - 
removeData
Removes the data attachment of the given type.- Returns:
 - the previous value for that attachment type, if any, or 
nullif there was none 
 
 -