Sueta

CookieClicker [API, Custom Events, MySQL, Holograms]

1.2

An advanced cookie clicker with an included API

·Plugin

CookieClicker.jpg COOKIECLICKER [Contains API and Custom Events]
Source Code: https://github.com/michitillmanns/CookieClicker

Plugin Usage:

Description:
CookieClicker is a plugin to create Cookie Blocks on your Minecraft Server with an included API.

Commands:

  • /cookieclicker - Shows you a list of commands
  • /cc place - Creates a cookie at your foot location
  • /cc remove - Removes the cookie you are standing on
  • /cc setskullowner - Change the cookie player head ingame
  • /cc reload - Reloads the configuration and updates all skull textures

Permissions:

  • cookieclicker.* - Permission for complete usage of the plugin
  • cookieclicker.command.* - Permission for complete command usage
  • cookieclicker.command - Permission for /cc and /cc help
  • cookieclicker.command.place - Permission for /cc place
  • cookieclicker.command.remove - Permission for /cc remove
  • cookieclicker.command.reload - Permission for /cc reload
  • cookieclicker.command.setskullowner - Permission for /cc setskullowner

Config:

  • CookieHeadPlayerName - Change the Minecraft Head Skin of a cookie by player name
  • InteractAction - Choose if a player should left- or rightclick a Cookie
  • ClickParticle - Change the Particle which appears after clicking a cookie (List of particles: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Particle.html )
  • MessageType - Specify where the cookie message should appear ( ActionBar, Title, Subtitle, Chat)
  • Message - Change the cookie click message (Color codes with '&' supported)
  • ClickSound - Change the sound which plays after clicking a cookie (List of sounds: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html )
  • SoundPitch - Change the pitch of the sound
  • UseMySQL - Enable/disable MySQL usage
  • MySQL - Edit the MySQL settings


API Usage:

Get the CookieManager:

CookieManager cookieManager = CookieClicker.getCookieManager();

Creating/Removing a Cookie:

// Add a Cookie 
cookieManager.addCookie(Location arg0); 

// Remove a Cookie 
cookieManager.removeCookie(Cookie arg0);

Getting a Cookie from Location:

Cookie cookie = cookieManager.getCookieFromLocation(Location arg0);

Checking if a Cookie is placed on a Location:

boolean existsCookie = cookieManager.getCookieFromLocation(Location arg0) != null;

Adding/Getting a Players Click Count:

// Add one Click to a Players count 
cookieManager.addClick(Player arg0); 

// Get the amount of clicks of a Player 
int clicks = cookieManager.getClicks(Player arg0);


Custom EVENT Usage:

BEFORE Clicking (Cancelable):

@EventHandler 
public void onCookieClick(CookieClickEvent event) { 
    // Get the Player who is clicking the Cookie 
    Player player = event.getPlayer(); 
  
    // Get the Cookie which is being clicked 
    Cookie cookie = event.getCookie(); 

    // Get the Players Click Count BEFORE adding one more 
    int clicks = event.getClicks(); 

    // Cancel the Event 
    event.setCancelled(true); 
}

AFTER Clicking:

@EventHandler 
public void onCookieClicked(CookieClickedEvent event) { 
    // Get the Player who clicked the Cookie 
    Player player = event.getPlayer(); 
  
    // Get the Cookie which was clicked 
    Cookie cookie = event.getCookie(); 

    // Get the Players Click Count AFTER adding one more 
    int clicks = event.getClicks(); 
}


Videos:

Feel free to create a Tutorial ;)

Similar projects

Plugin →