API Changes in 1.21.4
All API Changes
All API Additions
ItemStack#copyDataFrom(ItemStack source, Predicate<DataComponentType> filter) World#save(boolean flush) ChunkyGenerator#getHeight(HeightMap heightMap, int x, int z): int Skull#customName(): Component Skull#customName(Component component) ClientTickEndEvent extends PlayerEvent Player#getDeathScreenScore(): int Player#setDeathScreenScore(int score) Creaking#getHome(): Location Creaking#activate(Player player) Creaking#deactivate() Creaking#isActive() Bukkit.restart() JavaPlugin#registerCommand(String label, BasicCommand BasicCommand) JavaPlugin#registerCommand(String label, String description, BasicCommand BasicCommand) JavaPlugin#registerCommand(String label, Collection<String> aliases, BasicCommand BasicCommand) JavaPlugin#registerCommand(String label, String description, Collection<String> aliases, BasicCommand BasicCommand) EntityEquipmentChangedEvent extends EntityEvent EntityAttemptSmashAttackEvent extends EntityEvent ItemStack#editPersistentDataContainer(Consumer<PersistentDataContainer> consumer): boolean TrialSpawner#getCooldownEnd(): long TrialSpawner#setCooldownEnd(long ticks) TrialSpawner#getNextSpawnAttempt(): long TrialSpawner#setNextSpawnAttempt(long ticks) Vault#getActivationRange(): double Vault#setActivationRange(double deactivationRange) Vault#getDeactivationRange(): double Vault#setDeactivationRange(double deactivationRange) Vault#getKeyItem(): ItemStack Vault#setKeyItem(ItemStack key) Vault#getLootTable(): LootTable Vault#setLootTable(LootTable lootTable) Vault#getDisplayedLootTable(): LootTable Vault#setDisplayedLootTable(LootTable lootTable) Vault#getNextStateUpdateTime(): long Vault#setNextStateUpdateTime(long nextStateUpdateTime) Vault#getRewardedPlayers(): Collection<UUID> Vault#addRewardedPlayer(UUID playerUUID) Vault#removeRewardedPlayer(UUID playerUUID) Vault#hasRewardedPlayer(UUID playerUUID) Vault#getConnectedPlayers(): Set<UUID> Vault#hasConnectedPlayers(UUID playerUUID) Vault#getDisplayedItem(): ItemStack Vault#setDisplayedItem(ItemStack displayedItem) AbstractArrow#getAttachedBlocks(): List<Block> PlayerGiveResult Player#give(ItemStack... items): PlayerGiveResult Player#give(Collection<ItemStack> items): PlayerGiveResult Player#give(Collection<ItemStack> items, boolean dropIfFull): PlayerGiveResult PlayerClientLoadedWorldEvent extends PlayerEvent PositionedRayTraceConfigurationBuilder RayTraceTarget World#rayTrace(Consumer<PositionedRayTraceConfigurationBuilder> builderConsumer): RayTraceResult BlockType#createBlockDataStates(): Collection<? extends BlockData> EntityEffectTickEvent extends EntityEvent implements Cancellable HumanEntity#getPotentialRespawnLocation(): Location CommandSourceStack#withExecutor(Entity entity) CommandSourceStack#withLocation(Location location) Bukkit.createMerchant(): Merchant Server.createMerchant(): Merchant InventoryViewBuilder<V extends InventoryView> LocationInventoryViewBuilder<V extends InventoryView> extends InventoryViewBuilder<V> MerchantInventoryViewBuilder<V extends InventoryView> extends InventoryViewBuilder<V> Location#addRotation(float yaw, float pitch): Location Location#subtractRotation(float yaw, float pitch): Location Location#setRotation(float yaw, float pitch): Location Server#sendRichMessage(String message) Server#sendRichMessage(String message, TagResolver... resolvers) Server#sendPlainMessage(String message) HumanEntity#dropItem(int slot): Item HumanEntity#dropItem(int slot, int amount): Item HumanEntity#dropItem(int slot, int amount, boolean throwRandomly, Consumer<Item> entityOperation): Item HumanEntity#dropItem(EquipmentSlot slot): Item HumanEntity#dropItem(EquipmentSlot slot, int amount): Item HumanEntity#dropItem(EquipmentSlot slot, int amount, boolean throwRandomly, Consumer<Item> entityOperation): Item HumanEntity#dropItem(ItemStack): Item HumanEntity#dropItem(ItemStack, boolean throwRandomly, Consumer<Item> entityOperation): Item DatapackRegistrar DiscoveredDatapack DatapackSource.PLUGIN: DatapackSource LifecycleEvents.DATAPACK_DISCOVERY: LifecycleEventType.Prioritizable<BootstrapContext, RegistrarEvent<DatapackRegistrar>> DamageTypeRegistryEntry RegistryEvents.DAMAGE_TYPE: RegistryEventProvider<DamageType, DamageTypeRegistryEntry.Builder> DamageEffect.getDamageEffect(String key): DamageEffect BannerPatternRegistryEntry RegistryEvents.BANNER_PATTERN: RegistryEventProvider<PatternType, BannerPatternRegistryEntry.Builder> EntitySerializationFlag UnsafeValues#serializeEntity(Entity entity): byte[] UnsafeValues#serializeEntity(Entity entity, EntitySerializationFlag... serializationFlag): byte[] UnsafeValues#deserializeEntity(byte[] data, World world): Entity UnsafeValues#deserializeEntity(byte[] data, World world, boolean preserveUUID): Entity UnsafeValues#deserializeEntity(byte[] data, World world, boolean preserveUUID, boolean preservePassengers): Entity Entity#spawnAt(Location location): boolean Entity#spawnAt(Location location, CreatureSpawnEvent.SpawnReason reason): boolean RegistryBuilderFactory RegistryKey#typedKey(Key key): TypedKey<T> RegistryKey#typedKey(String key): TypedKey<T> WritableRegistry#register(TypedKey<T> key, Consumer<? super B> value) WritableRegistry#registerWith(TypedKey<T> key, Consumer<RegistryBuilderFactory<T, B>> value) TypedKey.create(RegistryKey<T> registryKey, String key): <T> Tag.ITEMS_STONE_CRAFTING_MATERIALS: Tag<Material> Registry#getTag(TagKey<T> key): Tag<T> Registry#getTags(): Collection<Tag<T>> ItemStack#effectiveName(): Component Entity#lookAt(double x, double y, double z, LookAnchor entityAnchor) Entity#lookAt(io.papermc.paper.math.Position position, LookAnchor entityAnchor) Bogged#isSheared(): boolean Bogged#setSheared(boolean flag) Sheep#isSheared(): boolean Sheep#setSheared(boolean flag) MaterialTags: MaterialSetTag COMMAND_BLOCKS ItemMeta#hasCustomName() ItemMeta#customName(): Component ItemMeta#customName(Component customName) All API Deprecations
Bukkit.spigot(): Server.Spigot All of Server.Spigot Server#spigot(): Spigot Server#restart() AbstractArrow#getAttachedBlock(): Block Bukkit.setSpawnRadius(int value) Server#setSpawnRadius(int value) UnsafeValues#getSpawnEggLayerColor(EntityType entityType, int layer): Color Turtle#isDigging(): boolean HumanEntity#getPotentialBedLocation(): Location Bukkit.createMerchant(Component title): Merchant Server#createMerchant(Component title): Merchant HumanEntity#openWorkbench(Location location, boolean force): InventoryView HumanEntity#openEnchanting(Location location, boolean force): InventoryView HumanEntity#openMerchant(Villager trader, boolean force): InventoryView HumanEntity#openMerchant(Merchant merchant, boolean force): InventoryView HumanEntity#openAnvil(Location location, boolean force): InventoryView HumanEntity#openCartographyTable(Location location, boolean force): InventoryView HumanEntity#openGrindstone(Location location, boolean force): InventoryView HumanEntity#openLoom(Location location, boolean force): InventoryView HumanEntity#openSmithingTable(Location location, boolean force): InventoryView HumanEntity#openStonecutter(Location location, boolean force): InventoryView Tag.ITEMS_FURNACE_MATERIALS: Tag<Material> All Class Inheritance Changes
Sittable now extends EntityDatapack now extends DiscoveredDatapackNow Obsolete
PlayerArmorChangeEvent HumanEntity#dropItem(boolean dropAll): boolean ItemMeta#displayName() ItemMeta#displayName(Component displayName) Library Changes
Adventure to 4.20 #224 Bump to adventure 4.20.0
Libraries:
- Bumped
Adventureto4.20
#221 Add ItemStack#copyDataFrom
Additions:
-
ItemStack#copyDataFrom(ItemStack source, Predicate<DataComponentType> filter)
#219 Add flush parameter to World#save
Additions:
-
World#save(boolean flush)
#218 ChunkGenerator - add getHeight to ChunkData
Additions:
-
ChunkyGenerator#getHeight(HeightMap heightMap, int x, int z): int
#214 Skull - get/set customName
Additions:
-
Skull#customName(): Component -
Skull#customName(Component component)
#205 Add client tick end event
Additions:
-
ClientTickEndEvent extends PlayerEvent
#196 Player - Expose player score
Additions:
-
Player#getDeathScreenScore(): int -
Player#setDeathScreenScore(int score)
#182 Add methods for Creaking
Additions:
-
Creaking#getHome(): Location -
Creaking#activate(Player player) -
Creaking#deactivate() -
Creaking#isActive()
#180 Deprecate server config getters
Additions:
-
Bukkit.restart()
Deprecations:
-
Bukkit.spigot(): Server.Spigot -
All of Server.Spigot -
Server#spigot(): Spigot -
Server#restart()
#170 add simpler javaplugin command registration
Additions:
-
JavaPlugin#registerCommand(String label, BasicCommand BasicCommand) -
JavaPlugin#registerCommand(String label, String description, BasicCommand BasicCommand) -
JavaPlugin#registerCommand(String label, Collection<String> aliases, BasicCommand BasicCommand) -
JavaPlugin#registerCommand(String label, String description, Collection<String> aliases, BasicCommand BasicCommand)
#157 Add EntityEquipmentChangedEvent
Additions:
-
EntityEquipmentChangedEvent extends EntityEvent
Obsolete API:
-
PlayerArmorChangeEvent
#155 Add EntityAttemptSmashAttackEvent
Additions:
-
EntityAttemptSmashAttackEvent extends EntityEvent
#153 add method on ItemStack to edit pdc
Additions:
-
ItemStack#editPersistentDataContainer(Consumer<PersistentDataContainer> consumer): boolean
#150 Add TrialSpawner methods for end of cooldown and next mob spawn time
Additions:
-
TrialSpawner#getCooldownEnd(): long -
TrialSpawner#setCooldownEnd(long ticks) -
TrialSpawner#getNextSpawnAttempt(): long -
TrialSpawner#setNextSpawnAttempt(long ticks)
#149 Add Vault block API
Additions:
-
Vault#getActivationRange(): double -
Vault#setActivationRange(double deactivationRange) -
Vault#getDeactivationRange(): double -
Vault#setDeactivationRange(double deactivationRange) -
Vault#getKeyItem(): ItemStack -
Vault#setKeyItem(ItemStack key) -
Vault#getLootTable(): LootTable -
Vault#setLootTable(LootTable lootTable) -
Vault#getDisplayedLootTable(): LootTable -
Vault#setDisplayedLootTable(LootTable lootTable) -
Vault#getNextStateUpdateTime(): long -
Vault#setNextStateUpdateTime(long nextStateUpdateTime) -
Vault#getRewardedPlayers(): Collection<UUID> -
Vault#addRewardedPlayer(UUID playerUUID) -
Vault#removeRewardedPlayer(UUID playerUUID) -
Vault#hasRewardedPlayer(UUID playerUUID) -
Vault#getConnectedPlayers(): Set<UUID> -
Vault#hasConnectedPlayers(UUID playerUUID) -
Vault#getDisplayedItem(): ItemStack -
Vault#setDisplayedItem(ItemStack displayedItem)
#148 Add proper attached blocks API to AbstractArrow
Additions:
-
AbstractArrow#getAttachedBlocks(): List<Block>
Deprecations:
-
AbstractArrow#getAttachedBlock(): Block
#144 Deprecate Server#setSpawnRadius
Deprecations:
-
Bukkit.setSpawnRadius(int value) -
Server#setSpawnRadius(int value)
#140 Make Sittable interface extend Entity
Extensions:
Sittablenow extendsEntity
#136 Deprecate UnsafeValues#getSpawnEggLayerColor
Deprecations:
-
UnsafeValues#getSpawnEggLayerColor(EntityType entityType, int layer): Color
#127 Add Player#give
Additions:
-
PlayerGiveResult -
Player#give(ItemStack... items): PlayerGiveResult -
Player#give(Collection<ItemStack> items): PlayerGiveResult -
Player#give(Collection<ItemStack> items, boolean dropIfFull): PlayerGiveResult
#126 Add PlayerLoadedWorldEvent
Additions:
-
PlayerClientLoadedWorldEvent extends PlayerEvent
#123 Add RayTraceConfigurationBuilder
Additions:
-
PositionedRayTraceConfigurationBuilder -
RayTraceTarget -
World#rayTrace(Consumer<PositionedRayTraceConfigurationBuilder> builderConsumer): RayTraceResult
#107 Remove deprecation from EntityRemoveEvent
#104 Expose all possible block data states
Additions:
-
BlockType#createBlockDataStates(): Collection<? extends BlockData>
#101 Deprecate Turtle#isDigging
Deprecations:
-
Turtle#isDigging(): boolean
#99 Add EntityEffectTickEvent
Additions:
-
EntityEffectTickEvent extends EntityEvent implements Cancellable
#97 Rename getPotentialBedLocation to getPotentialRespawnLocation
Additions:
-
HumanEntity#getPotentialRespawnLocation(): Location
Deprecations:
-
HumanEntity#getPotentialBedLocation(): Location
#95 Feat: Add 'with' methods to CommandSourceStack
Additions:
-
CommandSourceStack#withExecutor(Entity entity) -
CommandSourceStack#withLocation(Location location)
#94 MenuType API addition InventoryView Builders
Additions:
-
Bukkit.createMerchant(): Merchant -
Server.createMerchant(): Merchant -
InventoryViewBuilder<V extends InventoryView> -
LocationInventoryViewBuilder<V extends InventoryView> extends InventoryViewBuilder<V> -
MerchantInventoryViewBuilder<V extends InventoryView> extends InventoryViewBuilder<V>
Deprecations:
-
Bukkit.createMerchant(Component title): Merchant -
Server#createMerchant(Component title): Merchant -
HumanEntity#openWorkbench(Location location, boolean force): InventoryView -
HumanEntity#openEnchanting(Location location, boolean force): InventoryView -
HumanEntity#openMerchant(Villager trader, boolean force): InventoryView -
HumanEntity#openMerchant(Merchant merchant, boolean force): InventoryView -
HumanEntity#openAnvil(Location location, boolean force): InventoryView -
HumanEntity#openCartographyTable(Location location, boolean force): InventoryView -
HumanEntity#openGrindstone(Location location, boolean force): InventoryView -
HumanEntity#openLoom(Location location, boolean force): InventoryView -
HumanEntity#openSmithingTable(Location location, boolean force): InventoryView -
HumanEntity#openStonecutter(Location location, boolean force): InventoryView
#75 Add pattern methods for orientation in Location
Additions:
-
Location#addRotation(float yaw, float pitch): Location -
Location#subtractRotation(float yaw, float pitch): Location -
Location#setRotation(float yaw, float pitch): Location
#69 Add sendRich/PlainMessage methods to Server
Additions:
-
Server#sendRichMessage(String message) -
Server#sendRichMessage(String message, TagResolver... resolvers) -
Server#sendPlainMessage(String message)
#64 Extend HumanEntity#dropItem API
Additions:
-
HumanEntity#dropItem(int slot): Item -
HumanEntity#dropItem(int slot, int amount): Item -
HumanEntity#dropItem(int slot, int amount, boolean throwRandomly, Consumer<Item> entityOperation): Item -
HumanEntity#dropItem(EquipmentSlot slot): Item -
HumanEntity#dropItem(EquipmentSlot slot, int amount): Item -
HumanEntity#dropItem(EquipmentSlot slot, int amount, boolean throwRandomly, Consumer<Item> entityOperation): Item -
HumanEntity#dropItem(ItemStack): Item -
HumanEntity#dropItem(ItemStack, boolean throwRandomly, Consumer<Item> entityOperation): Item
Obsolete API:
-
HumanEntity#dropItem(boolean dropAll): boolean
#63 Add datapack registration lifecycle event
Additions:
-
DatapackRegistrar -
DiscoveredDatapack -
DatapackSource.PLUGIN: DatapackSource -
LifecycleEvents.DATAPACK_DISCOVERY: LifecycleEventType.Prioritizable<BootstrapContext, RegistrarEvent<DatapackRegistrar>>
Extensions:
Datapacknow extendsDiscoveredDatapack
#59 Add DamageType RegistryEvent
Additions:
-
DamageTypeRegistryEntry -
RegistryEvents.DAMAGE_TYPE: RegistryEventProvider<DamageType, DamageTypeRegistryEntry.Builder> -
DamageEffect.getDamageEffect(String key): DamageEffect
#49 Banner pattern registry modification
Additions:
-
BannerPatternRegistryEntry -
RegistryEvents.BANNER_PATTERN: RegistryEventProvider<PatternType, BannerPatternRegistryEntry.Builder>
#48 Expand on entity serialization API
Additions:
-
EntitySerializationFlag -
UnsafeValues#serializeEntity(Entity entity): byte[] -
UnsafeValues#serializeEntity(Entity entity, EntitySerializationFlag... serializationFlag): byte[] -
UnsafeValues#deserializeEntity(byte[] data, World world): Entity -
UnsafeValues#deserializeEntity(byte[] data, World world, boolean preserveUUID): Entity -
UnsafeValues#deserializeEntity(byte[] data, World world, boolean preserveUUID, boolean preservePassengers): Entity -
Entity#spawnAt(Location location): boolean -
Entity#spawnAt(Location location, CreatureSpawnEvent.SpawnReason reason): boolean
#47 For new registry values, allow copying from existing
Additions:
-
RegistryBuilderFactory -
RegistryKey#typedKey(Key key): TypedKey<T> -
RegistryKey#typedKey(String key): TypedKey<T> -
WritableRegistry#register(TypedKey<T> key, Consumer<? super B> value) -
WritableRegistry#registerWith(TypedKey<T> key, Consumer<RegistryBuilderFactory<T, B>> value) -
TypedKey.create(RegistryKey<T> registryKey, String key): <T>
#42 Deprecate #furnace_materials item tag
Additions:
-
Tag.ITEMS_STONE_CRAFTING_MATERIALS: Tag<Material>
Deprecations:
-
Tag.ITEMS_FURNACE_MATERIALS: Tag<Material>
#40 Add Registry#getTags
Additions:
-
Registry#getTag(TagKey<T> key): Tag<T> -
Registry#getTags(): Collection<Tag<T>>
#39 Add effective name to ItemStack
Additions:
-
ItemStack#effectiveName(): Component
#34 Port basic lookAt methods from Player to Entity
Additions:
-
Entity#lookAt(double x, double y, double z, LookAnchor entityAnchor) -
Entity#lookAt(io.papermc.paper.math.Position position, LookAnchor entityAnchor)
#11 Readd shear methods from bukkit Shearable
Additions:
-
Bogged#isSheared(): boolean -
Bogged#setSheared(boolean flag) -
Sheep#isSheared(): boolean -
Sheep#setSheared(boolean flag)
#9 Add command block material tags
Additions:
-
MaterialTags: MaterialSetTag COMMAND_BLOCKS
#5 Add ItemMeta customName methods
Additions:
-
ItemMeta#hasCustomName() -
ItemMeta#customName(): Component -
ItemMeta#customName(Component customName)
Obsolete API:
-
ItemMeta#displayName() -
ItemMeta#displayName(Component displayName)
Learn Paper Dev is licensed under CC BY-NC-SA 4.0