Fixed missing sound when equiping the bangle and amulets

This commit is contained in:
Sollace 2022-01-02 23:54:08 +02:00
parent fe831f3099
commit c3af3f9631
2 changed files with 14 additions and 0 deletions

View file

@ -18,8 +18,10 @@ import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.attribute.EntityAttribute;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.item.ArmorMaterials;
import net.minecraft.item.ItemStack;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.SoundEvent;
import net.minecraft.text.LiteralText;
import net.minecraft.text.MutableText;
import net.minecraft.text.StringVisitable;
@ -74,6 +76,11 @@ public class AmuletItem extends WearableItem {
}
}
@Override
public SoundEvent getEquipSound() {
return ArmorMaterials.IRON.getEquipSound();
}
@Override
public EquipmentSlot getPreferredSlot(ItemStack stack) {
return EquipmentSlot.CHEST;

View file

@ -6,9 +6,11 @@ import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterials;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Wearable;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
@ -38,6 +40,11 @@ public abstract class WearableItem extends Item implements Wearable {
return TypedActionResult.fail(stack);
}
@Override
public SoundEvent getEquipSound() {
return ArmorMaterials.LEATHER.getEquipSound();
}
public EquipmentSlot getPreferredSlot(ItemStack stack) {
return EquipmentSlot.OFFHAND;
}