Minecraft Data Packs / Server Utility

Command Creator Framework with Custom Permissions (1.19)

  • check_circle Functions
  • 2,739 views, 2 today
  • 138 downloads, 0 today
  • 16
  • 10
  • 2
HeccFeesh's Avatar HeccFeesh
Level 14 : Journeyman Birb
37
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.






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 who don't do good smort 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.

Please meaning give credit or I will...

Ask very nicely for you to jump off a cliff :)

NOTE: I am currently trying to figure out a way to block chat reporting with datapacks until then use this only with people you trust on servers that are version 1.19.1 and up
CompatibilityMinecraft 1.18
toMinecraft 1.19
Tags

2 Update Logs

Update #2 : by HeccFeesh 09/11/2022 2:57:58 pmSep 11th, 2022

Updated to 1.19 it was very difficult I changed one line of code pls download my datapack
LOAD MORE LOGS

Create an account or sign in to comment.

Edzplayz
12/29/2021 5:22 pm
Level 9 : Apprentice Miner
Edzplayz's Avatar
thanks
3
HeccFeesh
12/29/2021 5:25 pm
Level 14 : Journeyman Birb
history
HeccFeesh's Avatar
yw?
2
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome