Interface DataSerializable

All Known Subinterfaces:
Advancement, Aerial, Ageable, Agent, Ambient, Animal, AnvilCost, Aquatic, Archetype<S,E>, AreaEffectCloud, ArmorStand, Arrow, ArrowEntity, Axolotl, Banner, BannerPatternLayer, Barrel, Bat, Beacon, Bed, Bee, Beehive, Bell, BlastFurnace, Blaze, BlockEntity, BlockEntityArchetype, BlockOccupiedMinecart, BlockSnapshot, BlockState, Boat, Boss, BrewingStand, Campfire, CarrierBlockEntity, CarrierMinecart<M>, Cat, CaveSpider, Chest, ChestMinecart, Chicken, ClientPlayer, Cod, CommandBlock, CommandBlockMinecart, Comparator, ComplexLiving<T>, ComplexLivingPart<P>, Conduit, Cow, Creature, Creeper, DamagingProjectile, DataPackSerializable, DaylightDetector, Dispenser, 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, FireballEntity, FireworkEffect, FireworkRocket, Fish, FishingBobber, FluidStack, FluidStackSnapshot, FluidState, Fox, Furnace, FurnaceBlockEntity, FurnaceMinecart, FusedExplosive, GameProfile, Ghast, Giant, GlowSquid, Goat, Golem, Guardian, Hanging, Hoglin, Hopper, HopperMinecart, Horse, HorseLike, Hostile, Human, Humanoid, Husk, Illager, Illusioner, IronGolem, Item, ItemFrame, ItemStack, ItemStackSnapshot, Jigsaw, 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, Ocelot, PackHorse, Painting, Panda, Parrot, ParticleEffect, Patroller, Phantom, Pig, Piglin, PiglinBrute, PiglinLike, Pillager, Piston, Player, PolarBear, Potion, PotionEffect, PrimedTNT, ProfileProperty, Projectile, Pufferfish, Rabbit, Raider, Ranger, Ravager, RecipeRegistration, RemotePlayer, Salmon, SchoolingFish, SculkSensor, SerializableDataHolder, SerializableDataHolder.Immutable<I>, SerializableDataHolder.Mutable, ServerLocation, ServerPlayer, Sheep, Shulker, ShulkerBox, ShulkerBullet, Sign, Silverfish, Sittable, Skeleton, SkeletonHorse, SkeletonLike, Skull, Slime, SmallFireball, Smoker, Snowball, SnowGolem, Spawner, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, Squid, State<S>, Stray, Strider, StructureBlock, TagTemplate, TameableAnimal, TameableHorse, TNTMinecart, TradeOffer, Trader, TraderLlama, TrappedChest, Trident, TropicalFish, Turtle, VariableAmount, Vehicle, Vex, Villager, Vindicator, WanderingTrader, 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.
      The version of the content being serialized
    • toContainer

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