Skip to content

[EN] Plugin Tutorial

ゆっちゃん edited this page Dec 31, 2021 · 42 revisions

The main important functions are explained in this section.

Running the script

Overview

It can be executed by API or Command, but basically it is executed based on the condition of the ScriptKey.
(For example, if you want to execute a script that is set to "interact", you need to click on the target block.)

ScriptKey Description
interact When you click on a block.
break When you destroy a block.
walk When you walked on the block.
hit When a projectile hits a block.

Run script in redstone

This will only work if you have enabled the setting to run script in redstone.
Searches for players in the surrounding area based on the selector and filters that have been set.
(For example, if "@p" is set, it will search for the nearest player and execute the script on them.)

Inverting an Option result

You can invert the result by adding ! to the first letter of the Option.
(For example, "[!$item:stone 1] [@command heal]" will execute the command only if you do not have the stone.)

Selector

Placeholder Description
<world> World name
<online> Number of players online
<players> Number of players in the world

Description

See this site for more information.

Repeat

Argment Description
tick=tick Sets the interval for repeats.
tick should be an Integer
delay=tick Sets the time to start repeating.
tick should be an Integer
limit=number Limit the number of executions.
number should be an Integer

Description

You can use repeat to run the script repeatedly.
Basically, it is written in the form of repeat{argument=value}.
It is also possible to specify more than one repeat by writing repeat{argument=value,argument=value}.
(For example, if "repeat{tick=20} @p" is set, the script will be executed every second for the nearest player.)

Filter

Argment Description
op=has Check if the player has the OP.
has must be true or false.
perm=node Check if the player has the Permisson.
node should be a Permission Node.
limit=number Limit the number of executions.
number should be an Integer.

Description

Filters can be used to narrow down the results of the selector.
Basically, it is written in the form of filter{argument=value}.
It is also possible to specify more than one filter by writing filter{argument=value,argument=value}.
(For example, if "filter{op=true,limit=1} @a[sort=nearest]" is set, it will target the closest player who has the OP.)

Commands

Arguments

Argument Description
<scriptkey> See the list of ScriptKey.
<options> See the list of Option.
<world> World name
<x> <y> <z> X, Y, Z coordinates.
[pasteonair] Whether to paste the script on the air block(true / false).
[player] Player name
[nametag] Name tag
[repeat] See the list of Repeat.
[filter] See the list of Filter.
[selector] See the list of Selector.
[overwrite] Whether to overwrite the existing script(true / false).

Running the script

Command Description
/sbp <scriptkey> run [player] <world> <x> <y> <z> Executes the Script at the specified coordinates.

Edit and View scripts

After executing the command, Right Click on any block.
You can specify multiple Options by enclosing them in parentheses [...].
(For example, [@player &aHEAL!!] [@bypass /heal])

Command Description
/sbp <scriptkey> create <options> Create a new script to the block.
The previous settings will be deleted and overwritten.
/sbp <scriptkey> add <options> Add a new script to the block.
Adds only the specified options, leaving the settings unchanged.
/sbp <scriptkey> remove Remove the script from the block.
Delete all settings, including cool time, etc.
/sbp <scriptkey> view View the script for the block.

Make the script work with redstone

After executing the command, Right Click on any block.

Command Description
/sbp <scriptkey> redstone [repeat] [filter] [selector] Set if the script works with Redstone.

Paste the script into the selected area

First, use the Script Editor to copy the Script for any block.
Then use the Block Selector to select a range, and execute the command to paste.

Command Description
/sbp selector paste [pasteonair] [overwrite] Paste the script into the selection.

Delete scripts in the selected range

Use the Block Selector to select a range, and then execute the command to delete it.

Command Description
/sbp selector remove Remove the script into the selection.

Tools

Getting the tools

Command Description
/sbp tool Distribute the tools to the sender.

Script Editor

This tool supports script editing.
If you want to paste a script into the selected area, copy the script in Script Editor and then execute the command.

Script Viewer

This tool supports script checking.

NMS Description
Enabled Searches for scripts within a 15m radius around the player.
Air blocks are shown in blue, other blocks in green.
Since it searches and displays blocks that are not emitting light, the load is not very high.
Disabled Searches for scripts within a 10m radius around the player.
Air blocks are shown in light blue, and other blocks in yellow-green.
Every 0.5 seconds, a large number of particles are being sent, so the load is considerable.

Script Manager

This tool supports script management.
== Description of the text input window ==
You can use the left item to reset the text, and the right item to end the input.
Also, if the text you're editing exceeds the maximum number of editable characters in the anvil, a warning will be displayed.

== Description of the search window ==

Item name (default) Description
Specify script Open the text input window.
Search wordScript
(Example)@player HelloWorld, searches for scripts with the specified script.
Specify time Open the text input window.
Search wordsyyyy/MM/dd yyyy/MM/dd~yyyy/MM/dd
(Example)2021/10/01, search for scripts with the specified date.
(Example)2021/10/01~2021/10/31, searches for scripts between the specified dates.
Specify coords Open the text input window.
Search wordsworld world:... x,y,z x,y,z~x,y,z
(Example)world, searches for scripts with the specified world name.
(Example)world:(coords), searches for scripts in the specified world and coords.
(Example)10,10,10, searches the script for the specified coords.
(Example)10,10,10~20,20,20, searches for scripts between the specified coords.
Specify nametag Open the text input window.
Search wordNameTag
(Example)Example, searches for scripts with the specified name tag.
ScriptKey Switches the ScriptKey for searching.
Next page Switches the page for the searched script.
Prev page Switches the page for the searched script.
Reset Reset the displayed information.
Script Open the Settings window.

== Description of the Settings window ==

Item name (default) Description
Edit target selector Open the text input window.
Edit script Open the text input window.
Left-click to change the editing target, and right-click to edit the script.
Edit nametag Open the text input window.
Teleport Teleports to the script's coords.
Execute Execute the script.
Information Displays information about the script.
Click to update the information.
Copy Copy the script.
Click again to cancel the copy.
Paste Paste the script.

Block Selector

This tool supports range selection.

Config

SortScripts

If you have enabled SortScripts, the Options will be sorted in the order in which they are registered.
This is a useful feature that sorts the Options in the best possible order.

------------------------------------
|   config.yml/SortScripts: true   |
------------------------------------
[@command /heal][@actionbar:You have been healed.][@delay:100] ---> [@delay:100][@actionbar:You have been healed.][@command /heal]

-------------------------------------
|   config.yml/SortScripts: false   |
-------------------------------------
[@command /heal][@actionbar:You have been healed.][@delay:100] ---> No change

OptionPermission

If OptionPermission is enabled, Permission will be required to execute the option.
Permission: scriptblockplus.option.<optionid>

Argment Description
<optionid> See ID in the list of Options.

Clone this wiki locally