Create

Create

105M Downloads

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

ChiefArug opened this issue ยท 0 comments

commented

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