• • 9/11/22 2:57 pm • 2 logs
- 3.4k views • 5 today
- save_alt 163 downloads
- Compatibility
- Minecraft 1.18
- to version
- Minecraft 1.19
- Changes include
- Functions
65
IMPORTANT NOTE: This datapack is made with the assumption that you have the ability to code in your own custom commands with the base code it provides. I am going to attempt to describe the method with which to create the commands, however it is not my fault if you completely fail.
This is more of a framework than an actual datapack, I don't recommend using it without any modifications, although you are welcome to if you want.
In order to give people a permissions level, which ranges from 1 to 20, run the command /scoreboard players set <player> permissions <1-20>
If you use this datapack for your server, please give credit.
Command Creation
In order to create the /trigger commands the first step is to extract the datapack file, then go to the functions folder in the 'perms' namespace folder. In order to make custom limits to the permission level of commands, go to the load file and go to the comment 'Set level arguement.' Three arguements have already been made; 4, 5, and 20. You can make any permission arguements between 1 and 20. Technically you may create them beyond that; however, this has no effect whatsoever, due to the maximum permissions being 20, and the minimum being 1.
The syntax for permission arguements:
scoreboard players set <number> num <same_number>
If it wasn't obvious, the two numbers should be exactly the same.
You may then 'register' your command below that, under the 'Set Trigger Objectives.'
The syntax:
scoreboard objectives add <command_name> trigger
You may then go into tick.mcfunction. Inside it, go to the comment 'Put commands here, example below.' Inside it, there should be two examples, one of a gamemode command, and one of the /heal command from popular plugins. They should demonstrate the syntax pretty well, but I'll explain it nonetheless.
It starts with the activator:
execute as @a if score @s permissions >= <permission level> num run scoreboard players enable @s <trigger>
The activator starts with a execute command, checks if the score is equal or higher to the permission level, which must be defined in load.mcfunction, and enables the command if it is.
After that, you need the detector/executor, the syntax being:
execute as @a if score @s <same_trigger> matches <number> run <command>
If the command can only have one result, then you can do something more exact, like this:
execute as @a unless score @s <same_trigger> matches 0 run <command>
This works because triggers start with 0, and every time you do /trigger <trigger> it adds one. This prevents idiots from doing /trigger <trigger> 99 or something like that. However, it should be noted that this does not work if the command can have multiple results, such as a difficulty command that lets you choose from the 4 different difficulties.
You should end your command by resetting it back to what the trigger level starts as.
Syntax:
execute as @a run scoreboard players set @s <same_trigger> <starting_number>
This ending script should come after the other three.
The syntax for permission arguements:
scoreboard players set <number> num <same_number>
If it wasn't obvious, the two numbers should be exactly the same.
You may then 'register' your command below that, under the 'Set Trigger Objectives.'
The syntax:
scoreboard objectives add <command_name> trigger
You may then go into tick.mcfunction. Inside it, go to the comment 'Put commands here, example below.' Inside it, there should be two examples, one of a gamemode command, and one of the /heal command from popular plugins. They should demonstrate the syntax pretty well, but I'll explain it nonetheless.
It starts with the activator:
execute as @a if score @s permissions >= <permission level> num run scoreboard players enable @s <trigger>
The activator starts with a execute command, checks if the score is equal or higher to the permission level, which must be defined in load.mcfunction, and enables the command if it is.
After that, you need the detector/executor, the syntax being:
execute as @a if score @s <same_trigger> matches <number> run <command>
If the command can only have one result, then you can do something more exact, like this:
execute as @a unless score @s <same_trigger> matches 0 run <command>
This works because triggers start with 0, and every time you do /trigger <trigger> it adds one. This prevents idiots from doing /trigger <trigger> 99 or something like that. However, it should be noted that this does not work if the command can have multiple results, such as a difficulty command that lets you choose from the 4 different difficulties.
You should end your command by resetting it back to what the trigger level starts as.
Syntax:
execute as @a run scoreboard players set @s <same_trigger> <starting_number>
This ending script should come after the other three.
This is more of a framework than an actual datapack, I don't recommend using it without any modifications, although you are welcome to if you want.
In order to give people a permissions level, which ranges from 1 to 20, run the command /scoreboard players set <player> permissions <1-20>
If you use this datapack for your server, please give credit.
2 Update Logs
Update #2 : by HeccFeesh 09/11/2022 2:57:58 pmSeptember 11, 2022 @ 6:57 pm UTC
Updated to 1.19 it was very difficult I changed one line of code pls download my datapack
LOAD MORE LOGS
More like this
5426897
119




Have something to say?