Suggestion: add "what's in my bee nest/bee hive" preview
gbl opened this issue ยท 0 comments
Players can silk touch nests/hives to move bees, but there currently isn't a way for the client to find out how many bees a nest contains (and on servers that have an economy, there's no way for either buyer or seller to know if the advertised "3 bees in this hive" is true.
This doesn't really have much to do with shulker boxes, but it would be some kind of "what's in this closed box I have in my inventory" functionality, so it might be better to have it in here than in yet another tiny mod.
As a proof of concept, I added this to the tooltip generator in one of my mods and it seems to be working fine (this
is the Itemstack the mouse is hovering over):
if (!this.isEmpty() && (this.getItem() == Items.BEE_HIVE || this.getItem() == Items.BEE_NEST)) {
CompoundTag tag = this.getTag();
if (tag != null) {
String honeyLevel = tag.getCompound("BlockStateTag").getString("honey_level"); // wtf this is a string ???
int beeCount = tag.getCompound("BlockEntityTag").getList("Bees", 10).size();
list.add(new LiteralText(honeyLevel+" honey"));
list.add(new LiteralText(beeCount+ " bees"));
}