Streaker | Customisable Kill-Streak Plugin icon

Streaker | Customisable Kill-Streak Plugin -----

A Kill-Streak plugin with extensive configuration and API



It's in the tag-line -- Streaker is a configurable plugin for tracking kill-streaks!

Usage
The plugin consists of a configuration file and a few commands.

Player Commands:
/streak [player] - Get someone's (or your own) streak
Perm: streaker.cmd.streak

Administrator / Operator Commands:
/setstreak - Set someone's streak
Perm: streaker.cmd.setstreak
/streaktoggle - Enable or disable streaks
Perm: streaker.cmd.streaktoggle
/streakerreload - Reloads Streaker
Perm: streaker.cmd.streakerreload

Configuration
Code (YAML):
streak-commands:
    -
: # when the streak ends (when a player dies)
        - title %player% title "Your streak of %streak% ended :("
        - scoreboard players set %player% streak 0
    /1
: # when streak is divisible by 1, this runs every time the streak increases
        - title %player% title " "
        - title %player% subtitle "New streak - %streak%"
        - scoreboard objectives add streak dummy KillStreak
        - scoreboard objectives setdisplay list streak
        - scoreboard players set %player% streak %streak%
    /5
: # when streak is divisible by 5
        - title %player% title "You're on a roll!"
    10
: # when streak is exactly 10
        - title %player% title "Ten kills!"

log-commands
: false # Log commands
 
In the streak-commands section, you can set commands to execute when the player's streak either increases or resets.

There are three types of streak commands:

1. Reset Commands
The section for these commands is marked with the sign -
These commands execute whenever the player's streak is lost​
Code (YAML):
streak-commands:
   -
:
     - title %player% title " "
      - title %player% subtitle "Your streak of %streak% has ended"

2. Exact Amount Commands
Exact amount commands execute when a player has reached an exact kill-streak.
These commands need to be marked with the number of kills necessary to activate them​
Code (YAML):
streak-commands:
   1
:
     title %player% title "First kill!"
   2
:
     title %player% title "Second kill!"
   10
:
     title %player% title "Tenth kill!"
3. Modulus Commands
Modulus commands execute when a player's kill-streak has increased by a specific amount. Essentially, they will execute every n kills (for /5, they'll execute every 5 kills, and so on)
These commands need to be marked with /n, where n is the increase of kills necessary to activate them. For example, /1 will execute the commands every time the player kills another player
Code (YAML):
streak-commands:
   /1
:
     title %player% title "New Streak!"
      title %player% subtitle "Streak: %streak%"
   /5
:
     title %player% title "On Fire!"
   /15
:
     title %player% title "Insane!"

Streaker's API is exposed through jitpack.io

Maven
Add jitpack's repository.
HTML:
    <repositories>

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

Add Streaker's API as a dependency

HTML:
    <dependency>
        <groupId>me.erdi </groupId>
        <artifactId>streaker-api </artifactId>
        <version>1.0.0 </version>
    </dependency>

Gradle
Add jitpack's repository
Code (Text):
    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

Add Streaker's API as a dependency

Code (Text):
    dependencies {
            implementation 'me.erdi:streaker-api:1.0.0'
    }


API Usage
Use Bukkit's service manager to obtain an instance of StreakerApi (me.erdi.streaker.api.StreakerApi)

Code (Java):
public class MyPlugin extends JavaPlugin
  private StreakerApi streaker ;

  public void onEnable ( ) {
    if ( !setupStreaker ( ) )
      getLogger ( ). severe ( "Streaker not found!" ) ;
  }

  private boolean setupStreaker ( ) {
    RegisteredServiceProvider <StreakerApi > rsp = getServer ( ). getServicesManager ( ). getRegistration (StreakerApi. class ) ;

    if (rsp == null )
      return false ;

    streaker = rsp. getProvider ( ) ;
    return streaker != null ;
  }
}

StreakerApi overview:

Code (Java):
    /**
     * Globally disable kill-streaks
     * @param enabled
     */

    void setStreakEnabled ( boolean enabled ) ;
    /**
     * Check if kill-streaks are enabled
     * @return whether kill-streaks are enabled
     */

    boolean isStreakEnabled ( ) ;
    /**
     * A person's kill-streak
     * @param whose whose kill-streak to get
     * @return the specified player's kill-streak
     */

    int getStreak (Player whose ) ;
    /**
     * Set a person's kill-streak
     * @param whose whose kill-streak to set
     * @param streak kill-streak
     */

    void setStreak (Player whose, int streak ) ;



There are two events in the API:
PlayerKillStreakEvent and PlayerStreakResetEvent

The API's GitHub repository can be found here
Resource Information
Author:
----------
Total Downloads: 95
First Release: Aug 29, 2023
Last Update: Aug 29, 2023
Category: ---------------
All-Time Rating:
0 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings