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

Builders tea does not use food properties to apply the effect and hunger #7295

Open
ChiefArug opened this issue Jan 17, 2025 · 1 comment
Open
Assignees
Labels
status: fixed in next release Issue will be fixed in the next release type: bug Issue where something isn't working

Comments

@ChiefArug
Copy link

Description

Builders tea harcodes how it applies effects in it's finishUsing method:

public ItemStack finishUsingItem(ItemStack stack, Level world, LivingEntity entity) {
Player playerentity = entity instanceof Player ? (Player) entity : null;
if (playerentity instanceof ServerPlayer)
CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayer) playerentity, stack);
if (!world.isClientSide)
entity.addEffect(new MobEffectInstance(MobEffects.DIG_SPEED, 3 * 60 * 20, 0, false, false, false));
if (playerentity != null) {
playerentity.awardStat(Stats.ITEM_USED.get(this));
playerentity.getFoodData().eat(1, .6F);
if (!playerentity.getAbilities().instabuild)
stack.shrink(1);
}
if (playerentity == null || !playerentity.getAbilities().instabuild) {
if (stack.isEmpty())
return new ItemStack(Items.GLASS_BOTTLE);
if (playerentity != null)
playerentity.getInventory().add(new ItemStack(Items.GLASS_BOTTLE));

This is not ideal as it means the way mods expect mods to declare effects and hunger values (food properties) does not exist on builders tea. This will also cause problems in 1.21 when components are a thing, it will prevent people customizing the hunger and effect given from it.

Game Log

N/A

Debug Information

N/A

@ChiefArug ChiefArug added the type: bug Issue where something isn't working label Jan 17, 2025
@IThundxr IThundxr added the status: confirmed Issue's details are known, it is consistently reproducible, and it needs a fix label Jan 17, 2025
@IThundxr IThundxr self-assigned this Jan 17, 2025
@IThundxr IThundxr added status: fixed in next release Issue will be fixed in the next release and removed status: confirmed Issue's details are known, it is consistently reproducible, and it needs a fix labels Jan 19, 2025
@TropheusJ
Copy link
Collaborator

a bit too eager github, not yet

@TropheusJ TropheusJ reopened this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: fixed in next release Issue will be fixed in the next release type: bug Issue where something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants