CraftKit | Spigot icon

CraftKit | Spigot -----

Utility kit for Spigot and Bungeecord plugins | GUI, NPC, NBT, Skin and more



What is this? CraftKit is a utility kit that aims to speed up the development time. With this library, the developers don't have to write duplicated codes or concerns about multi-version support.

#Manual


If you are a server owner:
Simply put this library into your server's plugin folder. Your server must have an Internet connection to allow the library to download internal modules.
Command: /ck (or /craftkit)

For servers running on Java 9+, please add the following parameter to your server startup command:
Code (Text):
--add-opens java.base/java.net=ALL-UNNAMED
If you are a developer and want to use this library:

Repo:

HTML:
<repositories>
    <repository>
        <id>jitpack.io </id>
        <url>https://jitpack.io </url>
    </repository>
</repositories>
Spigot side:
HTML:

<dependency>
    <groupId>com.github.anhcraft.CraftKit </groupId>
    <artifactId>craftkit.spigot </artifactId>
    <version>VERSION </version>
</dependency>
Bungeecord side:
HTML:

<dependency>
    <groupId>com.github.anhcraft.CraftKit </groupId>
    <artifactId>craftkit.bungee </artifactId>
    <version>VERSION </version>
</dependency>
Example:
You can look here to know the basic usages of this library.
Code (Java):
var itemStack = new ItemBuilder (Material. PAPER ). name ( "&aVoucher" ). lore ( "&aRight-click to receive &b10 coins" ). build ( ) ;
Code (Java):
var gameProfile = new GameProfileBuilder ( "anhcraft" ) ;
NPC. spawn (gameProfile, location ). addViewer (player ) ;
Code (Java):
ItemNBTHelper helper = ItemNBTHelper. of (skull ) ;
helper. setSkin (Skin. MHF_CAKE ) ;
skull = helper. save ( ) ;
Code (Java):
BungeeUtil. changeSkin ( "anhcraft", new Skin (value, signature ) ) ;
Code (Java):
@EventHandler
private void jump (PlayerJumpEvent event ) {
    if (JUMP_COUNT. containsKey (event. getPlayer ( ) ) ) JUMP_COUNT. get (event. getPlayer ( ) ). incrementAndGet ( ) ;
    else JUMP_COUNT. put (event. getPlayer ( ), new AtomicInteger ( 1 ) ) ;
}
Code (Java):
SpigetApiUtil. getResourceLatestVersion ( "39007" ) ;
Code (Java):
var root = CompoundTag. of (itemStack ) ;
var tag = root. getOrCreateDefault ( "tag", CompoundTag. class ) ;
tag. put ( "custom_tag", new IntTag ( 1 ) ) ;
root. put ( "tag", tag ) ;
itemStack = root. save (itemStack ) ;
Code (Java):
// init the extension here!
// CraftExtension.of(<YOUR PLUGIN'S MAIN CLASS>)
private CraftExtension extension ;

public void open (Player player ) {
    CustomGUI cg = extension. createCustomGUI ( null, 45, ChatUtil. formatColorCodes ( "&aRainbow &fInventory" ) ) ;
    InventoryUtil. fillAll (cg, new ItemBuilder (Material. APPLE )
            . name ( "&a" )
            . build ( ) ) ;
    cg. addContentCallback (SlotCallback. PREVENT_MODIFY ) ;
    cg. addContentCallback ( new SlotCallback ( ) {
        @Override
        public void click (InventoryClickEvent event, Player player, BaseGUI gui ) {
            InventoryUtil. fillAll (cg, new ItemBuilder (RandomUtil. pickRandom (MaterialUtil. getStainedGlassPaneTypes ( ) ) ). name ( "&a" ). build ( ) ) ;
            player. damage ( 0.0001 ) ;
        }
    } ) ;
    player. openInventory (cg ) ;
    // another_player.openInventory(cg);
}
Code (Java):
// init the extension here!
// CraftExtension.of(<YOUR PLUGIN'S MAIN CLASS>)
CraftExtension extension ;
AnvilGUI ag = extension. createAnvilGUI (player, "Title" ) ;
ag. setItem (AnvilSlot. INPUT_LEFT, new ItemStack (Material. EMERALD, 1 ), SlotCallback. PREVENT_MODIFY ) ;
ag. setItem (AnvilSlot. OUTPUT, new ItemStack (Material. EMERALD, 1 ), SlotCallback. PREVENT_MODIFY, new SlotCallback ( ) {
    @Override
    public void click (InventoryClickEvent event, Player player, BaseGUI gui ) {
        System. out. println ( ( (AnvilGUI ) gui ). getInputText ( ) ) ;
    }
} ) ;
// the GUI is opened automatically! (only for one player)
Code (Java):
// init the extension here!
// CraftExtension.of(<YOUR PLUGIN'S MAIN CLASS>)
CraftExtension extension ;
ArmorStand as = ArmorStand. spawn (player. getLocation ( ) ) ;
as. setArms ( true ) ;
as. setEquipment (EquipmentSlot. HEAD, new ItemStack (Material. IRON_HELMET, 1 ) ) ;
as. setEquipment (EquipmentSlot. HAND, new ItemStack (Material. DIAMOND_AXE, 1 ) ) ;
TrackedEntity <ArmorStand > te = extension. trackEntity (as ) ;
te. setViewDistance ( 5 ) ;
te. addViewer (player ) ;
Resource Information
Author:
----------
Total Downloads: 29,181
First Release: Apr 7, 2017
Last Update: Jun 19, 2021
Category: ---------------
All-Time Rating:
42 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings