[SPIGOT-7659] Settings TropicalFishBucketMeta to an ItemStack Fails Created: 03/May/24  Updated: 25/Dec/24  Resolved: 03/May/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: ItsSchatten Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Attachments: File Test-1.0-SNAPSHOT-all.jar    
Version: 4142-Spigot-e2c1eee-0364df4
Guidelines Read: Yes

 Description   

Giving a TROPICAL_FISH_BUCKET ItemStack with customized TropicalFishBucketMeta does not actually apply the ItemMeta to the item.

 

Secondarily to this issue: whilst in creative mode, opening your inventory with a customized TROPICAL_FISH_BUCKET ItemStack will kick you from the server, I assume that once the meta is properly applied to the ItemStack this issue will also be resolved.

Replication Steps, this applies to both:

  1. Give a TROPICAL_FISH_BUCKET item with a set pattern, body color, or pattern color.
    • final ItemStack stack = new ItemStack(Material.TROPICAL_FISH_BUCKET);
      final TropicalFishBucketMeta meta = (TropicalFishBucketMeta) stack.getItemMeta();
      
      // This can by a pattern, pattern color, or body color.
      meta.setBodyColor(DyeColor.RED);
      stack.setItemMeta(meta);
      player.getInventory().addItem(stack); 
    • Placing the bucket will randomly place a fish.
    • Or use the provided plugin Jar and execute /test
  1. Open your inventory whilst in Creative Mode.
  2. You will be disconnected with 
    Internal Exception: io.netty.handler.codec.DecoderException: Failed to decode packet 'serverbound/minecraft:set_creative_mode_slot' 
    • The error is from a Paper server. I couldn't get any error to thrown in console on a spigot server but the behavior seemingly remains consistent between paper and spigot.
      [15:45:32 INFO]: ItsSchatten lost connection: Internal Exception: io.netty.handler.codec.DecoderException: Failed to decode packet 'serverbound/minecraft:set_creative_mode_slot'
      [15:45:32 WARN]: Failed to save player data for ItsSchatten
      net.minecraft.ReportedException: Saving entity NBT
          at net.minecraft.world.entity.Entity.saveWithoutId(Entity.java:2564) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.world.entity.Entity.saveWithoutId(Entity.java:2403) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.world.level.storage.PlayerDataStorage.save(PlayerDataStorage.java:40) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.players.PlayerList.save(PlayerList.java:579) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.players.PlayerList.remove(PlayerList.java:635) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.players.PlayerList.remove(PlayerList.java:596) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.network.ServerGamePacketListenerImpl.removePlayerFromWorld(ServerGamePacketListenerImpl.java:2091) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2071) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2058) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.network.Connection.handleDisconnection(Connection.java:888) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:255) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1805) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:468) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1575) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1235) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) ~[paper-1.20.6.jar:git-Paper-36]
          at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
      Caused by: java.lang.IllegalStateException: Missing id for entity in: {BucketVariantTag:1024}
          at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:275) ~[datafixerupper-7.0.14.jar:?]
          at com.mojang.serialization.DataResult.getOrThrow(DataResult.java:79) ~[datafixerupper-7.0.14.jar:?]
          at net.minecraft.world.item.ItemStack.save(ItemStack.java:607) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.world.entity.player.Inventory.save(Inventory.java:501) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.world.entity.player.Player.addAdditionalSaveData(Player.java:916) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.server.level.ServerPlayer.addAdditionalSaveData(ServerPlayer.java:615) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.world.entity.Entity.addAdditionalSaveData(Entity.java:2729) ~[paper-1.20.6.jar:git-Paper-36]
          at net.minecraft.world.entity.Entity.saveWithoutId(Entity.java:2512) ~[paper-1.20.6.jar:git-Paper-36]
          ... 16 more 

Generated at Sat Dec 13 22:30:22 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.