🐝ZelTrade API

API Source: https://github.com/Emibergo02/ZelTrade-apiarrow-up-right

Maven Dependency

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.Emibergo02</groupId>
        <artifactId>ZelTrade-api</artifactId>
        <version>main-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    compileOnly 'com.github.Emibergo02:ZelTrade-api:main-SNAPSHOT'
}

Getting Started

Accessing the API

Core Concepts

Trade Lifecycle

A trade in ZelTrade follows this lifecycle:

  1. Invitation - One player invites another to trade

  2. Opening - Both players accept and the trade window opens

  3. Negotiation - Players add items and set prices

  4. Confirmation - Both players confirm the trade

  5. Completion - Items and currency are exchanged

  6. Retrieval - Players collect their items

  7. Archival - Trade is saved to history

Usage Examples

1. Opening a Trade Between Two Players

2. Querying Player Trades

3. Finding Specific Trades

4. Listening to Trade Events

5. Managing Trade Prices

6. Checking Trade Status

7. Accessing Archived Trades

8. Opening Archived Trades GUI

9. Managing Player Ignore List

10. Getting Player Ratings

11. Creating Custom Currency Hooks

12. Filtering Trades with Custom Predicates

13. Rating a Trade

API Components

Managers

  • ITradeManager - Core trade operations and queries

  • ISessionManager - Window and session management

  • IInviteManager - Trade invitation system

  • IIgnoreManager - Player ignore list management

  • IPlayerListManager - Player name/UUID mapping

  • IIntegrationManager - External plugin integrations

Data Access

  • IStorageData - Persistent storage operations (database)

  • ICacheData - In-memory cache operations

  • DataKeys - Constants for data access

Events

  • TradeInviteEvent - Fired when a player sends a trade invite

  • TradeOpenEvent - Fired when a trade window is opened (cancellable)

Enums

  • Actor - Trade participant role (TRADER, CUSTOMER, VIEWER)

  • Status - Trade status (EDITING, CONFIRMED, COMPLETED, etc.)

  • TradeViewType - Current view type (TRADE, MONEY_EDITOR, etc.)

  • UpdateType - Type of trade update

  • KnownRestriction - Built-in restriction types

Last updated