API - Palgia/SkItemCreator-V2 GitHub Wiki

Get started

SkItemCreatorV2 features a complete API to use in your Skripts!

All functions can be found in functions.sk inside SkItemCreatorV2's folder.

General

Get ID of an item

SKICInternalNameOfItem(i: item)

Returns the SkItemCreator ID of an item.

Get the item category

SKICItemCategoryFromID(id: string)

Returns the item-category of the provided item's ID.

Get an item from an ID

SKICGetItemFromID(id: string)

Returns the item from the given ID.

Import an item

SKICImportItem(i: item, id: string)

Register an item inside the admin GUI. Set ID to the ID you want to set for your item.

Get all items in a category

SKICAllItemsOfCategory(category: string)

Returns all items IDs inside the given category.

Remove an imported item

SKICRemoveImportedItem(id: string)

Removes an imported item.

Get rarity

SKICGetRarity(i: item)

Returns the rarity of the given item.

Random generate an item

SKICRandomGenerate(itemid: string)

Returns an item with random generated stats (Needs SkRPG).

Get permission

SKICGetPermission(i: item)

Get the permission associated with the item.

If conditions are met

Checks if an item can be used by the player. If your items has conditions, this function will check if they are met. If your item doesn't have any conditions, this function will always return true.

Returns true (can be used) or false.

SKICCheckConditions(p: player, i: item)

Kits

Get items inside a kit

Returns all items inside a kit. Does not trigger sound, messages etc.

SKICReturnKitItems(kit: string)

Send a kit to a player

Give a kit to a player. Set bypass to true to bypass cooldown and permission.

SKICGiveKitToPlayer(p: player, kit: string, bypass: boolean)

Custom blocks

Block is a custom block

Returns true if block is a custom block

SKICIsCustomBlock(block: block)

Get ID of a block

Returns the ID of the block

SKICGetBlockID(block: block)

Is item whitelisted

Returns true if the given item can break the given custom block.

SKICIsToolWhitelisted(item: item, block: block)

Is item blacklisted

Returns true if the given item can't break the given custom block.

function SKICIsToolBlacklisted(item: item, block: block)

API Examples

command /getitem <string>:
    trigger:
        give SKICGetItemFromID(arg 1) to player
on load:
    set {_item} to iron ingot of sharpness 2 named "&e&lCustom Ingot"
    SKICImportItem({_item}, "custom_ingot")
command /getswords:
    trigger:
        open chest inventory with 6 rows named "&8&lMy Swords"
        
        set {_l} to 1

        loop SKICAllItemsOfCategory("swords"):
            set {_item} to SKICGetItemFromID(loop-value)
            set slot {_l} of player's current inventory to {_item}
            add 1 to {_l}
command /checkconditions:
    trigger:
        if SKICCheckConditions(player, tool of player) is true:
            send "&aYou can use your item!"
        else:
            send "&cYou can't use your item!
⚠️ **GitHub.com Fallback** ⚠️