EazyAPI | Developer API [Spigot | 1.7.10 - 1.15.X]
1.6An easy to use developer api with a lot of features! | by Justix
This is my Developer API, I hope you enjoy it!
━━━━━━━━━━━━━━━━━━━━━━━━━━
DONATION VIA PAYPAL:
Donations/Spenden: Click here
━━━━━━━━━━━━━━━━━━━━━━━━━━
Need help | Du brauchst Hilfe
Skype: live:justix.dev
SpigotMC: Start conversation
PLEASE DO NOT WRITE BUGS OR ERRORS IN THE REVIEWS!!!
━━━━━━━━━━━━━━━━━━━━━━━━━━
This API contains a lot of useful features:
- clickable and hoverable messages
- a book creator
- an item creator
- prefixes and suffixes
- a hologram api
- tablist header and footer
- (timed) actionbars, titles, subtitles
- easy configs
It is very easy to use.
Just use the following code snippet to get the api
after adding it to the build path:
EazyAPI api = EazyAPI. getInstance ( ) ;
Examples
Plugin.yml:
name : TestPlugin
version : 1.0
author : Justix
main : net.dev.test.main.Main
dependencies : [ EazyAPI ]
ActionBar
@EventHandler
public void onJoin ( PlayerJoinEvent e ) {
EazyAPI api = EazyAPI. getInstance ( ) ;
Player p = e. getPlayer ( ) ;
//Creates a repeating task with the period delay of 100 ticks (= 5 seconds)
Bukkit. getScheduler ( ) . scheduleSyncRepeatingTask ( this , new Runnable ( ) {
int i = 0 ;
@Override
public void run ( ) {
//Add 1 to the current value of i (default = 0, new = 1)
i ++;
//Check which message should be sent
if ( i == 1 ) {
api. sendActionBar ( p, "&7This is message number #1" ) ;
} else if ( i == 2 ) {
api. sendActionBar ( p, "&7This is message number #2" ) ;
} else if ( i == 3 ) {
api. sendActionBar ( p, "&7This is message number #3" ) ;
} else if ( i == 4 ) {
api. sendActionBar ( p, "&7This is message number #4" ) ;
} else if ( i == 5 ) {
api. sendActionBar ( p, "&7This is message number #5" ) ;
//Reset the value of i
i = 0 ;
}
}
} , 5 * 20 , 5 * 20 ) ;
}Clickable & hoverable messages
@EventHandler
public void onJoin ( PlayerJoinEvent e ) {
EazyAPI api = EazyAPI. getInstance ( ) ;
Player p = e. getPlayer ( ) ;
api. sendClickableHoverableMessage ( p, "&7Welcome to our server, &a" + p. getName ( ) ,
new ClickEvent ( net. md_5 . bungee . api . chat . ClickEvent . Action . OPEN_URL ,
"https://youtube.com/JustixDevelopment" ) ,
new HoverEvent ( net. md_5 . bungee . api . chat . HoverEvent . Action . SHOW_TEXT ,
api. createHoverEventValue ( "&7Click here to get to Justix' youtube channel" ) ) ) ;
}Titles/subtitles
@EventHandler
public void onJoin ( PlayerJoinEvent e ) {
EazyAPI api = EazyAPI. getInstance ( ) ;
Player p = e. getPlayer ( ) ;
api. sendTitle ( p, "&7Welcome" , "&a" + p. getName ( ) ) ;
}Tablist header & footer
@EventHandler
public void onJoin ( PlayerJoinEvent e ) {
EazyAPI api = EazyAPI. getInstance ( ) ;
Player p = e. getPlayer ( ) ;
api. sendTablistHeaderFooter ( p, "&8ⅹ &3&lYourServer.net &8ⅹ \n " , " \n &eWebsite&8: &7www.YourServer.net \n &eTeamSpeak&8: &7ts.YourServer.net \n &9Discord&8: &7discord.YourServer.net" ) ;
}Prefixes & suffixes
@Override
public void onEnable ( ) {
//Create a task with a delay of 10 ticks (= 0,5 seconds)
Bukkit. getScheduler ( ) . runTaskLater ( this , new Runnable ( ) {
@Override
public void run ( ) {
EazyAPI api = EazyAPI. getInstance ( ) ;
api. createDefaultTeam ( "&7Player &8| &7" , "&r" ) ;
api. createTeam ( "Admin" , "&4Admin &8| &4" , "&r" , "system.admin" ) ;
api. createTeam ( "Dev" , "&bDev &8| &b" , "&r" , "system.dev" ) ;
api. createTeam ( "Builder" , "&aBuild &8| &a" , "&r" , "system.build" ) ;
api. createTeam ( "Mod" , "&cMod &8| &c" , "&r" , "system.mod" ) ;
api. createTeam ( "Sup" , "&9Sup &8| &9" , "&r" , "system.sup" ) ;
api. createTeam ( "YouTube" , "&5YT &8| &5" , "&r" , "system.youtube" ) ;
}
} , 10 ) ;
}Holograms
Create hologram
package net.dev.test.commands ;
import org.bukkit.Bukkit ;
import org.bukkit.command.Command ;
import org.bukkit.command.CommandExecutor ;
import org.bukkit.command.CommandSender ;
import org.bukkit.entity.Player ;
import net.dev.eazyapi.EazyAPI ;
public class CreateHoloCommand implements CommandExecutor {
@Override
public boolean onCommand ( CommandSender sender, Command cmd, String label, String [ ] args ) {
//Check if command sender is a player, not the console
if ( sender instanceof Player ) {
Player p = ( Player ) sender ;
if ( p. hasPermission ( "system.createholo" ) ) {
if ( args. length >= 1 ) {
String text = "" ;
for ( int i = 0 ; i < args. length ; i ++ ) {
text += args [ i ] + " " ;
}
EazyAPI api = EazyAPI. getInstance ( ) ;
api. createHologram ( p, p. getLocation ( ) , text. trim ( ) . replace ( "&" , "§" ) ) ;
p. sendMessage ( "§7Hologram created §asuccessfully" ) ;
} else {
p. sendMessage ( "§e/createholo «text»" ) ;
}
} else {
p. sendMessage ( "§cYou do not have enough permissions to do this" ) ;
}
} else {
Bukkit. getConsoleSender ( ) . sendMessage ( "§cOnly players can perform this command" ) ;
}
return true ;
}
}Delete hologram
package net.dev.test.commands ;
import org.bukkit.Bukkit ;
import org.bukkit.command.Command ;
import org.bukkit.command.CommandExecutor ;
import org.bukkit.command.CommandSender ;
import org.bukkit.entity.Player ;
import net.dev.eazyapi.EazyAPI ;
public class DeleteHoloCommand implements CommandExecutor {
@Override
public boolean onCommand ( CommandSender sender, Command cmd, String label, String [ ] args ) {
//Check if command sender is a player, not the console
if ( sender instanceof Player ) {
Player p = ( Player ) sender ;
if ( p. hasPermission ( "system.deleteholo" ) ) {
EazyAPI api = EazyAPI. getInstance ( ) ;
if ( api. getHologramAtLocation ( p. getLocation ( ) ) != null ) {
api. getHologramAtLocation ( p. getLocation ( ) ) . remove ( ) ;
p. sendMessage ( "§7Hologram deleted §asuccessfully" ) ;
} else {
p. sendMessage ( "§cThere are no holograms at your location" ) ;
}
} else {
p. sendMessage ( "§cYou do not have enough permissions to do this" ) ;
}
} else {
Bukkit. getConsoleSender ( ) . sendMessage ( "§cOnly players can perform this command" ) ;
}
return true ;
}
}Configs
@Override
public void onEnable ( ) {
//Create a task with a delay of 10 ticks (= 0,5 seconds)
Bukkit. getScheduler ( ) . runTaskLater ( this , new Runnable ( ) {
@Override
public void run ( ) {
YamlConfig config = new YamlConfig ( "TestPlugin" , "setup.yml" ) ;
config. setHeader ( "Test header" ) ;
config. addDefault ( "Messages.Prefix" , "&8[&3Prefix&8] &7" ) ;
config. saveFile ( ) ;
String prefix = ChatColor. translateAlternateColorCodes ( '&' , config. getConfiguration ( ) . getString ( "Messages.Prefix" ) ) ;
ServerConsole. sendMessage ( prefix + "&7It works!" ) ;
}
} , 10 ) ;
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta