your current location:首页 > news>No him minecraft

No him minecraft

2024-12-15 02:57:06|Myriagame |source:minecraft skins

Overview

This module is the Fabric transplant version of the NoteBlock API plug -in, which can play the sound of the .nbs file in the notes box.Due to some restrictions, this module cannot fully realize the function of the original plug -in.Here is the Spigot website of the NoteBlock API.This module can only be used on the server or single -person world.

Use

Add to module

Use this API in other modules, you need to add the Modrinth repository to the module front of the module file in the module.For example, the following code needs to replace Version_tag to the latest version such as 0.1.0+1.19.

 repositories {maven {url "https://api.modrinth.com/maven" content {infludegroup "maven.modrinth"}}} dependencies {Modimplemen TATION Include ("Maven.modrinth: Nota: Version_tag")} 

Get .nbs file

You need to convert the .midi file of the song to the. NBS file. The method recommended by the author is the editor of the Note Block Studio.

Play songs

You must first load songs in the. NBS format in the module before playing it in the game. The loading method is as follows, and these songs are defined in the module.

 song song = nbsdecoder.parse (new file ("path 1.nbs"); song song2 = nbsdecoder.parse (new file ("path 2.nbs")); ...… Playlist playlist = New PlayList (Song, Song2, ...); 

It can make the song playback event divided into three types, divided into broadcast, position range playback, and physical range playback.

The music radio will play music for all players in the whole service. No matter where they are, the way of use is as follows.

 song song; // Load the song Radiosongplayer RSP = New Radiosongplayer (Song); // Create a music radio event RSP.Setid (New Identifier ("Example: radio "); //Set the identifier, not the necessary RSP.addplayer (player); // Add the player to the song to listen to RSP.SetPlaying (true); // Play 

Position playback will play songs to all players within a certain specified range.

 song song; Positionsongplayer PSP = New Positionsongplayer (Song); // Create a radio event PSP.Setid (New Identifier ("Example: position "); PSP.SetBlockpos (POS); // Set the position of music playback PSP.SetDistance (16); // Set up music to be heard by the player's maximum distance psp.addplayer (player); psp.setplaying (true);A certain range of players in a certain range of players play music.

 song song; EntitySongplayer ESP = New EntitySongPlayer (Song); // Create a physical range broadcast event ESP.Setid (New Identifier ("Example: E ntity ");); // Set the physical ESP.SetDistance (16); // Set the maximum distance of ESP.Addplayer (player) that can be heard by the player;