A library blessed by pinki that facilitates many things 7u7
Features:
* simple system to create advanced commands .
Planned features:
* packet interceptor
* reflection util
* NMS implementation
* give ideas uwu
This library will be updated when one of my plugins so requires, or suggest an idea for this that facilitates the construction of plugins.
Hail Pinki!
Features:
* simple system to create advanced commands .
Spoiler: Create Commands
Spoiler: SingleCommand
Single command:
Create a class extending PLIBCommand and implement the methods.
The execute method will be who executes the command.
The other methods are to adjust the parameters of the command, leaving them as null will make them return to the default value.
Set onlyFor:
Set sender type with SenderType:
There are three types of sender: PLAYER, CONSOLE and ALL.
Returning it null will be the same as returning it ALL
To register, in the onEnable method place:
change "new CustomCmd()" for the class you created.
Create a class extending PLIBCommand and implement the methods.
Code (Java):
public
class CustomCmd
extends PLIBCommand
{
@Override
public boolean execute (CommandSender sender, String label, String [ ] args ) {
// TODO Auto-generated method stub
return false ;
}
@Override
public String [ ] setAliases ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setDescription ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public int setMaxArgs ( ) {
// TODO Auto-generated method stub
return 0 ;
}
@Override
public int setMinArgs ( ) {
// TODO Auto-generated method stub
return 0 ;
}
@Override
public String setFewArgumentsMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setTooManyArgumentsMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setPermission ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setNotPermissionMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public SenderType onlyFor ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setOnlyForMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
}
@Override
public boolean execute (CommandSender sender, String label, String [ ] args ) {
// TODO Auto-generated method stub
return false ;
}
@Override
public String [ ] setAliases ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setDescription ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public int setMaxArgs ( ) {
// TODO Auto-generated method stub
return 0 ;
}
@Override
public int setMinArgs ( ) {
// TODO Auto-generated method stub
return 0 ;
}
@Override
public String setFewArgumentsMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setTooManyArgumentsMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setPermission ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setNotPermissionMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public SenderType onlyFor ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setOnlyForMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
}
Code (Java):
Set onlyFor:
Set sender type with SenderType:
Code (Java):
@Override
public SenderType onlyFor ( ) {
return SenderType. PLAYER ;
}
public SenderType onlyFor ( ) {
return SenderType. PLAYER ;
}
Returning it null will be the same as returning it ALL
To register, in the onEnable method place:
Code (Java):
@Override
public void onEnable ( ) {
PLIBCommandAPI comandAPI = PLIB. CommandCreatorAPI ;
commandAPI. newCommand (YourPlugin, "NameOfCommand", new CustomCmd ( ) ) ;
}
public void onEnable ( ) {
PLIBCommandAPI comandAPI = PLIB. CommandCreatorAPI ;
commandAPI. newCommand (YourPlugin, "NameOfCommand", new CustomCmd ( ) ) ;
}
Spoiler: RootCommand
Root Command and SubCommand:
To create a root command create a class and extend PLIBSubCommandRoot and follow the same steps as with the single command.
To create subcommands is the same but extending PLIBSubCommand.
the difference is that this has a constructor.
To register a root command and its respective subcommands, in onEnable () place:
change "new CustomCmd()" for the the root command class that you created, in PLIBSubCommand[] put all the subcommand classes you want.
Code (Java):
public
class CustomCmd
extends PLIBSubCommandRoot
{
@Override
public boolean execute (CommandSender sender, String Label ) {
// TODO Auto-generated method stub
return false ;
}
@Override
public String [ ] setAliases ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setDescription ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setNoSubcommandExistMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setPermission ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setNotPermissionMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public SenderType onlyFor ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setOnlyForMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
}
@Override
public boolean execute (CommandSender sender, String Label ) {
// TODO Auto-generated method stub
return false ;
}
@Override
public String [ ] setAliases ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setDescription ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setNoSubcommandExistMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setPermission ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setNotPermissionMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public SenderType onlyFor ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setOnlyForMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
}
To create a root command create a class and extend PLIBSubCommandRoot and follow the same steps as with the single command.
To create subcommands is the same but extending PLIBSubCommand.
Code (Java):
public
class SubCustomCmd
extends PLIBSubCommand
{
public CustomCmd ( String name ) {
super (name ) ;
// TODO Auto-generated constructor stub
}
@Override
public boolean execute (CommandSender sender, String label, String [ ] args ) {
// TODO Auto-generated method stub
return false ;
}
@Override
public int setMaxArgs ( ) {
// TODO Auto-generated method stub
return 0 ;
}
@Override
public int setMinArgs ( ) {
// TODO Auto-generated method stub
return 0 ;
}
@Override
public String setPermission ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setNotPermissionMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setFewArgumentsMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setTooManyArgumentsMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public SenderType onlyFor ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setOnlyForMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
}
public CustomCmd ( String name ) {
super (name ) ;
// TODO Auto-generated constructor stub
}
@Override
public boolean execute (CommandSender sender, String label, String [ ] args ) {
// TODO Auto-generated method stub
return false ;
}
@Override
public int setMaxArgs ( ) {
// TODO Auto-generated method stub
return 0 ;
}
@Override
public int setMinArgs ( ) {
// TODO Auto-generated method stub
return 0 ;
}
@Override
public String setPermission ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setNotPermissionMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setFewArgumentsMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setTooManyArgumentsMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public SenderType onlyFor ( ) {
// TODO Auto-generated method stub
return null ;
}
@Override
public String setOnlyForMessage ( ) {
// TODO Auto-generated method stub
return null ;
}
}
To register a root command and its respective subcommands, in onEnable () place:
Code (Java):
@Override
public void onEnable ( ) {
PLIBCommandAPI comandAPI = PLIB. CommandCreatorAPI ;
commandAPI. newCommand (YourPlugin, "NameOfRootCommand", new CustomCmd ( ), new PLIBSubCommand [ ] { new SubCustomCmd ( "NameOfSubCommand" ) } ) ;
}
public void onEnable ( ) {
PLIBCommandAPI comandAPI = PLIB. CommandCreatorAPI ;
commandAPI. newCommand (YourPlugin, "NameOfRootCommand", new CustomCmd ( ), new PLIBSubCommand [ ] { new SubCustomCmd ( "NameOfSubCommand" ) } ) ;
}
Planned features:
* packet interceptor
* reflection util
* NMS implementation
* give ideas uwu
This library will be updated when one of my plugins so requires, or suggest an idea for this that facilitates the construction of plugins.
Hail Pinki!
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.13
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Libraries for Pinki is a free Minecraft Java mod. Compatible with Minecraft 1.13. Downloaded 224 times (via Spigot). Download it and open it directly in the game.