Nexo
  • ๐Ÿ Home
  • ๐Ÿ“œMain Changelog
  • โ“FAQ
  • General Usage
    • โŒจ๏ธCommands
    • ๐Ÿง‘โ€๐ŸณRecipes
  • Migrate
    • โ˜„๏ธOraxen โ†’ Nexo
    • ๐Ÿ“ฆItemsAdder โ†’ Nexo
  • Configuration
    • โš™๏ธPlugin settings
    • ResourcePack
    • โš’๏ธItems
      • Special Item Appearance
    • โ›‘๏ธCustom Armors
      • ๐ŸชฝCustom Elytras (1.21.2+)
      • Component Based (1.21.2+)
      • Trims Based (1.20-1.21.1)
    • ๐ŸŒ€Glyphs
    • ๐ŸŽตSounds
  • Mechanics
    • ๐Ÿช‘Furniture Mechanic
      • ๐ŸŽฏHitbox
      • ๐Ÿ–‡๏ธConnectable Furniture
      • ๐Ÿช‘Seat Mechanic
      • ๐Ÿ›๏ธBed Mechanic
      • ๐Ÿ’กLight Mechanic
      • ๐Ÿง‘โ€๐ŸŒพFarming Mechanic
    • ๐Ÿ“ฆCustom Block Mechanics
      • ChorusBlock Mechanic
      • ๐ŸŽถNoteBlock Mechanic
        • Stripped Log Mechanic
        • Directional Mechanic
      • ๐ŸงตStringBlock Mechanic
    • ๐Ÿ”ฑCustom Trident
    • Other Mechanics
    • clickAction Mechanic
    • Custom Mechanic
  • โž•Addons
    • ๐ŸšชCarpentry
    • ๐ŸงฉCore Shaders
      • Text Effects by Akis
  • Compatibility
    • ModelEngine - custom mobs
    • MythicMobs - custom mobs
    • MythicCrucible
    • MMoItems
    • EcoItems
  • Community Guides
    • Vendors
    • API
Powered by GitBook
On this page
  • Repository & Dependencies
  • Add Nexo-support to your plugin
  • Repository & Dependency Info
  • Examples of use
  • NexoItems class:
  • Custom Blocks & Furniture
  • Mechanics:
  • Custom PackServer
  1. Community Guides

API

Repository & Dependencies

repositories {
    maven("https://repo.nexomc.com/releases")
}

dependencies {
    compileOnly("com.nexomc:nexo:1.1.0")
}

Add Nexo-support to your plugin

Repository & Dependency Info

You can find the repository and dependency notice here.

All methods and better explanations of their functionality and parameters can be found in the actual Classes. Simply open them in your IDE to get a full list of them.

Examples of use

Nexo is built around an ItemBuilder class that allows you to create items easily. When the plugin starts it parses the configurations to generate builders for each type of items. Each builder can be used to generate itemstacks.

NexoItems class:

Get an ItemBuilder from a Nexo-ItemID

NexoItems.itemFromId(itemID);

Get the Nexo-ItemID from an ItemStack

You can use to check if an ItemStack is an NexoItem (it will return null if the Nexo-ItemID doesn't exist)

NexoItems.idFromItem(itemstack);

Custom Blocks & Furniture

Place a NexoBlock

Place a NexoBlock at a given location

NexoBlocks.place(itemID, location)

Place an NexoFurniture at a given location, optionally setting a player for rotation purposes

NexoFurniture.place(itemID, location, @Nullable player)

Mechanics:

Custom PackServer

If you want a PackServer type that Nexo does not provide, you can make an addon that registers one. Make a class that extends NexoPackServer and override the methods you need. To register this with Nexo, you simply call PackServerRegistry.register(type, packServer)

class MyPackServer : NexoPackServer {
    override fun uploadPack(): CompletableFuture<Void>
    override fun sendPack(player: Player)
    override fun start()
    override fun stop()
    override fun packUrl()
    override fun packInfo(): ResourcePackInfo?
}
PreviousVendors

Last updated 27 days ago

Nexo allows you to add your own mechanics to the plugin, new ones or extending existing ones An example repository can be found , with examples for both Java and Kotlin You can register your mechanic in your onEnable or wherever you want. This will register it when Nexo registers its own Mechanics, and parse them for items Mechanics consist of a Mechanic class with properties and methods. MechanicFactory consists of parsing method for global Mechanic properties & linking item -> mechanic NexoMechanicsRegisteredEvent - Called when Nexo loads/reloads Mechanics NexoItemsLoadedEvent - Called when Nexo finishes loading/reloading NexoItems

here
Page cover image