Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: add "what's in my bee nest/bee hive" preview #11

Closed
gbl opened this issue Jan 2, 2020 · 0 comments
Closed

Suggestion: add "what's in my bee nest/bee hive" preview #11

gbl opened this issue Jan 2, 2020 · 0 comments

Comments

@gbl
Copy link
Contributor

gbl commented Jan 2, 2020

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"));
                }

@gbl gbl closed this as completed Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant