Class HorseOwnerData

java.lang.Object
tschipp.callablehorses.common.data.HorseOwnerData

public class HorseOwnerData extends Object
Ownership data held by every Player. Attached via data attachments on Fabric/NeoForge and via a capability on Forge.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<HorseOwnerData> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,HorseOwnerData> STREAM_CODEC
  • Constructor Details

    • HorseOwnerData

      public HorseOwnerData()
  • Method Details

    • getUpgradedHorseNBT

      public net.minecraft.nbt.CompoundTag getUpgradedHorseNBT()
      The stored tag, brought up to the running game's data version first. Anything that reads the stored horse has to go through here rather than getHorseNBT(), or it works off pre-1.21 keys - including the entity id itself, which a datafixer may have renamed. Written back so the upgrade only runs once per binding.
    • createHorseEntity

      @Nullable public @Nullable net.minecraft.world.entity.Mob createHorseEntity(net.minecraft.world.level.Level world)
    • setHorse

      public boolean setHorse(net.minecraft.world.entity.Mob horse, net.minecraft.world.entity.player.Player player)
      Returns:
      false if the mount could not be bound, in which case nothing was written.
    • clearHorse

      public void clearHorse()
    • getHorseNBT

      public net.minecraft.nbt.CompoundTag getHorseNBT()
    • setHorseNBT

      public void setHorseNBT(net.minecraft.nbt.CompoundTag nbt)
    • getHorseNum

      public int getHorseNum()
    • setHorseNum

      public void setHorseNum(int num)
    • getStorageUUID

      public String getStorageUUID()
    • setStorageUUID

      public void setStorageUUID(String id)
    • getLastSeenPosition

      public net.minecraft.world.phys.Vec3 getLastSeenPosition()
    • setLastSeenPosition

      public void setLastSeenPosition(net.minecraft.world.phys.Vec3 pos)
    • getLastSeenDim

      public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getLastSeenDim()
    • setLastSeenDim

      public void setLastSeenDim(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim)
    • toNbt

      public net.minecraft.nbt.CompoundTag toNbt()
    • fromNbt

      public static HorseOwnerData fromNbt(net.minecraft.nbt.CompoundTag tag)
    • readNbt

      public void readNbt(net.minecraft.nbt.CompoundTag tag)
    • copyFrom

      public void copyFrom(HorseOwnerData other)
    • copy

      public HorseOwnerData copy()