Skip to content

Commit

Permalink
add Hyliaster vial interaction stat
Browse files Browse the repository at this point in the history
  • Loading branch information
luxtracon committed May 31, 2024
1 parent 1612242 commit ffbf0f2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.stats.Stats;
import net.minecraft.util.Mth;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
Expand All @@ -19,7 +20,10 @@
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.goal.*;
import net.minecraft.world.entity.ai.goal.FloatGoal;
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
import net.minecraft.world.entity.ai.goal.WaterAvoidingRandomStrollGoal;
import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
import net.minecraft.world.entity.animal.IronGolem;
Expand Down Expand Up @@ -245,6 +249,7 @@ public InteractionResult mobInteract(Player pPlayer, InteractionHand pHand) {
var filledResult = ItemUtils.createFilledResult(itemStack, pPlayer, IcariaItems.HYLIASTRUM_VIAL.get().getDefaultInstance());
this.remove();
this.setTick(this.getTick() - 16000);
pPlayer.awardStat(Stats.ITEM_USED.get(IcariaItems.EMPTY_VIAL.get()));
pPlayer.playSound(SoundEvents.BOTTLE_FILL);
pPlayer.setItemInHand(pHand, filledResult);
return InteractionResult.sidedSuccess(this.level().isClientSide());
Expand Down

0 comments on commit ffbf0f2

Please sign in to comment.