Oraxen
Search…
API
How to integrate your plugin with Oraxen

Add Oraxen to your plugin

In order to use Oraxen API, you need to add the jarfile to your classpath. You can use the jarfile downloaded on spigot or build it yourself from sources. You can also use github packages or jitpack.

Jitpack

With Maven

Repository (jitpack)

1
<repositories>
2
<repository>
3
<id>jitpack.io</id>
4
<url>https://jitpack.io</url>
5
</repository>
6
</repositories>
Copied!

Dependency

1
<dependency>
2
<groupId>com.github.Th0rgal</groupId>
3
<artifactId>Oraxen</artifactId>
4
<version>-SNAPSHOT</version>
5
</dependency>
Copied!

With Gradle

Repository (jitpack)

1
allprojects {
2
repositories {
3
...
4
maven { url 'https://jitpack.io' }
5
}
6
}
Copied!

Dependency

1
dependencies {
2
compileOnly 'com.github.Th0rgal:Oraxen:-SNAPSHOT'
3
}
Copied!

Examples of use

Oraxen is built around an ItemsBuilder 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.

OraxenItems class:

Get an ItemBuilder from an OraxenID

1
OraxenItems.getItemById(itemID); // where itemID is a section in items configurations
Copied!

Check if an OraxenID exists

1
OraxenItems.isAnItem(itemID);
Copied!

Extract an OraxenID from an ItemStack

You can use to check if an ItemStack is an OraxenItem (it will return null if OraxenID doesn't exist)
1
OraxenItems.getIdByItem(itemstack);
Copied!

Place custom block BlockMechanicFactory

Set an OraxenBlock

You can set the model of a block by providing a block and the itemID of an item that implements the Block mechanic.
1
BlockMechanicFactory.setBlockModel(block, itemID);
Copied!

Add resources to the pack

Get access to the assets/ folder

1
ResourcePack.getAssetsFolder();
Copied!

Mechanics:

Oraxen allows you to add your own mechanics to the plugin, it is a little bit more complex than the rest, that's why there is a dedicated tutorial.
Last modified 2mo ago