File tree Expand file tree Collapse file tree
src/main/java/com/example/customcmd Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828dependencies {
2929 // Minecraft 26.1.2
3030 minecraft ' com.mojang:minecraft:26.1.2'
31- mappings loom. officialMojangMappings()
32-
3331 // Fabric Loader
3432 modImplementation ' net.fabricmc:fabric-loader:0.18.4'
3533
Original file line number Diff line number Diff line change 22
33import com .mojang .brigadier .arguments .IntegerArgumentType ;
44import net .fabricmc .fabric .api .command .v2 .CommandRegistrationCallback ;
5+ import net .fabricmc .fabric .api .permission .v1 .Permissions ;
56import net .minecraft .commands .CommandSourceStack ;
67import net .minecraft .commands .Commands ;
78import net .minecraft .commands .arguments .EntityArgument ;
@@ -17,7 +18,7 @@ public static void register() {
1718 dispatcher .register (
1819 Commands .literal ("mycommand" )
1920 // Yalnızca op seviyesi 2+ kullanabilir (0 = herkes)
20- .requires (source -> source .hasPermission (2 ))
21+ .requires (source -> source .permissions (). hasPermission (Permissions . COMMANDS_MODERATOR ))
2122
2223 .then (Commands .argument ("oyuncu" , EntityArgument .players ())
2324 .then (Commands .argument ("miktar" , IntegerArgumentType .integer (1 , 9999 ))
You can’t perform that action at this time.
0 commit comments