Skip to content

Commit

Permalink
Earbuds can now be equipped by right clicking them
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro270707 committed Mar 8, 2024
1 parent 2f48c49 commit 6ffb359
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
import net.minecraft.client.Minecraft;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.Equipable;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -43,4 +47,9 @@ public void inventoryTick(ItemStack itemStack, Level level, Entity entity, int s
Minecraft.getInstance().options.save();
}
}

@Override
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand interactionHand) {
return this.swapWithEquipmentSlot(this, level, player, interactionHand);
}
}

0 comments on commit 6ffb359

Please sign in to comment.