Custom Items Wiki

Jun 7, 2019
Custom Items Wiki
  • Wiki for Custom Items
    Design Custom Items with New Textures, Recipes, and Actions
    — Download on SpigotMC at https://www.spigotmc.org/resources/63848


    [​IMG]

    underlined
    items are required. Items in gray are coming in updates. Items in blue are special items.

    ticks can usually be substituted for seconds and visa-versa.

    Reference Lists
    Minecraft Item List
    Minecraft Entity Type List
    Minecraft Potion Type List
    Minecraft Enchantment List

    Referencing Items
    For custom items, use the custom item's unique id (yml file name). For Minecraft items, use the Minecraft item name (preferably prefixed with "minecraft:")

    Referencing Colors
    On any "color" attribute, you can provide a six-character hexadecimal color code like "00AAFF" or "E41517". Google "hex color code picker".

    Referencing Enchantments
    To reference enchantments, set create a key in the YAML file with the enchantment's name, and set it to the level of the enchantment. This also works with custom enchantments from other plugins:
    Code (YAML):
    item:
      enchantments
    :
       # Unbreaking 3
        "minecraft:DURABILITY"
    : 3
        # Thorns 2
        "minecraft:THORNS"
    : 2

    Referencing Potions
    To reference just the effect (for string parameters), use the potion's Minecraft name

    To reference potions (for potion parameters), use the following keys:
    type — the potion's Minecraft name, time — integer in seconds (default 20 seconds), strength — integer (default 1), particles — boolean (default true), ambient — boolean (default true), showIcon — boolean (default true)

    Code (YAML):
    -
      action
    : playerAddEffects
      effects
    :
      # Night Vision Potion lasting 40 seconds
        -
          type
    : "NIGHT_VISION"
          time
    : 40


    Item Quick Reference

    Required Keys
    name, item (subkeys: material, displayName, lore, damageable,
    maxDurability, itemDamage, color, enchantments, glows, skullOwner**)


    Optional Keys
    native
    (required true to edit Minecraft items), info (subkeys description,
    usage, obtaining, crafting, relatedItems),
    recipes (each recipe has subkeys shaped, items, resultAmount, shape), canBeUsedGenerically (default false), canBePlaced (default canBeUsedGenerically, or true if canBeUsedGenerically isn't set), consumable (default canBeUsedGenerically), shootable (default canBeUsedGenerically), block (subkeys generation, texture, drops. More info below), handlers


    Block Quick Reference
    You can give each block custom drops. To do this, under drops, add each item you want the block to drop when broken, followed by the amount to drop. For example:

    Code (YAML):
    # This block drops 4 diamonds, 10 gold blocks,[/SIZE][/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=4][COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=rgb(0, 0, 0)][SIZE=5]# and 1 Custom Item with the ID "myCustomItemID"[/SIZE][/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=4][COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=rgb(0, 0, 0)][SIZE=5]# when broken[/SIZE][/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=4][COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=rgb(0, 0, 0)][SIZE=5]block:[/SIZE][/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=4][COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=rgb(0, 0, 0)][SIZE=5]  drops:[/SIZE][/COLOR][/SIZE][/COLOR][/SIZE]
    [SIZE=4][COLOR=rgb(0, 0, 0)][SIZE=5][SIZE=5][COLOR=rgb(0, 0, 0)]    "minecraft:DIAMOND"
    : 4[/COLOR][/SIZE][/SIZE][/COLOR][/SIZE]
    [SIZE=4][COLOR=rgb(0, 0, 0)][SIZE=5][SIZE=5][COLOR=rgb(0, 0, 0)]    "minecraft:GOLD_BLOCK"
    : 10[/COLOR][/SIZE][/SIZE][/COLOR][/SIZE]
    [SIZE=4][COLOR=rgb(0, 0, 0)][SIZE=5][SIZE=5][COLOR=rgb(0, 0, 0)]    "myCustomItemID"
    : 1


    By default, the block will drop one of its own custom item. If you'd like more flexibility in determining what the block should drop, you could set the block's drops to nothing (just add the drops key, but set it to null "drops: null"), then, add a "setDrops" action in the handler for "blockBreak"!

    Under block, you can also add the subkey "generation". Under this, you can add a list of generation properties, formatted a lot like handlers:

    Code (YAML):
    block:[/SIZE][/COLOR]
    [COLOR=#000000][SIZE=5]  generation:[/SIZE][/COLOR][/SIZE][/COLOR]
    [COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=#000000][SIZE=5]    -[/SIZE][/COLOR][/SIZE][/COLOR]
    [COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=#000000][SIZE=5]      method: ore[/SIZE][/COLOR][/SIZE][/COLOR]
    [COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=#000000][SIZE=5]      worlds:[/SIZE][/COLOR][/SIZE][/COLOR]
    [COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=#000000][SIZE=5]        - world[/SIZE][/COLOR][/SIZE][/COLOR]
    [COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=#000000][SIZE=5]      continueChance: 0.4[/SIZE][/COLOR][/SIZE][/COLOR]
    [COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=#000000][SIZE=5]      generationChance: 1.0[/SIZE][/COLOR][/SIZE][/COLOR]
    [COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=#000000][SIZE=5]      amountPerChunk: 5[/SIZE][/COLOR][/SIZE][/COLOR]
    [COLOR=rgb(0, 0, 0)][SIZE=5][COLOR=#000000][SIZE=5]      minY: 20


    Valid Generation

    • method — string — The method of generating the blocks. Currently valid options are: "ore"
    • world(s) — string or string list — The worlds to enable generation in.
    • amountPerChunk — integer — The number of times to run this generation method per chunk
    • generationChance — decimal between 0.0 and 1.0 — The chance of the generation method to run (for example, 0.7 gives this generation method a 70% chance of running each time)
    • minY — integer— The minimum y-position to start generating blocks at
    • maxY — integer— The maximum y-position to start generating blocks at
    • continueChance — decimal between 0.0 and 1.0 only for the "ore" generation method — the chance of the ore generation continuing to generate more blocks in the vein
    Valid Generation

    • method — string — The method of generating the blocks. Currently valid options are: "ore"
    • world(s) — string or string list — The worlds to enable generation in.
    • amountPerChunk — integer — The number of times to run this generation method per chunk
    • generationChance — decimal between 0.0 and 1.0 — The chance of the generation method to run (for example, 0.7 gives this generation method a 70% chance of running each time)
    • minY — integer— The minimum y-position to start generating blocks at
    • maxY — integer— The maximum y-position to start generating blocks at
    • continueChance — decimal between 0.0 and 1.0 only for the "ore" generation method — the chance of the ore generation continuing to generate more blocks in the vein



    name
    string — REQUIRED
    The friendly name of the custom item
    canBeUsedGenerically
    boolean — OPTIONAL — default: false
    Whether or not this custom item can be used in place of its native Minecraft counterpart. For example, if the item you create below is cobblestone, and this were set to true, this custom item could be used in crafting recipes in place of cobblestone.
    It is recommended that you keep this false and do not set it.


    canBePlaced
    boolean — OPTIONAL — default: if canBeUsedGenerically is set, then the same as canBeUsedGenerically. If it is not set, then true
    If this custom item is a block, whether or not it can be placed. For example, if the item you create below is cobblestone, and this were set to false, players would not be able to build using your custom item


    item
    REQUIRED
    The actual Minecraft item that represents your custom item. Open the spoiler below to see how to configure this


    material
    string — REQUIRED
    The Minecraft material of the item. A list of materials is available here:
    https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html



    displayName
    string — REQUIRED
    The display name of the item. You can add color codes to this string with &


    lore
    string list — OPTIONAL
    A list of strings, each line corresponding to a line of lore on the item. You can add color codes to these strings with & as well, and by default, each line is displayed gray.


    enchantments
    map — OPTIONAL
    The enchantments that should be added to this item. For each enchantment you want to add, provide the enchantment name as a new key under the enchantments key, and set it to the level of the enchantment. This also works for enchantments from other plugins


    color
    string or map — OPTIONAL
    The color of the item if it is leather armor or a potion. You can either provide the color as a six-digit hexadecimal string like "00A7FF", or you can provide the keys "red", "green", and "blue" under "color", and give a number between 0 and 255 for each.

    info
    OPTIONAL
    Information about the custom item, displayed in the information GUI opened with /customitems list, /customitems info, and /customitems inspect. Open the spoiler below to see how to configure this


    description
    string — OPTIONAL
    A description of the item


    usage
    string — OPTIONAL
    How the item is used


    obtaining
    string — OPTIONAL
    How the item can be obtained


    crafting
    string — OPTIONAL
    This is automatically generated by the plugin. Only set this if you want to override the default GUI information about how to craft the item.


    relatedItems
    string list — OPTIONAL
    A list of custom or native Minecraft items related to this item, for use in the Information GUI, up to seven items. See "referencing items" above.

    Code (YAML):
    info:


    recipes
    OPTIONAL
    A list of custom recipes that can be used to craft this item. Open the spoiler below to see how to configure this


    recipes is a list of recipes, and each recipe contains the following information. Look at the code snippet below to see how to format this.


    shaped
    boolean — REQUIRED
    Whether or not the recipe is shaped


    resultAmount
    integer — OPTIONAL — default: 1
    The amount of the custom item that will result from this recipe


    shape
    string list — REQUIRED
    FOR SHAPED RECIPES ONLY (shaped: true)
    A list of strings representing the crafting grid.
    Each character in each string represents an item, which is defined in items below.


    Any character that is not referenced will be regarded as an empty slot
    (for example, if one line is "axa", and the character 'x' does not exist below, the middle slot will be empty).


    See the code snippet below for formatting information.

    items
    REQUIRED
    The items required for this recipe. Open the spoiler below to see how to configure this.


    items is a list of items, and each item contains the following information. Look at the code snippet below to see how to format this.

    item
    string — REQUIRED
    The item being used in the recipe. See "referencing items" above.


    amount
    integer — REQUIRED
    FOR SHAPELESS RECIPES ONLY (shaped: false)
    The amount of the above item



    key
    character — REQUIRED
    FOR SHAPED RECIPES ONLY (shaped: true)
    A character that references the item in the shape, created later

    The shaped recipe created in the above code snippet
    [​IMG]
    Code (YAML):
    # Pay close attention to the indentation
    recipes
    :
           # The start of a new recipe
            -
                # Remember to indent
                shaped
    : false
                resultAmount
    : 4
                items
    :
                     # The start of a new item
                      -
                          # Remember to indent
                          item
    : "minecraft:BLAZE_ROD"
                          amount
    : 5
                      # The start of a new item
                      -
                          item
    : "anotherCustomItem"
                          amount
    : 2
            # The start of a new recipe
            -
                shaped
    : true

                # If we look at items below, we see each 'a' references a gold ingot
                # and each 'b' references the custom item 'anotherCustomItem'.
                # 'x' does not belong to any item in the below list, so it will be
                # regarded as an empty slot. If we pretend 'anotherCustomItem' is
                # a stick, and this recipe creates a blaze rod,
                # this will create the below crafting recipe
                shape
    :
                   - "axa"
                    - "aba"
                    - "axa"
                items
    :
                     # The start of a new item
                      -
                          item
    : "minecraft:GOLD_INGOT"
                          key
    : 'a'
                      # The start of a new item
                      -
                          item
    : "anotherCustomItem"
                          key
    : 'b'

     



    handlers
    OPTIONAL
    A list of custom actions that are run when certain things happen with this item. Open the spoiler below to see how to configure this




    Handlers Quick Reference

    Valid Handlers

    • rightClickAir When a player right-clicks air with this item
    • rightClickBlock When a player right-clicks a block with this item
    • leftClickAir When a player hits air with this item
    • leftClickBlock When a player hits a block with this item
    • drop When a player drops this item
    • itemPickup When a player picks up this item
    • itemBreak When this item breaks after after used
    • itemDamage When this item is damaged by being used

    • hitMob When a player hits a mob with this item
    • hitPlayer When a player hits a player with this item
    • mine When a player mines a block with this item
    • projectileShoot When a player shoots this projectile
    • projectileHitMob When this projectile hits a mob
    • projectileHitPlayer When this projectile hits a player
    • projectileHitBlock When this projectile hits a block
    • consume When a player eats this item
    • bowShoot When this bow is shot

    • blockBreak When a player breaks this block
    • blockPlace When a player places this block
    • blockHit When a player hits this block
    • blockInteract When a player interacts with this block (right-clicks it)
    • blockStep When a player steps onto this block (called only when they switch to a new block)
    Valid if Statements

    • ifBlockType(s) — string or string list if the block type is (one of)
    • ifHasPermission — string if the player has the permission. Automatically prefixed with "customitems.action." For example, "useMyItem" will require the permission "customitems.action.useMyItem"
    • ifNotHasPermission — string if the player doesn't have the permission. Automatically prefixed like ifHasPermission
    • ifHasPermissionRaw — string — if the player has the permission, not prefixed
    • ifNotHasPermissionRaw — string — if the player doesn't have the permission, not prefixed

    • ifItem(s)InHand — string or string list — if the item in the player's hand is (one of)
    • ifItem(s)InOffHand — string or string list — if the item in the player's off hand is (one of)
    • ifPlayerHasItem(s) — string or string list — if the player has (one of these) this items in their inventory
    • ifTargetHasItem(s) — string or string list — if the target has (one of these) this items in their inventory
    • ifTargetType(s) — string or string list — if the target's entity type is (one of)
    • ifNotTargetType(s) — string or string list — if the target's entity type is not (one of)
    • ifSneaking — string or string list — if the player is sneaking
    • ifGamemode(s) — string or string list — if the player's Game Mode is (one of)
    • ifWorld(s) — string or string list — if the player's current world is (one of)
    • ifInRegion(s) — string or string list — if the player is currently in (one of) the World Guard Regions
    • ifNotInRegion(s) — string or string list — if the player is not currently in (one of) the World Guard Regions

    • ifStatementCombine — string — SPECIAL PARAMETER How the if statements should be combined. "AND" to make sure all conditions are satisfied, or "OR" to run as long as one or more of the conditions is satisfied, no matter whether or not the other conditions are satisfied. You can also use "XOR" to run the action only if exactly one statement is true if multiple are true, or none are true, the action will not run with "XOR". Default is "AND"
    • invertIfResult — boolean (default false) — SPECIAL PARAMETER — Inverts the result of your if statements. If your action would normally not run, and you set this to true, your action will run. If your action normally would run, and you set this to true, your action will not run.
    Valid Actions and their Parameters
    underlined parameters are required

    • sendMessage(s) Send message(s) to the player. message(s) — string(s), prefix — boolean (default true)
    • playerRunCommand(s) Force the player to run command(s). command(s) — string(s), overridePermisisons — boolean*** (default true)
    • consoleRunCommand(s) Force the console to run command(s). command(s) — string(s)
    • destroyItemUsed Destroy the item in the player's hand. amount — integer (default 1, use -1 to remove all items of the same type)
    • damageItemUsed Damage the item in the player's hand. amount — integer (default 1)
    • setBlockType Set the clicked block to type. type — string
    • givePlayerItem Give the player the specified item. type — string, amount — integer (default 1)
    • playerRemoveItem Remove the specified item from the player's inventory. type — string, amount — integer (default all items)
    • giveTargetItem Give the target the specified item. type — string, amount — integer (default 1)
    • targetRemoveItem Remove the specified item from the target's inventory. type — string, amount — integer (default all items)
    • cancel Cancel what just happened. (no parameters)
    • uncancel Uncancel what just happened. (no parameter)
    • addFood Adds food to the player. amount — integer
    • setFood Sets the food of the player. amount — integer
    • addSaturation Adds saturation to the player. amount — integer
    • setSaturation Sets the saturation of the player. amount — integer
    • addHealth Adds health to the player in half-hearts. amount — integer
    • setHealth Sets the health of the player in half-hearts. amount — integer
    • damagePlayer Damages the player in half-hearts. amount — integer
    • addFireTicks Adds to the number of ticks the player is on fire. ticks — integer
    • setFireTicks Sets the number of ticks the player is on fire. ticks — integer
    • extinguishPlayer Extinguishes the player (no parameters)
    • teleportPlayer Teleport the player. world — string, locationX — decimal, locationY — decimal, locationZ — decimal, function — string ("set" or "add" to the player's location. Default is "set"), bringToSurface — boolean (default false)
    • playerAddEffect(s) Add potion effects to the player. effect(s) — potion(s) see referencing potions above
    • playerRemoveEffect(s) Remove the potion effects from the player. effect(s) — string(s)
    • playerClearEffects Remove all potion effects from the player. (no parameters)
    • targetAddHealth Adds health to the target in half-hearts. amount — integer
    • targetSetHealth Sets the health of the target in half-hearts. amount — integer
    • damageTarget Damages the target in half-hearts. amount — integer
    • killTarget Kills the target. (no parameters)
    • despawnTarget Despawns the target. (no parameters)
    • targetAddFireTicks Adds to the number of ticks the target is on fire. ticks — integer
    • targetSetFireTicks Sets the number of ticks the target is on fire. ticks — integer
    • extinguishTarget Extinguishes the target (no parameters)
    • teleportTarget Teleport the target. world — string, locationX — decimal, locationY — decimal, locationZ — decimal, function — string ("set" or "add" to the target's location. Default is "set"), bringToSurface — boolean (default false)
    • targetAddEffect(s) Add potion effects to the target. effect(s) — potion(s) see referencing potions above
    • targetRemoveEffect(s) Remove the potion effects from the target. effect(s) — string(s)
    • targetClearEffects Remove all potion effects from the target. (no parameters)
    • none runs no action. (no parameter)
    • runActions Special action that runs more actions. actions — action list
    • runSkript(s) Special action that runs Skript code with the specified ID. actionID(s) — the id(s) of the actions to run in the Skript files
    Special Action Parameters
    Valid for every action

    • probability**** — decimal between 0.0 and 1.0 (default 1.0) — the probability that this action will run. For example, set this to 0.7 to have your action run 70% of the time, and not run the other 30% of the time.
    • tickDelay — number (default 0) — the number of ticks the to wait before running the action (there are 20 ticks in one second). For example, set this to 10 to make the action wait half a second before running
    • runInterval**** — number (default 1) — number of times to do nothing before running this action. For example, set this to 2 to make the action run every other time, and set it to 10 to make the action run every 10th time.
    Message and Command Placeholders
    In messages and commands, the following things are placeholders that are automatically replaced:


    {player} is replaced with the player's name

    {location.world}, {location.x}, {location.y}, {location.z} are respectively replaced with the world, x component, y component, and z component of the clicked block's location

    {player.location.world}, {player.location.x}, {player.location.y}, {player.location.z} are respectively replaced with the world, x component, y component, and z component of the player's location

    {target.location.world}, {target.location.x}, {target.location.y}, {target.location.z} are respectively replaced with the world, x component, y component, and z component of the target's location

    Notes
    ** skullOwner only works if the item is a player head
    *** if overridePermisisons is true, the player will run the command even if they don't have permission
    **** runInterval is evaluated AFTER probability. Also, the current interval resets on server restarts (for now)


    Short Handlers Example Usage
    Code (YAML):

    handlers
    :
      consume
    :
        actions
    :
         -
            action
    : addHealth
            amount
    : 10
          -
            action
    : sendMessages
            messages
    :
             - "Hey {player}"
              - "You're in the world {player.location.world}"
      rightClickBlock
    :
        actions
    :
          -
            action
    : destroyItemUsed
          -
            ifBlockType
    : "minecraft:DIAMOND_BLOCK"
            ifHasPermission
    : "cui.click"
            ifStatementCombine
    : "AND"
            probability
    : 0.8

            action
    : runActions
            actions
    :
             -
                action
    : setBlockType
                type
    : "minecraft:AIR"
              -
               action
    : givePlayerItem
               type
    : "minecraft:DIAMOND"
               amount
    : 27
             -
               action
    : runSkript
               actionID
    : "mySkriptAction"
     
    [/spoiler]​
    [/spoiler]
    Adding Custom Textures

    This is only possible for Minecraft versions 1.9 and above. If you're using Minecraft 1.14 or above, you can download some example files here

    To add a custom texture, set the textureID of the item in its item.yml to a number from 1 to 1560. This will be its texture ID.

    Code (YAML):
    item:
        textureID
    : 42
    You don't need to include a material or itemDamage for the item in the file

    Next, in your resource pack, make sure there's a folder under assets/minecraft/models/item. If there is not, create that folder.

    Next, download the correct ZIP file for your server's Minecraft version. If you're using Minecraft 1.14 or above, download this file: amazonaws.com/projects.store/spigot/CustomItemsModelFiles.zip

    If you're using Minecraft 1.13 or below, download this file: https://s3.amazonaws.com/projects.store/spigot/CustomItemsModelFiles_MC1.13_OR_BELOW_ONLY.zip

    and place the two things in it into the assets/minecraft/models/item folder of the resource pack. Do not modify these files at all.

    You should end up with something like this:

    [​IMG]

    Next, go to the assets/minecraft/textures/item folder of the resource pack. If this folder doesn't already exist, create it (it should exist for 1.13 and up, but may not exist for earlier versions — it's very important that its exactly assets/minecraft/textures/item)

    Next, in the assets/minecraft/textures/item folder, create a new folder called "custom". This is where you'll be adding all of your custom items.

    Now, every time you want to give an item a custom texture, set the texture ID in its .yml file to a unique ID, and then in the assets/minecraft/textures/item/custom folder, create a new png file called "texture<id>.png", corresponding to the ID.

    For example, if you created a custom item and set its texture ID to 42, its custom texture would be at assets/minecraft/textures/item/custom/texture42.png.

    This folder should now look something like this (for the custom item with the textureID 42):
    [​IMG]

    This texture would show up for a custom item with an item file like this:
    Code (YAML):
    name: "My Custom Textured Item"

    item
    :
     # This corresponds to texture42.png in the resource pack
      textureID
    : 42
      displayName
    : "My Custom Item"
    That's it! Distribute your custom resource pack, and all your players will start seeing your custom items with custom textures! It should be noted, however, that if they don't have your resource pack, they will see an elytra as the texture of the item (but it'll still function like a custom item).

    Adding Custom Textures

    You can set the custom texture of a block by setting "texture" under the "block" key of the item yml file:

    Code (Text):
    name: "Compressed Cobblestone"
    item:
      displayName: "&bCUI Golden Block"

    canBeUsedGenerically: false
    canBePlaced: true

    block:
      texture:
        textureID: 42
        color: "00aaff"
    If you're an advanced user and have a lot of knowledge on making resource packs, then this section is for you!

    Under the texture key, you can have all of the following:

    oldTextureFormat optional boolean (default false) — whether or not the old texture format should be used: This has no effect in versions under MC 1.14, but if used on Minecraft 1.14, this will make textureID act on the item's damage rather than it's NBT tag CustomModelData

    textureIDrequired number — the texture id of the item. In 1.14+, this is the item's CustomModelData tag. In versions below 1.14 (or if oldTextureFormat is set to true), this is the damage of the item

    material optional string (default "LEATHER_BOOTS") — the native Minecraft item that this texture should be applied to. You should only change this if you know what you're doing. Note that the material must be some type of leather armor in order for the "color" key below to work.

    color optional color (if not set, the result will be a brownish color) — the color applied to the texture, in hex format (see referencing colors in the item yml quick reference)

    In addition to all this, you can also specify up to three layers for the block texture, so that you can significantly reduce the size of your resource pack and use the same textures for different blocks (and change the colors of the textures using the "color" key):

    Code (YAML):
    block:
      texture
    :
        layer0
    :
          textureID
    : 13
          material
    : "minecraft:LEATH
          color: "
    444444"
        layer1:
          textureID: 31
          color: "
    00AAFF"
        layer2:
          textureID: 37
          color: "
    33AAFF"

    Using CustomItems with Skript
    To use CustomItems with Skript, use the action runSkript in your item.yml file, and provide the parameter actionID(s). This ID will be used to run your Skript code.

    Then, in your Skript file, just use on CustomItems handle, and then if the action id is "putYourActionIDHere".

    You can use %target% to get the target entity of the action, if there is one, and %targetplayer% to get the target player, if there is one.

    You can also use %player% to get the player, and %block% to get the block, if there is one.

    Additionally, you can check if an item is a custom item using Skript. Just use %item% is a custom item with the id "myCustomItemID" or %item% is not a custom item with the id "myCustomItemID". For example, you could run something only if the player's tool is a CustomItem with the id "myCustomItem"

    Code (YAML):
    # An example .yml file
    handlers
    :
      hitEntity
    :
        actions
    :
         -
            action
    : runSkript
            skriptIDs
    :
             - "myActionID"

    Code (YAML):
    # An example .sk file
    on CustomItems handle
    :
        if the action id is "myActionID"
    :
           # You can use %player%, %block%, %target%, and %targetPlayer%
            broadcast "%player% just hit %target%"

            # Only run if the player's tool is the custom item with the id "magicStick"
            if the player's tool is a CustomItem with the id "magicStick"
    :
               broadcast "%player% is holding a magicStick!"
  • Loading...
  • Loading...