Class MusicDiscItem

java.lang.Object
net.minecraft.item.Item
net.minecraft.item.MusicDiscItem
All Implemented Interfaces:
ItemConvertible

public class MusicDiscItem
extends Item
  • Field Details

  • Constructor Details

  • Method Details

    • useOnBlock

      public ActionResult useOnBlock​(ItemUsageContext context)
      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:
      useOnBlock in class Item
      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:
      appendTooltip in class Item
    • getDescription

      @Environment(CLIENT) public MutableText getDescription()
    • bySound

      @Environment(CLIENT) @Nullable public static MusicDiscItem bySound​(SoundEvent sound)
    • getSound

      @Environment(CLIENT) public SoundEvent getSound()