Files

1.9 KiB

IScriptPlayer.stopSound

← IScriptPlayer · ← Master

Parça 11/11 · önceki

var data = uiContext.getData();

// If false was passed into openUI as second argument // Then name or last name wouldn't be immediately populated // as John Smith c.send("Your name is: " + data.getString("name") + " " + data.getString("lastname"));

}

closeUI

void closeUI()

Close the user interface.

You can use this method to close any GUI that player has opened, inventory, chests, command block menu, Mappet dashboard, etc. However, Mappet won't close the in-game pause menu (to avoid potential griefing).

getUIContext

IMappetUIContext getUIContext()

Get the UI context of currently opened user UI. See IMappetUIContext for code examples.

getFactions

java.util.Set<java.lang.String> getFactions()

Returns the faction of the npc as a string

for each (var faction in c.getSubject().getFactions()){ c.send(faction) }

setupHUD

boolean setupHUD(java.lang.String id)

Setup (initiate) an HUD scene for this player.

Parameters: id - HUD scene's ID/filename.

changeHUDMorph

void changeHUDMorph(java.lang.String id, int index, AbstractMorph morph)

Change a morph in a HUD scene at given index with given morph.

Parameters: id - HUD scene's ID/filename. index - Index of the morph in the scene that should be changed (0 is the first, and so on).

closeAllHUD

default void closeAllHUD()

Close all HUD scenes.

closeHUD

void closeHUD(java.lang.String id)

Close specific HUD scene for this player.

Parameters: id - HUD scene's ID/filename.

getDisplayedHUDs

INBTCompound getDisplayedHUDs()

Get all HUD scenes (including global HUDs) that are currently displayed for this player.

var player = c.getSubject(); var huds = player.getDisplayedHUDs();