Package net.minecraft.item
Class MusicDiscItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.MusicDiscItem
- All Implemented Interfaces:
ItemConvertible
public class MusicDiscItem extends Item
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.Settings -
Field Summary
Fields Modifier and Type Field Description private intcomparatorOutputprivate static Map<SoundEvent,MusicDiscItem>MUSIC_DISCSprivate SoundEventsoundFields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_ID, ATTACK_SPEED_MODIFIER_ID, BLOCK_ITEMS, group -
Constructor Summary
Constructors Modifier Constructor Description protectedMusicDiscItem(int comparatorOutput, SoundEvent sound, Item.Settings settings) -
Method Summary
Modifier and Type Method Description voidappendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext context)static MusicDiscItembySound(SoundEvent sound)intgetComparatorOutput()MutableTextgetDescription()SoundEventgetSound()ActionResultuseOnBlock(ItemUsageContext context)Called when an item is used on a block.Methods inherited from class net.minecraft.item.Item
appendStacks, asItem, byRawId, canMine, canRepair, damage, finishUsing, fromBlock, getAttributeModifiers, getDefaultStack, getDrinkSound, getEatSound, getEnchantability, getEquipSound, getFoodComponent, getGroup, getItemBarColor, getItemBarStep, getMaxCount, getMaxDamage, getMaxUseTime, getMiningSpeedMultiplier, getName, getName, getOrCreateTranslationKey, getRarity, getRawId, getRecipeRemainder, getTooltipData, getTranslationKey, getTranslationKey, getUseAction, hasGlint, hasRecipeRemainder, hasStoredInventory, inventoryTick, isDamageable, isEnchantable, isFireproof, isFood, isIn, isItemBarVisible, isNetworkSynced, isSuitableFor, isUsedOnRelease, method_33261, onClicked, onCraft, onStackClicked, onStoppedUsing, postHit, postMine, postProcessTag, raycast, shouldSyncTagToClient, toString, usageTick, use, useOnEntity
-
Field Details
-
MUSIC_DISCS
-
comparatorOutput
private final int comparatorOutput -
sound
-
-
Constructor Details
-
MusicDiscItem
-
-
Method Details
-
useOnBlock
Called when an item is used on a block.This method is called on both the logical client and logical server, so take caution when using this method. The logical side can be checked using
context.getWorld().isClient().- Overrides:
useOnBlockin classItem- Parameters:
context- the usage context- Returns:
- an action result that specifies if using the item on a block was successful.
-
getComparatorOutput
public int getComparatorOutput() -
appendTooltip
@Environment(CLIENT) public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context)- Overrides:
appendTooltipin classItem
-
getDescription
-
bySound
-
getSound
-