public class MusicDiscItem extends Item
Item.Properties| Modifier and Type | Field and Description |
|---|---|
private int |
comparatorValue |
private static java.util.Map<SoundEvent,MusicDiscItem> |
RECORDS
Deprecated.
|
private SoundEvent |
sound
Deprecated.
|
private java.util.function.Supplier<SoundEvent> |
soundSupplier |
ATTACK_DAMAGE_MODIFIER, ATTACK_SPEED_MODIFIER, BLOCK_TO_ITEM, canRepair, group, properties, randomdelegate| Modifier | Constructor and Description |
|---|---|
protected |
MusicDiscItem(int comparatorValueIn,
SoundEvent soundIn,
Item.Properties builder)
Deprecated.
|
|
MusicDiscItem(int comparatorValue,
java.util.function.Supplier<SoundEvent> soundSupplier,
Item.Properties builder)
For mod use, allows to create a music disc without having to create a new
SoundEvent before their registry event is fired.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInformation(ItemStack stack,
World worldIn,
java.util.List<ITextComponent> tooltip,
ITooltipFlag flagIn) |
static MusicDiscItem |
getBySound(SoundEvent soundIn) |
int |
getComparatorValue() |
ITextComponent |
getRecordDescription() |
SoundEvent |
getSound() |
ActionResultType |
onItemUse(ItemUseContext context) |
addPropertyOverride, asItem, canHarvestBlock, canPlayerBreakBlockWhileHolding, fillItemGroup, getAttributeModifiers, getContainerItem, getDefaultInstance, getDefaultTranslationKey, getDestroySpeed, getDisplayName, getDrinkSound, getEatSound, getFood, getGroup, getHarvestLevel, getIdFromItem, getIsRepairable, getItemById, getItemEnchantability, getItemFromBlock, getItemStackTileEntityRenderer, getMaxDamage, getMaxStackSize, getName, getPropertyGetter, getRarity, getTags, getToolTypes, getTranslationKey, getTranslationKey, getUseAction, getUseDuration, hasContainerItem, hasCustomProperties, hasEffect, hitEntity, inventoryTick, isComplex, isCrossbow, isDamageable, isEnchantable, isFood, isIn, isInGroup, isRepairable, itemInteractionForEntity, onBlockDestroyed, onCreated, onItemRightClick, onItemUseFinish, onPlayerStoppedUsing, onUse, rayTrace, shouldSyncTag, toString, updateItemStackNBTgetRegistryName, getRegistryType, setRegistryName, setRegistryName, setRegistryNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanApplyAtEnchantingTable, canContinueUsing, canDisableShield, canElytraFly, canEquip, canHarvestBlock, createEntity, damageItem, doesSneakBypassUse, elytraFlightTick, getAnimationParameters, getArmorModel, getArmorTexture, getAttributeModifiers, getBurnTime, getContainerItem, getCreativeTabs, getCreatorModId, getDamage, getDurabilityForDisplay, getEntityLifespan, getEquipmentSlot, getFontRenderer, getHighlightTip, getItem, getItemEnchantability, getItemStackLimit, getMaxDamage, getRGBDurabilityForDisplay, getShareTag, getSmeltingExperience, getXpRepairRatio, hasContainerItem, hasCustomEntity, initCapabilities, isBeaconPayment, isBookEnchantable, isDamaged, isShield, onArmorTick, onBlockStartBreak, onDroppedByPlayer, onEntityItemUpdate, onEntitySwing, onHorseArmorTick, onItemUseFirst, onLeftClickEntity, onUsingTick, readShareTag, renderHelmetOverlay, setDamage, shouldCauseBlockBreakReset, shouldCauseReequipAnimation, showDurabilityBar@Deprecated private static final java.util.Map<SoundEvent,MusicDiscItem> RECORDS
private final int comparatorValue
@Deprecated private final SoundEvent sound
private final java.util.function.Supplier<SoundEvent> soundSupplier
@Deprecated
protected MusicDiscItem(int comparatorValueIn,
SoundEvent soundIn,
Item.Properties builder)
public MusicDiscItem(int comparatorValue,
java.util.function.Supplier<SoundEvent> soundSupplier,
Item.Properties builder)
comparatorValue - The value this music disc should output on the comparator. Must be between 0 and 15.soundSupplier - A supplier that provides the sound that should be played. Use a
RegistryObject<SoundEvent> or a
IRegistryDelegate for this parameter.builder - A set of Item.Properties that describe this item.public ActionResultType onItemUse(ItemUseContext context)
public int getComparatorValue()
public void addInformation(ItemStack stack, @Nullable World worldIn, java.util.List<ITextComponent> tooltip, ITooltipFlag flagIn)
addInformation in class Itempublic ITextComponent getRecordDescription()
@Nullable public static MusicDiscItem getBySound(SoundEvent soundIn)
public SoundEvent getSound()