Interface DataSerializable

All Known Subinterfaces:
Advancement, AdvancementTemplate, Aerial, Ageable, Agent, Allay, Ambient, Animal, AnvilCost, Aquatic, Archetype<S,E>, AreaEffectCloud, ArmorStand, Arrow, ArrowEntity, Axolotl, Banner, BannerPatternLayer, Barrel, Bat, Beacon, Bed, Bee, Beehive, Bell, BiomeTemplate, BlastFurnace, Blaze, BlockDisplay, BlockEntity, BlockEntityArchetype, BlockOccupiedMinecart, BlockSnapshot, BlockState, Boat, Boss, BrewingStand, Camel, Campfire, CarrierBlockEntity, CarrierMinecart<M>, CarverTemplate, Cat, CaveSpider, ChatTypeTemplate, Chest, ChestBoat, ChestMinecart, Chicken, ClientPlayer, Cod, CommandBlock, CommandBlockMinecart, Comparator, ComplexLiving<T>, ComplexLivingPart<P>, Conduit, Cow, Creature, Creeper, DamageTypeTemplate, DamagingProjectile, DataPackEntry<T>, DaylightDetector, DensityFunctionTemplate, Dispenser, DisplayEntity, Dolphin, Donkey, DragonFireball, Dropper, Drowned, Egg, ElderGuardian, Enchantment, EnchantmentTable, EndCrystal, EnderChest, EnderDragon, EnderDragonPart, Enderman, Endermite, EnderPearl, EndGateway, EndPortal, Entity, EntityArchetype, EntitySnapshot, EntityTargetingProjectile, Evoker, EvokerFangs, ExperienceBottle, ExperienceOrb, Explosive, ExplosiveFireball, EyeOfEnder, FallingBlock, FeatureTemplate, FireballEntity, FireworkEffect, FireworkRocket, Fish, FishingBobber, FluidStack, FluidStackSnapshot, FluidState, Fox, Frog, Furnace, FurnaceBlockEntity, FurnaceMinecart, FusedExplosive, GameProfile, Ghast, Giant, GlowSquid, Goat, Golem, Guardian, Hanging, Hoglin, Hopper, HopperMinecart, Horse, HorseLike, Hostile, Human, Humanoid, Husk, Illager, Illusioner, Interaction, IronGolem, Item, ItemDisplay, ItemFrame, ItemStack, ItemStackSnapshot, Jigsaw, JigsawPoolTemplate, Jukebox, KeyValueMatcher<V>, LeashKnot, Lectern, LightningBolt, Living, Llama, LlamaLike, LlamaSpit, LocalPlayer, LocatableBlock, LocatableSnapshot<T>, MagmaCube, MapCanvas, MapColor, MapDecoration, MapInfo, Marker, Minecart, MinecartLike, MobSpawner, Monster, Mooshroom, Mule, NameableBlockEntity, NameableCarrierBlockEntity, NoiseGeneratorConfigTemplate, NoiseTemplate, Ocelot, PackHorse, Painting, Panda, Parrot, ParticleEffect, Patroller, Phantom, Pig, Piglin, PiglinBrute, PiglinLike, Pillager, Piston, PlacedFeatureTemplate, Player, PolarBear, Potion, PotionEffect, PrimedTNT, ProcessorListTemplate, ProfileProperty, Projectile, Pufferfish, Rabbit, Raider, Ranger, Ravager, RecipeRegistration, RemotePlayer, Salmon, SchematicTemplate, SchoolingFish, SculkSensor, SerializableDataHolder, SerializableDataHolder.Immutable<I>, SerializableDataHolder.Mutable, ServerLocation, ServerPlayer, Sheep, Shulker, ShulkerBox, ShulkerBullet, Sign, Silverfish, Sittable, Skeleton, SkeletonHorse, SkeletonLike, Skull, Slime, SmallFireball, Smoker, Sniffer, Snowball, SnowGolem, Spawner, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, Squid, State<S>, Stray, Strider, StructureBlock, StructureSetTemplate, StructureTemplate, Tadpole, TagTemplate<T>, TameableAnimal, TameableHorse, TextDisplay, TNTMinecart, TradeOffer, Trader, TraderLlama, TrappedChest, Trident, TropicalFish, Turtle, VariableAmount, Vehicle, Vex, Villager, Vindicator, WanderingTrader, Warden, Weather, WeatherEffect, Witch, Wither, WitherSkeleton, WitherSkull, Wolf, WorldTemplate, WorldTypeTemplate, Zoglin, Zombie, ZombieHorse, ZombieLike, ZombieVillager, ZombifiedPiglin
All Known Implementing Classes:
BlockTransaction, BlockTransactionReceipt, Color, EmptyObject, RespawnLocation, SlotTransaction, Transaction, VariableAmount.BaseAndAddition, VariableAmount.BaseAndVariance, VariableAmount.Fixed, VariableAmount.OptionalAmount, WeightedSerializableObject

public interface DataSerializable
Represents an object that can be represented by a DataContainer.

DataContainers received from toContainer() should be considered to be copies of the original data, and therefore, thread safe.

  • Method Details

    • contentVersion

      int contentVersion()
      Gets the content version of this DataSerializable. The version may differ between instances of plugins and implementations such that the DataView from toContainer() may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand with DataContentUpdater as it is required when there exists any DataView of this DataSerializable with an "older" version.
      Returns:
      The version of the content being serialized
    • toContainer

      DataContainer toContainer()
      Serializes this object into a comprehensible DataContainer.
      Returns:
      A newly created DataContainer