Is it possible to detect if an item is a music disc?

Started by Dokneso on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is it possible to detect if an item is a music disc?

Basically I'd like to make a block that checks if an item is a music disc. The catch is I'd like it to be compatible with mods that add new music discs and for that reason the solution isn't as easy as manually listing them. Is there any way solve my problem?

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I would guess that there is…
Sun, 04/13/2025 - 19:33

I would guess that there is a tag for music discs, something like c:music_discs but I'm not quite sure, and it would probably only work if the mod's author intentionally thought to add their music discs to the tag. Alternatively, you could get the registry name of an item and check if it contains music_disc or disc although that could also have some problems, such as if somebody made a music_disc_holder item or a disco_ball item as examples of how it could easily return incorrectly.

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
According to ChatGPT there…
Mon, 04/14/2025 - 14:36

According to ChatGPT there was a tag for music discs that was removed in 1.21 but I'm on 1.21.4. I'm hoping there's a better way than downgrading.