NoteBlockInstrument .java

net.minecraft.world.level.block.state.properties.NoteBlockInstrument (enum): members: HARP, BASEDRUM, SNARE, HAT, BASS, FLUTE, BELL, GUITAR, CHIME, BIT.

net.minecraft.world.level.block.state.propertiesenum74 linescommon3.5 KB

Implements

API Surface (5)

String getSerializedName()
Holder<SoundEvent> getSoundEvent()
boolean isTunable()
boolean hasCustomSound()
boolean worksAboveNoteBlock()

Fields & Constants (3)

name
soundEvent
type

String literals (25)

"harp"
"basedrum"
"snare"
"bass"
"flute"
"bell"
"guitar"
"chime"
"xylophone"
"iron_xylophone"
"cow_bell"
"didgeridoo"
"banjo"
"pling"
"trumpet"
"trumpet_exposed"
"trumpet_oxidized"
"trumpet_weathered"
"zombie"
"skeleton"
"creeper"
"dragon"
"wither_skeleton"
"piglin"

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

NoteBlockInstrument.java74 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.block.state.properties;
2
3
import net.minecraft.core.Holder;
4
import net.minecraft.sounds.SoundEvent;
5
import net.minecraft.sounds.SoundEvents;
6
import net.minecraft.util.StringRepresentable;
7
8
public enum NoteBlockInstrument implements StringRepresentable {
9
	HARP("harp", SoundEvents.NOTE_BLOCK_HARP, NoteBlockInstrument.Type.BASE_BLOCK),
10
	BASEDRUM("basedrum", SoundEvents.NOTE_BLOCK_BASEDRUM, NoteBlockInstrument.Type.BASE_BLOCK),
11
	SNARE("snare", SoundEvents.NOTE_BLOCK_SNARE, NoteBlockInstrument.Type.BASE_BLOCK),
12
	HAT("hat", SoundEvents.NOTE_BLOCK_HAT, NoteBlockInstrument.Type.BASE_BLOCK),
13
	BASS("bass", SoundEvents.NOTE_BLOCK_BASS, NoteBlockInstrument.Type.BASE_BLOCK),
14
	FLUTE("flute", SoundEvents.NOTE_BLOCK_FLUTE, NoteBlockInstrument.Type.BASE_BLOCK),
15
	BELL("bell", SoundEvents.NOTE_BLOCK_BELL, NoteBlockInstrument.Type.BASE_BLOCK),
16
	GUITAR("guitar", SoundEvents.NOTE_BLOCK_GUITAR, NoteBlockInstrument.Type.BASE_BLOCK),
17
	CHIME("chime", SoundEvents.NOTE_BLOCK_CHIME, NoteBlockInstrument.Type.BASE_BLOCK),
18
	XYLOPHONE("xylophone", SoundEvents.NOTE_BLOCK_XYLOPHONE, NoteBlockInstrument.Type.BASE_BLOCK),
19
	IRON_XYLOPHONE("iron_xylophone", SoundEvents.NOTE_BLOCK_IRON_XYLOPHONE, NoteBlockInstrument.Type.BASE_BLOCK),
20
	COW_BELL("cow_bell", SoundEvents.NOTE_BLOCK_COW_BELL, NoteBlockInstrument.Type.BASE_BLOCK),
21
	DIDGERIDOO("didgeridoo", SoundEvents.NOTE_BLOCK_DIDGERIDOO, NoteBlockInstrument.Type.BASE_BLOCK),
22
	BIT("bit", SoundEvents.NOTE_BLOCK_BIT, NoteBlockInstrument.Type.BASE_BLOCK),
23
	BANJO("banjo", SoundEvents.NOTE_BLOCK_BANJO, NoteBlockInstrument.Type.BASE_BLOCK),
24
	PLING("pling", SoundEvents.NOTE_BLOCK_PLING, NoteBlockInstrument.Type.BASE_BLOCK),
25
	TRUMPET("trumpet", SoundEvents.NOTE_BLOCK_TRUMPET, NoteBlockInstrument.Type.BASE_BLOCK),
26
	TRUMPET_EXPOSED("trumpet_exposed", SoundEvents.NOTE_BLOCK_TRUMPET_EXPOSED, NoteBlockInstrument.Type.BASE_BLOCK),
27
	TRUMPET_OXIDIZED("trumpet_oxidized", SoundEvents.NOTE_BLOCK_TRUMPET_OXIDIZED, NoteBlockInstrument.Type.BASE_BLOCK),
28
	TRUMPET_WEATHERED("trumpet_weathered", SoundEvents.NOTE_BLOCK_TRUMPET_WEATHERED, NoteBlockInstrument.Type.BASE_BLOCK),
29
	ZOMBIE("zombie", SoundEvents.NOTE_BLOCK_IMITATE_ZOMBIE, NoteBlockInstrument.Type.MOB_HEAD),
30
	SKELETON("skeleton", SoundEvents.NOTE_BLOCK_IMITATE_SKELETON, NoteBlockInstrument.Type.MOB_HEAD),
31
	CREEPER("creeper", SoundEvents.NOTE_BLOCK_IMITATE_CREEPER, NoteBlockInstrument.Type.MOB_HEAD),
32
	DRAGON("dragon", SoundEvents.NOTE_BLOCK_IMITATE_ENDER_DRAGON, NoteBlockInstrument.Type.MOB_HEAD),
33
	WITHER_SKELETON("wither_skeleton", SoundEvents.NOTE_BLOCK_IMITATE_WITHER_SKELETON, NoteBlockInstrument.Type.MOB_HEAD),
34
	PIGLIN("piglin", SoundEvents.NOTE_BLOCK_IMITATE_PIGLIN, NoteBlockInstrument.Type.MOB_HEAD),
35
	CUSTOM_HEAD("custom_head", SoundEvents.UI_BUTTON_CLICK, NoteBlockInstrument.Type.CUSTOM);
36
37
	private final String name;
38
	private final Holder<SoundEvent> soundEvent;
39
	private final NoteBlockInstrument.Type type;
40
41
	NoteBlockInstrument(final String name, final Holder<SoundEvent> soundEvent, final NoteBlockInstrument.Type type) {
42
		this.name = name;
43
		this.soundEvent = soundEvent;
44
		this.type = type;
45
	}
46
47
	@Override
48
	public String getSerializedName() {
49
		return this.name;
50
	}
51
52
	public Holder<SoundEvent> getSoundEvent() {
53
		return this.soundEvent;
54
	}
55
56
	public boolean isTunable() {
57
		return this.type == NoteBlockInstrument.Type.BASE_BLOCK;
58
	}
59
60
	public boolean hasCustomSound() {
61
		return this.type == NoteBlockInstrument.Type.CUSTOM;
62
	}
63
64
	public boolean worksAboveNoteBlock() {
65
		return this.type != NoteBlockInstrument.Type.BASE_BLOCK;
66
	}
67
68
	private enum Type {
69
		BASE_BLOCK,
70
		MOB_HEAD,
71
		CUSTOM;
72
	}
73
}
74

Decompiled Minecraft 26.3 source of NoteBlockInstrument (net/minecraft/world/level/block/state/properties/NoteBlockInstrument.java) with Mojang official mappings, stored verbatim on the site.