Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Phoenixdevt Fr Mmoitems
https://docs.phoenixdevt.fr/mmoitems
Admin
Documentation repository created by Site2MD.
Tokens:
2,975
Snippets:
37
Trust Score:
6.9
Update:
4 months ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### MythicEnchants Support Implementation Source: https://docs.phoenixdevt.fr/mmoitems/compatibility/enchant-plugins Example implementation of the EnchantPlugin interface for the MythicEnchants plugin. It handles custom enchantments and adds them to the item lore. ```java public class MythicEnchantsSupport implements EnchantPlugin<MythicEnchant> { @Override public boolean isCustomEnchant(Enchantment enchant) { return enchant instanceof MythicEnchant; } @Override public NamespacedKey getNamespacedKey(String key) { return new NamespacedKey(MythicEnchants.inst(), key); } public void handleEnchant(ItemStackBuilder builder, MythicEnchant enchant, int level) { Validate.isTrue(level > 0, "Level must be strictly positive"); // Type cannot be changed. Must make sure that item is an enchanted book if (!builder.getMeta().hasItemFlag(ItemFlag.HIDE_ENCHANTS)) builder.getLore().insert(0, LoreParser.formatEnchantment(enchant, level)); } } ``` -------------------------------- ### Example Crafting Station with Recipe Source: https://docs.phoenixdevt.fr/mmoitems/stations/intro A sample configuration for a crafting station, including its name, queue size, sound effect, and a specific recipe with crafting time, conditions, and ingredients. ```yaml name: 'Steel Crafting Station (#page#/#max#)' max-queue-size: 10 sound: ENTITY_EXPERIENCE_ORB_PICKUP recipes: two-handed-steel-sword: output: 'mmoitem{type=GREATSWORD,id=TWO_HANDED_STEEL_SWORD}' crafting-time: 10 conditions: - 'level{level=8}' ingredients: - 'mmoitem{type=MATERIAL,id=STEEL_INGOT,amount=8}' - 'vanilla{type=STICK,amount=4}' ``` -------------------------------- ### Basic Item Configuration Source: https://docs.phoenixdevt.fr/mmoitems/items/creation This is a starting snippet for manually configuring a new item in the MMOItems configuration files. It defines the item's ID and its base material. ```yaml YOUR_ITEM_ID: base: material: YOUR_ITEM_MATERIAL ``` -------------------------------- ### Define Custom Crafting Station Open Command Source: https://docs.phoenixdevt.fr/mmoitems/stations/intro Configure a custom command for players to open a specific crafting station UI. Note the server restart requirement for command changes. ```yaml command: name: 'arcaneforge' # The command itself description: 'Open the arcane forge' # Command description usage: '/arcaneforge' # Command usage permission: 'mmoitems.arcane_forge' # Permission needed to use the command aliases: [ af, mmoitems_af ] # Command aliases message: no-perm: '&cYou don''t have enough permissions.' # Message shown when missing permission not-a-player: '&cThis command is for players only.' # Message shown when sender is not a player ``` -------------------------------- ### Basic Crafting Station Configuration Options Source: https://docs.phoenixdevt.fr/mmoitems/stations/intro Defines essential parameters for a crafting station, including its display name and the maximum number of items allowed in the crafting queue. ```yaml name: 'Arcane Forge' # General name max-queue-size: 10 recipes: ... # Recipes available at that crafting station gui-layout: ... # GUI general layout confirm-gui-layout: ... # General layout for the right-click "preview" GUI ``` -------------------------------- ### Open Crafting Station Admin Command Source: https://docs.phoenixdevt.fr/mmoitems/stations/intro Use this admin command to open a specific crafting station GUI for a player. It's recommended to bind this to an NPC or block for player interaction. ```bash /mi stations open <station-id> <player> ``` -------------------------------- ### List Available Item Types Source: https://docs.phoenixdevt.fr/mmoitems/items/creation Use this command to view all the item types that can be created within MMOItems, such as Sword, Axe, or Tool. ```minecraft-commands /mi list type ``` -------------------------------- ### Give Item Command Source: https://docs.phoenixdevt.fr/mmoitems/items/creation Obtain an item that has been added to the configuration files by using this command, specifying the item's type and ID. ```minecraft-commands /mi give <ITEM_TYPE> <YOUR_ITEM_ID> ``` -------------------------------- ### Reload MMOItems Configuration Source: https://docs.phoenixdevt.fr/mmoitems/items/creation After making changes to the configuration files, use this command to reload MMOItems and apply the modifications in-game. ```minecraft-commands /mi reload ``` -------------------------------- ### Create Item Command Source: https://docs.phoenixdevt.fr/mmoitems/items/creation Use this command to create a new item in-game, specifying its type and a unique ID. The item ID is crucial for all subsequent commands and configuration files. ```minecraft-commands /mi create <ITEM_TYPE> <YOUR_ITEM_ID> ``` -------------------------------- ### Register Enchant Plugin Source: https://docs.phoenixdevt.fr/mmoitems/compatibility/enchant-plugins Register your custom enchant plugin implementation with MMOItems. This must be done before MMOItems enables. ```java MMOItems.plugin.registerEnchantPlugin(...); ``` -------------------------------- ### EnchantPlugin Interface Source: https://docs.phoenixdevt.fr/mmoitems/compatibility/enchant-plugins Interface for supporting plugins that use the Bukkit Enchantment interface for registering enchantments. This simplifies enchant storage for MMOItems. ```java /** * There are three types of enchant plugins. * - enchants saved using the Bukkit Enchantment interface (EcoEnchants, MythicEnchants) * - enchants saved in the NBT (AdvancedEnchants) * - enchants saved in lore only (CrazyEnchants) * <p> * Interface used to support plugins which use the Bukkit Enchantment * interface to register their enchantments. This makes enchant storage * so much easier for MMOItems. * * @param <T> The plugin class implementing Enchantment */ public interface EnchantPlugin<T extends Enchantment> { /** * @param enchant Enchant being checked * @return If this enchant plugin handles a given enchant */ boolean isCustomEnchant(Enchantment enchant); /** * Called when an item is built. This should be used to add the enchantment * lines to the item lore or add any item tag required by the enchantment. * * @param builder Item being built * @param enchant Enchantment being applied * @param level Enchant level */ void handleEnchant(ItemStackBuilder builder, T enchant, int level); NamespacedKey getNamespacedKey(String key); } ``` -------------------------------- ### Cast MythicMobs Skill on Attack Source: https://docs.phoenixdevt.fr/mmoitems/features/types Casts a MythicMobs script named 'FireBolt' when attacking an entity. This action is not subject to weapon usage constraints. ```yml on-attack: mythicmobs-skill-id: FireBolt extra-skills: FireBolt: Skills: - 'projectile{onTick=FireBolt-Tick;onHit=FireBolt-Hit;v=8;i=1;hR=1;vR=1;hnp=true} @targetLocation' FireBolt-Tick: Skills: - 'effect:particles{p=flame;amount=20;speed=0;hS=0.2;vS=0.2} @origin' FireBolt-Hit: Skills: - 'damage{a=10}' ``` -------------------------------- ### Register Item Stat Source: https://docs.phoenixdevt.fr/mmoitems/compatibility/enchant-plugins Register a new item stat for plugins that do not use the Bukkit enchant registry, such as AdvancedEnchants. This is required before MMOItems enables. ```java MMOItems.plugin.getStats().register(...); ``` -------------------------------- ### Cast Builtin Skill on Right Click Source: https://docs.phoenixdevt.fr/mmoitems/features/types Casts the 'FIREBOLT' skill when an item is right-clicked. This action is subject to weapon usage constraints. ```yml on-right-click: FIREBOLT ``` -------------------------------- ### Edit Item Command Source: https://docs.phoenixdevt.fr/mmoitems/items/creation Access the item edition menu to modify an existing item's stats and properties. This command is used if the edition menu was previously closed. ```minecraft-commands /mi edit <ITEM_TYPE> <YOUR_ITEM_ID> ```