Skip to content

Spookly-Core-API is a comprehensive Minecraft API for managing players, teams, game phases, events, and database interactions.

License

Notifications You must be signed in to change notification settings

Spookly-Network/Spookly-Core

Repository files navigation

Spookly Core API

License Maven metadata URL Discord

SpooklyCoreAPI is a comprehensive API for managing various aspects of the Spookly system, including players, teams, game phases, events, and more. This API provides interfaces and their implementations for creating and managing complex game systems in a Minecraft environment.

Features

  • Player management (online and offline)
  • Team management and display customization
  • Game phase management
  • Placeholder handling
  • Event handling and subscription
  • Database connection and operations

Installation

To use SpooklyCoreAPI in your project, add the following repository and dependency to your pom.xml:

<repositories>
  <repository>
    <id>spookly-repository</id>
    <name>Spookly Repository</name>
    <url>https://mvn.spookly.net/(releases|snapshots)</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>de.spookly</groupId>
    <artifactId>SpooklyCoreAPI</artifactId>
    <version>1.1.0-SNAPSHOT</version>
  </dependency>
</dependencies>

Usage

The API provides various interfaces to interact with different components of the Spookly system. Here are some examples of how to use the API:

Player Management

SpooklyServer server = Spookly.getServer();
UUID playerUUID = // player's UUID

server.getOfflinePlayer(playerUUID, offlinePlayer -> {
    // Perform operations with the offline player
});

SpooklyPlayer player = server.getPlayer(playerUUID);
// Perform operations with the online player

Team Management

TeamManager teamManager = server.getTeamManager();
Team team = teamManager.team(playerUUID);

if (team != null) {
    team.registerPlayer(player);
}

Event Handling

EventExecuter eventExecuter = server.getEventExecuter();

eventExecuter.register(SomeEvent.class, event -> {
    // Handle the event
});

Placeholder

// Adding a placeholder 
Placeholder placeholder = new Placeholder("<3", context -> {
    Player player = context.getPlayer();
    return Component.text("❤ ")
            .color(NamedTextColor.RED)
            .append(player.displayName());
}, PlaceholderContext.PlaceholderType.CHAT);
server.getPlaceholderManager().registerPlaceholder(placeholder);

// Resolving placeholders
Component shouldResolveIn = Component.text("<3");
PlaceholderContext context = new PlaceholderContext(source, PlaceholderContext.PlaceholderType.CHAT);
server.getPlaceholderManager().replacePlaceholder(shouldResolveIn, context);

Contributing

We welcome contributions to SpooklyCoreAPI! Here's how you can contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix (git checkout -b feature-name).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push your changes to your fork (git push origin feature-name).
  5. Create a pull request with a description of your changes.

Code Style

Please follow the existing code style and conventions when contributing. Ensure your code is properly documented with Javadoc comments.

Reporting Issues

If you encounter any issues or bugs, please report them on the GitHub issues page. Provide as much detail as possible, including steps to reproduce the issue and any relevant code snippets.

License

SpooklyCoreAPI is licensed under the MIT License. See the LICENSE file for more information.

Made with ❤️ by the Spookly Network team.

About

Spookly-Core-API is a comprehensive Minecraft API for managing players, teams, game phases, events, and database interactions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages