Skip to content

Conversation

@BUGTeas
Copy link
Contributor

@BUGTeas BUGTeas commented May 17, 2025

// Make custom effect information visible when shown in tooltip
if (potionContents != null && tooltip.showInTooltip(DataComponentTypes.POTION_CONTENTS)) {
customName += getPotionEffectInfo(potionContents, session.locale()); // TODO should this be done with lore instead?
if (javaItem instanceof PotionItem || javaItem instanceof ArrowItem) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for adding this instanceof check? Geyser tries to match Java behaviour, and Java shows the potion effect tooltip on all items with a potion_contents component, not just these specific items, so it's probably good to do the same.

Also, given the above, I'm not sure if Geyser should show the effect in the HUD name tooltip, since Java doesn't. However, that seems up to debate to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason for show the effects in the HUD name tooltip

Bedrock always show effects in the HUD name tooltip, and show "No Effects" when it haven't any effects. If use lore to show these custom effects, Bedrock player will only saw effects or "No Effects" by vanilla potion ID.

/give @s potion[custom_name="Test",potion_contents={custom_effects:[{id:hero_of_the_village,duration:-1},{id:unluck,amplifier:1,duration:658980}]}]
image
image

/give @s potion[custom_name="Test 2",potion_contents={custom_effects:[{id:hero_of_the_village,duration:-1},{id:unluck,amplifier:1,duration:658980}],potion:leaping}]
image
image

But wrapping line in name can resolve this problem well:

image
image

At least, It reduce some misunderstandings of players, even if it looks a little wried.

Copy link
Contributor Author

@BUGTeas BUGTeas May 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, is the instanceof check before getting potion name in the getPotionName method used to use the custom_name of the potion_contents component only on tipped arrow & potion to match the Java behavior? I understand now.

For show custom effects on next line of the name, I think it have a better method to implement this. I'll take a look at it later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bedrock always show effects in the HUD name tooltip, and show "No Effects" when it haven't any effects. If use lore to show these custom effects, Bedrock player will only saw effects or "No Effects" by vanilla potion ID.

Ah okay, thanks for clarifying! In that case, this makes sense to me. It might be good to document this in comments near the code as well, for future reference.

@BUGTeas BUGTeas marked this pull request as ready for review May 23, 2025 16:59
@BUGTeas BUGTeas marked this pull request as draft May 24, 2025 12:54
@onebeastchris
Copy link
Member

Heya, what's the holdup here? 😄

@BUGTeas
Copy link
Contributor Author

BUGTeas commented Jul 6, 2025

Heya, what's the holdup here? 😄

I deeply apologize, but I don't have time to continue this work for the time being. I will add some commit directly when I come back in future.

@BUGTeas BUGTeas marked this pull request as ready for review August 5, 2025 14:59
@BUGTeas
Copy link
Contributor Author

BUGTeas commented Aug 5, 2025

Sorry I took too long. Now it can be review.

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

Successfully merging this pull request may close these issues.

3 participants