Class Note
java.lang.Object
org.bukkit.Note
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @NotNull NoteCreates a new note for a flat tone, such as A-flat.@NotNull NotebytegetId()Returns the internal id of this note.intReturns the octave of this note.floatgetPitch()Gets the pitch of this note.@NotNull Note.TonegetTone()Returns the tone of this note.inthashCode()booleanReturns if this note is sharped.static @NotNull NoteCreates a new note for a natural tone, such as A-natural.static @NotNull NoteCreates a new note for a sharp tone, such as A-sharp.@NotNull Notesharped()toString()
-
Constructor Details
-
Note
public Note(int note) Creates a new note.- Parameters:
note- Internal note id.getId()always return this value. The value has to be in the interval [0; 24].- Since:
- 1.1.0
-
Note
Creates a new note.- Parameters:
octave- The octave where the note is in. Has to be 0 - 2.tone- The tone within the octave. If the octave is 2 the note has to be F#.sharped- Set if the tone is sharped (e.g. for F#).- Since:
- 1.1.0
-
-
Method Details
-
flat
-
sharp
Creates a new note for a sharp tone, such as A-sharp.- Parameters:
octave- The octave where the note is in. Has to be 0 - 2.tone- The tone within the octave. If the octave is 2 the note has to be F#.- Returns:
- The new note.
- Since:
- 1.1.0
-
natural
-
sharped
- Returns:
- The note a semitone above this one.
- Since:
- 1.1.0
-
flattened
- Returns:
- The note a semitone below this one.
- Since:
- 1.1.0
-
getId
@Internal public byte getId()Returns the internal id of this note.- Returns:
- the internal id of this note.
- API Note:
- Internal Use Only
-
getOctave
public int getOctave()Returns the octave of this note.- Returns:
- the octave of this note.
- Since:
- 1.0.0
-
getTone
Returns the tone of this note.- Returns:
- the tone of this note.
- Since:
- 1.0.0
-
isSharped
public boolean isSharped()Returns if this note is sharped.- Returns:
- if this note is sharped.
- Since:
- 1.0.0
-
getPitch
public float getPitch()Gets the pitch of this note. This is the value used withWorld.playSound(Location, Sound, float, float)or the /playsound command.- Returns:
- the pitch
- Since:
- 1.20.2
-
hashCode
-
equals
-
toString
-