Coder Social home page Coder Social logo

About Me

  • Experience with java, Javascript and CSS (among others)
  • Interested in programming, creating plugins.
  • I like cars
  • any questions dm me on discord:

    Velectical#001

Total time coded since Feb 3 2023

Stack

  • Java
  • JavaScript
  • C++
  • HTML5
  • CSS
  • Dev.to blog
  • RedisDB RabbitMQ Visual Studio Code Photoshop Kotlin Lua nVIDIA Discord GitHub

wakatime stats

Velectical 's Projects

atom-wakatime icon atom-wakatime

Atom plugin for automatic time tracking and metrics generated from your programming activity.

curency icon curency

Code (Text): public String currencyName = "AKCredits"; //I named it "AKCredits" because it is named after my character. Of course you can name it anything you want.     public Methods methods; Spoiler: Config Code (Text): //Create Config         saveDefaultConfig();         getConfig().set("currency-name", currencyName);         saveConfig(); Spoiler: BalanceManager Code (Text): public double getBalance(Player p) {         m.getConfig().getDouble(p.getName() + "-money");         return m.getConfig().getDouble(p.getName() + "-money");     }     public double addToBalance(Player p,double numberToAddTo) {         double sum = getBalance(p) + numberToAddTo;         m.getConfig().set(p.getName() + "-money", sum);         return sum;     }     public double setBalance(Player p, double numberToSet) {         m.getConfig().set(p.getName() + "-money", numberToSet);         return numberToSet;     }     public double subtractFromBalance(Player p, double numberToSubtractFrom) {         double subtract = getBalance(p) - numberToSubtractFrom;         m.getConfig().set(p.getName() + "-money", subtract);         return subtract;     } Spoiler: Event Code Code (Text): @EventHandler     public void onJoin(PlayerJoinEvent e) {         Player p = e.getPlayer();         if (!p.hasPlayedBefore()) {             main.getConfig().set(p.getName() + "-money", 0.0);             main.saveConfig();         }     } @EventHandler public void onQuit(PlayerQuitEvent e) { main.saveConfig(); } Spoiler: Commands Code (Text): @Override     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {         Player p = (Player) sender;         if (cmd.getName().equalsIgnoreCase("balance")) {             if (sender instanceof Player) {                 if (args.length == 0) {                     p.sendMessage(currencyName + ": " + String.valueOf(methods.getBalance(p)));                 } else if (args.length > 0) {                     if (args[0].equalsIgnoreCase("help")) {                         p.sendMessage("/balance - To display account balance.");                         p.sendMessage("/balance help - To display this help page.");                         p.sendMessage("/balance add <PlayerName> <NumberToAddTo> - Adds to the players balance.");                         p.sendMessage("/balance withdraw <PlayerName> <NumberToTakeFrom> - Takes from the players balance.");                         p.sendMessage("/balance set <PlayerName> <NumberToSetTo> - Set the players account in total.");                     } else if (args[0].equalsIgnoreCase("add")) {                         try {                             if (Bukkit.getPlayer(args[1]) != null) {                                 methods.addToBalance(Bukkit.getPlayer(args[1]), Double.parseDouble(args[2]));                                 p.sendMessage("Successfully add " + args[2] + "to " + args[1] + "'s account");                             } else {                                 p.sendMessage("That is not a valid player or that player is not online");                             }                         } catch (NumberFormatException e) {                             p.sendMessage("Make sure it is a double and a player name");                             p.sendMessage("Correct syntax: /balance add <PlayerName> <NumberToAddTo>");                             p.sendMessage("For Example: 3.9");                         }                     } else if (args[0].equalsIgnoreCase("take") || args[0].equalsIgnoreCase("withdraw")) {                         try {                             if (Bukkit.getPlayer(args[1]) != null) {                                 methods.subtractFromBalance(Bukkit.getPlayer(args[1]), Double.parseDouble(args[2]));                                 p.sendMessage("Successfully subtracted " + args[2] + "from " + args[1] + "'s account");                             }                             else {                                 p.sendMessage("That is not a valid player or that player is not online");                             }                         } catch (NumberFormatException e) {                             p.sendMessage("Make sure it is a double and a player name");                             p.sendMessage("Correct syntax: /balance take <PlayerName> <NumberToTakeFrom>");                             p.sendMessage("For Example: 3.9");                         }                     } else if (args[0].equalsIgnoreCase("set")) {                         try {                             if (Bukkit.getPlayer(args[1]) != null) {                                 methods.setBalance(Bukkit.getPlayer(args[1]), Double.parseDouble(args[2]));                                 p.sendMessage("Set " + args[1]+"'s"+" balance to " + args[2]);                             }                             else {                                 p.sendMessage("That is not a valid player or that player is not online");                             }                         } catch (NumberFormatException e) {                         }                         p.sendMessage("Make sure it is a double and a player name");                         p.sendMessage("Correct syntax: /balance set <PlayerName> <NumberToSet>");                         p.sendMessage("For Example: 3.9");                     }                 }             }         }         return false;     } Code (Text): getCommand("balance").setExecutor(this); getCommand("bal").setExecutor(this); (Text): saveConfig(); Here is the plugin.yml You can change the name of the plugin. Spoiler: plugin.yml Code (Text): name: AKCredits version: 1.0 main: me.AKZOMBIE74.AKCredits commands:   balance:     description: Do /balance help     aliases: [balx]

openaudiomc icon openaudiomc

A real time proximity voice chat and music plugin for Minecraft. Doesn't require mods or any user setup.

typescript icon typescript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.