Ssomar Plugins
🛒 Purchase📢 Discord❤️ Donate
  • Tools for all Plugins [Score]
    • 📚Custom Commands
      • Player & Target Commands
      • Mixed Commands (Player & Entity)
      • Entity Commands
      • Block Commands
      • Item Commands
      • Utility Commands
    • 📚Custom Conditions
      • Player & Target Conditions
      • Entity Conditions
      • Block Conditions
      • World Conditions
      • Item Conditions
      • Placeholder Conditions
      • Custom EI Conditions
    • 🏹Custom Projectiles
    • 📚Placeholders
    • ✨ Score particles
    • 🧮 Score Variables
    • ✔️Compatible Plugins
    • 🤖General Questions | Guides
      • Technical-Level Info
      • SCore
      • Math Formulas
      • Utilities
        • Code Bin/Stock
    • 📰 Score
      • General config
      • Commands
    • 🔘 Custom triggers
  • ExecutableItems
    • 📌Information EI
    • 📃Configurations
      • General Configuration
      • Item Configuration
        • Item Features
        • Item Restrictions/Resistances
      • Activator Configuration
        • List of the Activators
        • Activators features
    • ⌨️Commands & Permissions
    • 🤖Questions | Guides
      • Frequently Asked Questions
        • Free vs Premium
        • Install/update/errors
          • How to install correctly
          • How to update correctly
          • Installation errors [logs]
          • Plugin doesn't work 😡😡
          • command /ei doesn't work
          • Just installed the plugin and have errors on my logs
        • Players can't use the items
        • Basic tutorials
        • Item disappears | Limit
        • EI COMMANDS doesn't work
        • How to use vanilla commands
        • Server chat spamming
        • Custom crafting
        • Folders on /ei show
        • Item as player head
        • Armor trims
        • Attributes not working
        • How to duplicate an EI Item
        • How to change particle vanilla command color
        • Edit plugin messages
        • Item Textures
        • I want to give an item on join
        • Issue with written book
        • How to add custom NBTTag
        • HEX COLORS doesn't work
        • HUGE delay | cooldown | command time
        • Trident duplication
        • Custom name feature is not working
        • Score database large
        • PROJECTILE_HIT_... activators not working
        • Not so frequentlly asked questions
      • Items explanations
        • Item ideas - How to create...?
        • Hight-Powered Grappling Hook
        • Morph Tools
        • Delayed Teleport Towards Saved Location
        • Box of ender pearls
        • Swap position
        • Magnet
        • Item frame visibility toggler
        • Hermes boots
        • EI |WorldEdit -> SET COMMAND
        • Bag of items
        • Infinite rockets
        • Trident that works when not raining
        • [Complex] Moving Particle Projectile
      • Methods | Template
        • Multiple projectiles on one item
        • Custom drops
        • Deal % of entity HP
        • Variable conditions
        • Armor Set Bonus
        • Custom durability
          • Custom durability bar
        • Action Counter
        • On / Off Switch
        • Custom food
        • Raycast
        • Random activators selector
        • Break blocks not depending on item
        • Infinite | finite blocks
        • Damage | Hit features
        • Backstab
        • Item date on lore
        • Entity health condition
        • Dashes | Commands & usage
        • Guns
        • RNG Chance activator
        • Only usable on mainhand
        • Transform Vanilla Items into ExecutableItems
        • Insta pickup
        • Epic particles
        • Custom totems
        • One Time Loop
        • OneTime action
        • MINEINCUBE command whitelist or blacklist blocks
        • Cancel a delayed command
        • Worldedit schematic
        • Condition 1 between 5 different armor pieces
        • Creating Items with multiple activators with varying conditions while having only one error message
        • [Free version] Mana Requirement
        • Setting Up a System that runs the auto update feature once per update
        • [Outdated] Global Cooldown
      • Custom projectiles implementation
        • Projectile ideas - How to create...?
        • Creating a basic projectile
        • Launch Arrows in cone
        • Launch Diamond Axe
        • Custom Actions / Damages per projectiles
      • Custom textures
        • Custom textures [1.21 --]
          • General items
          • Per states texture
          • Custom armor (using armor trims)
          • Animated textures
          • 3D Models
          • Uploading texture pack
          • Fixing Invalid PNG Files
        • Custom texture [1.21+]
      • Custom sounds
      • Informal Guides
      • Plugin performances optimization
    • 🔦MC Versions Compatibility
    • ⚙️Developer API
  • ExecutableBlocks
    • 📌Information EB
    • 📃Configurations
      • General Configuration
      • Block Configuration
        • Block Features
        • Blocks Examples
      • Activator Configuration
        • List of the Activators
        • Activators features
        • Activator Examples
    • ⌨️Commands & Permissions
    • 🤖Question | Guides
      • Frequently Asked Questions
        • Free vs Premium
        • Install/update/errors
          • How to install correctly
          • How to update correctly
          • Installation errors [logs]
          • Plugin doesn't work 😡😡
        • Players can't use the blocks
        • Block disappears | Limit
        • How to use vanilla commands
        • Server chat spamming
        • Custom crafting
        • Block as player head
        • Tutorial
        • Block states
        • Block Textures
        • My condition is checking the owner
        • SETEXECUTABLEBLOCK does not work
        • Holograms won't vanish
      • Tutorials
        • Boss summoner
        • Item generator
        • Custom crops
        • Custom TNT
        • Block that generate a structure
      • Methods
        • Timed actions
        • Worldedit schematic
    • ⚙️Developer API
  • ExecutableEvents
    • 📌Information EE
    • 📃Configurations
      • General Configuration
      • Activator Configuration
        • List of the Activators
        • Activators features
    • 🤖Question | Guides
      • Informal Guides
      • Frequently Asked Questions
        • Install/update/errors
          • How to install correctly
          • How to update correctly
          • Installation errors [logs]
          • Plugin doesn't work 😡😡
        • How to use vanilla commands
        • Server chat spamming
      • Tutorials
        • Toggle System/Command with Godmode
        • Custom enchants by lore
        • Give new/old players an item once
        • Run commands after killing x amount of mobs
        • Detect player entry/leave from a worldguard region
    • ⌨️Commands & Permissions
  • MyFurniture
    • 📌Information MF
    • 📃Configurations
      • General Configuration
      • Furniture Configuration
        • Furniture Features
        • Furntiture Examples
      • Activator Configuration
        • List of the Activators
        • Activators features
    • 🤖Question | Guides
      • Frequently Asked Questions
        • Install/update/errors
          • How to install correctly
          • How to update correctly
          • Installation errors [logs]
          • Plugin doesn't work 😡😡
        • Import your own Furniture
        • How to use vanilla commands
        • Server chat spamming
        • Free vs Premium
    • ⌨️Commands & Permissions
  • ExecutableCrafting
    • 📌Information EC
    • 📃Configurations
      • General Configuration
      • Recipe Configuration
        • Recipe Features
        • Crafting Recipe Examples
      • Recipe groups
      • Recipe Book
    • 🤖Questions | Guides
      • Free vs Premium
      • Install/update/errors
        • How to install correctly
        • How to update correctly
    • ⌨️Commands & Permissions
  • AI Chat Moderation
    • 📌Information ACM
    • 📃Configurations
    • ⌨️Commands & Permissions
  • CustomPiglinsTrades
    • 📌Information CPT
    • ⌨️Commands & Permissions
    • ✔️Compatible Plugins
  • ScreenShop
    • 📌Information ScreenShop
  • TEAM AND DONATIONS
    • 🎆Contact / Support us ?
Powered by GitBook
On this page
  • Add the dependency
  • Manual dependency
  • Maven dependency
  • Gradle dependency
  • API Documentation
  • ExecutableItemsAPI class path
  • Check if ExecutableItems is present and loaded on the server
  • Methods
  • Example
  • Event to call when you add an ExecutableItem in a player inventory
  • Questions ? Need another method ?
Edit on GitHub
  1. ExecutableItems

Developer API

PreviousMC Versions CompatibilityNextInformation EB

Last updated 1 month ago

Add the dependency

Manual dependency

To use the API, you need download the jar , it's my lib plugin where all the API are packaged

Maven dependency

Place the SCore jar in your resources project

and in maven add:

<dependency>
    <groupId>com.ssomar.score</groupId>
    <artifactId>SCore</artifactId>
    <version>4.24.1.15</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/SCore.jar</systemPath>
</dependency>

Gradle dependency

compileOnly files('src/main/resources/Score.jar')

Configure correctly your plugin.yml

softdepend: [ExecutableItems, SCore]

API Documentation

ExecutableItemsAPI class path

com.ssomar.score.api.executableitems.ExecutableItemsAPI

Check if ExecutableItems is present and loaded on the server

You can check if the server has ExecutableItems installed and enabled by using

public static boolean hasExecutableItems = false;
Plugin executableItems;
if(executableItems = Bukkit.getPluginManager().getPlugin("ExecutableItems") != null && executableItems.isEnabled()) {
    SCore.plugin.getServer().getLogger().info("["+NAME+"] ExecutableItems hooked !");
    hasExecutableItems = true;
}

Methods

public class ExecutableItemsAPI {

    /** Get the ExecutableItems Manager **/
    public static ExecutableItemsManagerInterface getExecutableItemsManager() {
        return ExecutableItemsManager.getInstance();
    }

}

The static method to have access to the manager of the ExecutableItems.

public interface ExecutableItemsManagerInterface {

    /** Verify if id is a valid ExecutableItem ID
     * @param id The ID to verify
     * @return true if it is a valid ID, false otherwise
     * **/
    boolean isValidID(String id);

    /** Get an ExecutableItem from its ID
     * @param id The ID of the ExecutableItem
     * @return The ExecutableItem or an empty optional
     * **/
    Optional<ExecutableItemInterface> getExecutableItem(String id);

    /** Get an ExecutableItem from its itemStack form
     * @param itemStack The itemStack to get the ExecutableItem from
     * @return The ExecutableItem or an empty optional
     * **/
    Optional<ExecutableItemInterface> getExecutableItem(ItemStack itemStack);

    /** Get all ExecutableItems Ids
     * @return All ExecutableItems ids
     * **/
    List<String> getExecutableItemIdsList();
}

The methods of the manager.

public interface ExecutableItemInterface extends SObject {

    /** To place at the end of your itemBuilder , it adds infos for item to be recognized as an ExecutableItem
     * It will take the lore / name of the ExecutableItems and Override yours (But it doesn't override the customModeldata tag)
     * @param item The item to add the ExecutableItem infos to
     * @param creator The optional creator of the ExecutableItem
     * */
    ItemStack addExecutableItemInfos(ItemStack item, Optional<Player> creator);

    /**
     * @param player The player to whom you want to check the possession of the permission
     * @param showError true if you want to show an error message to the player if he doesn't have the permission
     * @return The name of the ExecutableItem */
    boolean hasItemPerm(@NotNull Player player,  boolean showError);



    /**
     * Build the ExecutableItem
     * @param amount The amount of the ExecutableItem
     * @param usage The optional custom usage of the ExecutableItem, otherwise it will use the default one
     * @param creator The optional creator of the ExecutableItem
     * @return The ExecutableItem
     */
     ItemStack buildItem(int amount, Optional<Integer> usage, Optional<Player> creator);
}

The methods of the ExecutableItem

Example

/** Exemple you decide to support ExecutableItems in your shop plugin **/

public void giveExecutableItem(Player player, String executableItemId, int amount){
    ItemStack item = null;
    Optional<ExecutableItemInterface> eiOpt = ExecutableItemsAPI.getExecutableItemsManager().getExecutableItem(executableItemId);
    if(eiOpt.isPresent()) item = eiOpt.get().buildItem(amount, Optional.empty(), Optional.of(player));
    if(item != null)
        player.getInventory().addItem(item);
    /* else
         Your error message here */
}

Event to call when you add an ExecutableItem in a player inventory

Since SCore 3.4.7, Please when you add an ExecutableItem in a player inventory call the following event:

AddItemInPlayerInventoryEvent eventToCall = new AddItemInPlayerInventoryEvent(player, itemStack, firstEmptySlot);
Bukkit.getPluginManager().callEvent(eventToCall);

This event is particulary usefull for one of my custom activator/trigger: EI ENTER IN PLAYER INVENTORY.

Questions ? Need another method ?

⚙️
SCore
Join the Ssomar Plugins Discord Server!Discord
Logo