Skip to content

Commit 3d9ad9e

Browse files
Enhance README with installation and usage details
Expanded the README to provide detailed installation and usage instructions for the df-noteblockplayer plugin, including command usage and code examples.
1 parent 06fb4e8 commit 3d9ad9e

1 file changed

Lines changed: 44 additions & 1 deletion

File tree

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,45 @@
11
# df-noteblockplayer
2-
A Dragonfly-MC plugin that enables loading and playback of Note Block Studio (.nbs) songs for players in-game
2+
3+
A simple Dragonfly-MC plugin that lets players load and play Note Block Studio (.nbs) songs in-game.
4+
5+
## Installation
6+
7+
1. Import the package, and make sure there is a `noteblock` folder in your project directory:
8+
9+
```go
10+
package main
11+
12+
import (
13+
_ "github.com/redstonecraftgg/df-noteblockplayer"
14+
// other imports
15+
)
16+
```
17+
18+
2. Put your `.nbs` files or JSON files (you can create these with [NoteblockParser](https://github.com/RedStoneCraftGG/NoteblockParser)) inside the `noteblock` folder.
19+
20+
## Usage
21+
22+
You can play songs in two ways:
23+
24+
### Using Commands
25+
26+
- To play a song, use `/playnoteblock <your file name>`. You can also use `/playnb` or `/pnb` as shortcuts.
27+
- To stop the song, use `/stopnoteblock`. Shortcuts are `/stopnb` and `/snb`.
28+
29+
### Using Functions
30+
31+
You can also play a song from your code with the `PlayNoteblock()` function:
32+
33+
```go
34+
err := PlayNoteblock(p.H(), "my_song.nbs")
35+
if err != nil {
36+
// handle error
37+
}
38+
```
39+
40+
Currently, there is no `StopNoteblock()` function. I wasn't able to test it due to a Minecraft DNS issue (from 2025-10-29 to 2025-10-30) that prevented me from joining a server. I will add this function once the issue is resolved.
41+
42+
## Known Issues and Limitations
43+
44+
- Dragonfly-MC's API does not have volume control yet, so you will hear sounds at their default volume from the resource pack.
45+
- Pitch is limited: because dragonfly-mc uses an int for pitch control (instead of float), notes below F#3 (key 0) cannot be played and will instead be shifted up to F#4 (key 12). However, all notes above F#5 (key 24) will still play correctly.

0 commit comments

Comments
 (0)