This function pack allows you to convert a selected player’s score from a specified scoreboard objective into XP levels.
Contributors
This work is licensed under the MIT License.
Usage Commands
/tag <target> add wiki:score_to_xp_level
Enables score-to-XP level conversion for the selected target.
/playsound random.wiki.levelup
This pack mutes the random.levelup
sound to prevent undesired sound effects from playing during the conversion. If you wish to use the level-up sound effect elsewhere in your project, you can use the random.wiki.levelup
sound ID instead.
Editable Files
functions/wiki/scoreboard/players/score_to_xp_level.mcfunction
- In this file,
wiki:n.main
is the objective where the required scoreboard data is stored, andwiki:n.temp
is the temporary objective used to convert scores fromwiki:n.main
into XP levels for the selected players. - You can rename
wiki:n.main
to match the name of your desired objective. - Alternatively, if your text/code editor has a search-and-replace feature, you can replace all instances of
wiki:n.
with your desired objective name. For example, replacing it withwiki:money.
will generatewiki:money.main
andwiki:money.temp
. - You can also replace the
wiki:
namespace with your project's namespace if needed.