Create a package and file
In development_behavior_packs inside the com.mojang directory, create WorkshopFunctions. Save the manifest.json from the example in its root. Create functions/workshop/award.mcfunction nearby. The complete Windows development path is shown in the Add-Ons manual.
{
"format_version": 2,
"header": {
"name": "WorkshopFunctions",
"description": "Учебный пакет LonelyCraft",
"uuid": "66714edc-cc70-438c-92d0-fbb09d781db5",
"version": [
1,
0,
0
],
"min_engine_version": [
1,
21,
0
]
},
"modules": [
{
"type": "data",
"uuid": "420c5a52-d0b4-4467-8141-a805f1d2dd72",
"version": [
1,
0,
0
]
}
]
}Write two lines
Save the plain UTF-8 text with the .mcfunction extension, without the hidden .txt. There is no need for a slash at the beginning of lines. Activate the package in the test world with command; After editing the file, go to the menu and open world again.
scoreboard players add @s workshop_points 1
say Award function calledInitialize the score and invoke the function manually
Execute the preparation command from the block below in the chat once. Then execute /function workshop/award three times. Expect three messages and the number 3 in the sidebar. If there is no message, the function was not found or was not loaded; if there is a message but no point, check the objective and performer.
/scoreboard objectives add workshop_points dummy
/scoreboard players set @s workshop_points 0
/scoreboard objectives setdisplay sidebar workshop_points
/function workshop/awardConsider creating an objective and changing a value. Bedrock counter.
Running from a command block: choose the player
The command block does not have player @s. Write execute as @p at @s run function workshop/award into it. Here as changes the player, and at transfers the position and dimension to the selected player. For our point increase, the performer is enough; at is useful for functions with relative coordinates.
@p is chosen relative to the execution location, not necessarily the button clicker. In multiplayer mechanics, use explicit selection of participants and tags. An automatic call via tick.json is executed every tick: do not transfer the issuance of a point there without a condition and protection against repetition. For the first project, leave it manually.
How to test a circuit before starting it all the time. command blocks.


