Class HorseOwnerData
java.lang.Object
tschipp.callablehorses.common.data.HorseOwnerData
Ownership data held by every
Player. Attached via data attachments on
Fabric/NeoForge and via a capability on Forge.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<HorseOwnerData> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, HorseOwnerData> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy()voidcopyFrom(HorseOwnerData other) @Nullable net.minecraft.world.entity.MobcreateHorseEntity(net.minecraft.world.level.Level world) static HorseOwnerDatafromNbt(net.minecraft.nbt.CompoundTag tag) net.minecraft.nbt.CompoundTagintnet.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> net.minecraft.world.phys.Vec3net.minecraft.nbt.CompoundTagThe stored tag, brought up to the running game's data version first.voidreadNbt(net.minecraft.nbt.CompoundTag tag) booleansetHorse(net.minecraft.world.entity.Mob horse, net.minecraft.world.entity.player.Player player) voidsetHorseNBT(net.minecraft.nbt.CompoundTag nbt) voidsetHorseNum(int num) voidsetLastSeenDim(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dim) voidsetLastSeenPosition(net.minecraft.world.phys.Vec3 pos) voidsetStorageUUID(String id) net.minecraft.nbt.CompoundTagtoNbt()
-
Field Details
-
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 thangetHorseNBT(), 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
-
setStorageUUID
-
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
-
readNbt
public void readNbt(net.minecraft.nbt.CompoundTag tag) -
copyFrom
-
copy
-