Interface SerializableDataHolder.Mutable

All Superinterfaces:
CopyableDataHolder, DataHolder, DataHolder.Mutable, DataSerializable, SerializableDataHolder, ValueContainer
All Known Subinterfaces:
AcceleratingProjectile, Aerial, Ageable, Agent, Allay, Ambient, Angerable, Animal, Aquatic, Archetype<S,E>, AreaEffectCloud, Armadillo, ArmorStand, Arrow, ArrowLike, Attackable, Axolotl, Banner, Barrel, Bat, Beacon, Bed, Bee, Beehive, Bell, BlastFurnace, Blaze, BlockDisplay, BlockEntity, BlockEntityArchetype, BlockOccupiedMinecart, Boat, Bogged, Boss, Breedable, Breeze, BreezeWindCharge, BrewingStand, Camel, Campfire, CarrierBlockEntity, CarrierMinecart<M>, Cat, CaveSpider, Chargeable, Chest, ChestBoat, ChestMinecart, Chicken, ClientPlayer, Cod, CommandBlock, CommandBlockMinecart, Comparator, ComplexLiving<T>, ComplexLivingPart<P>, Conduit, Cow, Crafter, Creeper, DaylightDetector, DecoratedPot, Dispenser, DisplayEntity, Dolphin, Donkey, DragonFireball, Dropper, Drowned, Egg, ElderGuardian, EnchantmentTable, EndCrystal, EnderChest, EnderDragon, EnderDragonPart, Enderman, Endermite, EnderPearl, EndGateway, EndPortal, Entity, EntityArchetype, Evoker, EvokerFangs, ExperienceBottle, ExperienceOrb, Explosive, ExplosiveFireball, EyeOfEnder, FallingBlock, FireworkRocket, Fish, FishingBobber, FluidStack, Fox, Frog, Furnace, FurnaceBlockEntity, FurnaceMinecart, FusedExplosive, Ghast, Giant, GlowItemFrame, GlowSquid, Goat, Golem, Guardian, Hanging, Hoglin, Hopper, HopperMinecart, Horse, HorseLike, Hostile, Human, Humanoid, Husk, IgnitingProjectile, Illager, Illusioner, Interaction, IronGolem, Item, ItemDisplay, ItemFrame, ItemRepresentable, ItemStack, Jigsaw, Jukebox, Leashable, LeashKnot, Lectern, LightningBolt, Living, Llama, LlamaSpit, LocalPlayer, MagmaCube, Marker, Minecart, MinecartLike, MobSpawner, Monster, Mooshroom, Mule, NameableBlockEntity, NameableCarrierBlockEntity, Ocelot, OminousItemSpawner, Ownable, PackHorse, Painting, Panda, Parrot, PathfinderAgent, Patroller, Phantom, Pig, Piglin, PiglinBrute, PiglinLike, Pillager, Piston, Player, PolarBear, Potion, PrimedTNT, Projectile, Pufferfish, Rabbit, Raider, RangedAgent, Ranger, Ravager, RemotePlayer, Saddleable, Salmon, SchoolingFish, SculkSensor, ServerPlayer, Sheep, Shulker, ShulkerBox, ShulkerBullet, Sign, Silverfish, Sittable, Skeleton, SkeletonHorse, SkeletonLike, Skull, Slime, SmallFireball, Smoker, Sniffer, Snowball, SnowGolem, Spawner, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, Squid, Stray, Strider, StructureBlock, Tadpole, TameableAnimal, Targeting, TextDisplay, ThrowableItemProjectile, TNTMinecart, TraderLlama, TrappedChest, TrialSpawner, Trident, TropicalFish, Turtle, Vehicle, Vex, Villager, VillagerLike, Vindicator, WanderingTrader, Warden, WindCharge, WindChargeLike, Witch, Wither, WitherSkeleton, WitherSkull, Wolf, Zoglin, Zombie, ZombieHorse, ZombieVillager, ZombifiedPiglin
Enclosing interface:
SerializableDataHolder

public static interface SerializableDataHolder.Mutable extends SerializableDataHolder, DataHolder.Mutable
  • Method Details

    • setRawData

      void setRawData(DataView container) throws InvalidDataException
      Attempts to set all data of this DataHolder according to the DataView's held information. Using this to modify known to be Keys provided dynamically through DataProviders is unsupported. The format of the DataView's contained data is dependent on the type of DataHolder.Mutable this is. In some cases, the format is specified based on a more specific type, such as for EntityTypes, or ItemTypes.

      This setter is used to provide setting custom data that is not represented by the Data API, including forge mods and other unknown data. Attempts to validate the provided view is not always possible due to the nature of the data being parsed by the implementation, and only understood by clients. Other cases where the data can be validated and the data is incompatible will end up throwing an InvalidDataException.

      Parameters:
      container - A container containing all raw data to set on this data holder
      Throws:
      InvalidDataException - If the container is missing or has invalid data that this holder will refuse
    • copy

      Description copied from interface: CopyableDataHolder
      Creates a clone copy of this CopyableDataHolder as a new CopyableDataHolder such that all the Values are safely duplicated to the new instance. It is not guaranteed that the returning container is of the same type as this container.
      Specified by:
      copy in interface CopyableDataHolder
      Specified by:
      copy in interface SerializableDataHolder
      Returns:
      The new copy