Advanced Spigot Coding | MySQL Part 2 | (Ep. 4) Spigot 1.15

Поделиться
HTML-код
  • Опубликовано: 3 фев 2025

Комментарии • 62

  • @malletdevoted
    @malletdevoted 4 года назад +12

    Seems like this is one of the best quality tutorials out there on RUclips. I love how you did stuff correctly, and following good coding practices (e.g. avoiding static abuse), this is what people should learn from, rather than those other tutorials where stuff is done incorrectly. Anyways, wonderful tutorial

  • @DaVaMuOficial
    @DaVaMuOficial 2 года назад

    15:27 "INSERT IGNORE INFO" INFO -> INTO :)
    Nice guide. Like.

  • @Omegabiebel
    @Omegabiebel 4 года назад +8

    Can u do a part 3 where you use the MySQL asynchronous from the rest. There aren’t much tutorials about that and it’s apparently very handy anti lag tool
    Also perfect content!

  • @FilipeeX
    @FilipeeX 2 года назад +1

    Thanks m8, really helped me.

  • @slygg
    @slygg 4 года назад +1

    A few notes for people who want to make this even better: 1) don't put redundant data in your db. Ex: he put name and uuid in. Since you have the uuid there is no need for name since you can just grab it. (there are however a few cases where this can be useful. Like a leaderboard) Also, names can change, uuid's can't. This means there needs to be a onjoin if player displayname same as db name etc... 2) primary keys are important if you want to make relations. If you don't know what it means no problem but if you do need to set a PK, choose something that is always unique. In his case that is the UUID, not the name because the names change.

    • @Mavis847
      @Mavis847 3 года назад

      This, the tutorial was cool and all but he barely understands sql.

    • @fallow64
      @fallow64 2 года назад

      Great comment!

  • @girannorbi
    @girannorbi 2 года назад

    Thank you very much for the help!

  • @Kalamandxr
    @Kalamandxr 4 года назад

    Love the work man, keep it up!

  • @lteby7247
    @lteby7247 4 года назад +5

    Got here in 13 seconds

  • @Albanlerok
    @Albanlerok 4 года назад +1

    Hey, I have a problem it shows this on the console :
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAT(100),UUID VARCHAT(100),EMERALDS INT(100),PRIMARY KEY (NAME))' at line 1
    And 7379857 lines of errors, idk why ._.

    • @foleyjack
      @foleyjack 4 года назад +1

      It's VARCHAR not VARCHAT

  • @God_Eye
    @God_Eye 2 года назад

    Great video, Thanks a lot!

  • @davidcordes8963
    @davidcordes8963 3 года назад +1

    Very Very Nice, thanks a lot!

  • @phillipwilson3381
    @phillipwilson3381 2 года назад

    I had a problem with the 'createPlayer' reporting database error or syntax
    I finally tracked this down to the SQL command "INSERT IGNORE INTO mobpoints"
    Removing the 'IGNORE' solved the problem.
    CoddedRed never explained why 'IGNORE' should be included. (Spigot 1.19.2)

  • @auxiliaryboxes
    @auxiliaryboxes 4 года назад

    "INSORT" hahaha. Thanks for making these, as a web developer I'm accustomed to connecting to MongoDB with NodeJS-Express servers. I think it's good that I'll be adding MySQL to my database literacy. I'm also interested in trying to tackle a custom MC server network with my own code so this series is bringing me in the right direction.
    Have you ever considered working for a company like Hypixel? They would probably love to have someone with your skills and knowledge on the team.

    • @CookieTriste
      @CookieTriste 2 года назад

      I think this isnt enougth skill

    • @hepno
      @hepno 2 года назад

      @@CookieTriste Yeah, CodedRed is a great dev and all but Hypixel only really hires the best of the best

  • @ForeverInColor
    @ForeverInColor 3 года назад

    Loving this!

  • @keinwunder9776
    @keinwunder9776 4 года назад +1

    Hey! Live your video! But how do I set strings instead of int's?

  • @alejandroooow
    @alejandroooow 3 года назад +2

    Small tip, since you’re on windows, you can do Win + C to see your clipboard, instead of having to worry about having it copied

  • @somethingaboutmoron
    @somethingaboutmoron 3 года назад

    7:43, don't worry just marking where I'm at

  • @beverschreckabc7728
    @beverschreckabc7728 4 года назад +2

    Can you please make video to code bots for discord?

    • @atharvnaphade7017
      @atharvnaphade7017 4 года назад

      You might not find this message but there is a good tutorial website to do this, especially if you use intelij

  • @TheStroker986
    @TheStroker986 3 года назад +1

    How much storage can xampp hold?

    • @bastothemax
      @bastothemax 2 года назад

      this depends how much storage your laptop/pc has

  • @itaykisous
    @itaykisous 4 года назад

    I added /addpoints command, and whenever I use it, the database gets updated, but when I use /points it doesn't change.

  • @dec-pv8lb
    @dec-pv8lb 4 года назад

    Could you go over how to disguise players as mobs?

  • @devmclovin
    @devmclovin 4 года назад

    Could you do a tutorial on queuing database queries on a separate thread using and async task? I feel like this is necessary when using a database so you don't slow down the main thread.

  • @ethanburkett8207
    @ethanburkett8207 3 года назад

    Instead of updating the Database every kill try making a cache that will update the database every 5 or 10 minutes, if the plugin is in constant use by 100s of players or even 10 players, it can lag the database and eventually throw a timeout error

  • @voltix6671
    @voltix6671 4 года назад

    Can you make a tutorial on how to make XP bar equal to a variable? Like forexample for a leveling system, the number would be your level and the xp bar would be your progress on leveling up?

    • @Dusk_2_Dawn
      @Dusk_2_Dawn 4 года назад

      To set the level, you can do p.setLevel(level) and p.setExp(xp) for xp.

  • @vladdomnescu
    @vladdomnescu 4 года назад +1

    Good Work!

  • @dylanroberts6217
    @dylanroberts6217 4 года назад

    I noticed that you can do ps.close(). I wonder if this "frees up" resources. I'm very sure Java does this automatically for you after some time but maybe it's a good idea to include that? Any thoughts?

    • @nicocorei
      @nicocorei 3 года назад

      Always close PreparedStatement and Resulset.

  • @voltix6671
    @voltix6671 4 года назад

    Thanks for the tutorial

  • @swagmadg4229
    @swagmadg4229 3 года назад

    MariaDB maybe??? pls help

  • @mustafaesattemel
    @mustafaesattemel 4 года назад

    bro can you make autoequiparmor plugin ? for my egg wars shop sytem ? (when players buy armor auto equip ) ?

    • @Dusk_2_Dawn
      @Dusk_2_Dawn 4 года назад

      You can just do p.getInventory().setHelmet(item) for helmet, p.getInventory().setChestplate(item) for chestplate, etc.

    • @mustafaesattemel
      @mustafaesattemel 4 года назад

      @@Dusk_2_Dawn i dont know coding . With eclipse ?

    • @Dusk_2_Dawn
      @Dusk_2_Dawn 4 года назад

      @@mustafaesattemel Yes. If you coded the egg wars shop yourself, then the player purchases a piece of armor from the shop, you would do p.getInventory().set[PIECE](item) (Replace [PIECE] with whatever armor piece you are replacing). If you did not code it, then I'm you'll probably have to create a plugin that checks their inventory for armor pieces and replaces their armor if it finds any.

    • @mustafaesattemel
      @mustafaesattemel 4 года назад

      @@Dusk_2_Dawn i need to add this code on eggwars jar file ? or new jar file ?

    • @Dusk_2_Dawn
      @Dusk_2_Dawn 4 года назад

      @@mustafaesattemel Yes you will need to add it to the Egg Wars JAR file

  • @spacewalkerminecraft6802
    @spacewalkerminecraft6802 4 года назад

    cant you use update set points=points+1 ?

    • @CodedRed
      @CodedRed  4 года назад

      That’s what we’re basically doing. We need to get their total points then add one. Our variable “points” equals 1. Because it is just a passed in variable.

  • @bluept1437
    @bluept1437 4 года назад

    How do i do if i want to do more than 1 table?

    • @atharvnaphade7017
      @atharvnaphade7017 4 года назад

      Simple. Just create A different table using a different table name in the sql connection constructor

  • @stridecrafter3947
    @stridecrafter3947 4 года назад

    Hey, when I use PaperMC for this (my friend told me Paper uses spigot API) it doesnt work and JavaPlugin doesnt exist with it. Any help?

    • @CodedRed
      @CodedRed  4 года назад

      Code the plugin using Spigot. Then have your server run Paper.

    • @stridecrafter3947
      @stridecrafter3947 4 года назад

      @@CodedRed My code is making a command that gives you a sword that insta-kills anything. I don't know the problem and why its not working tho. (I did add plugin.yml)
      gyazo.com/66f47831b24f911b5a5a5dc4ecc29019
      package me.StrideCrafter.UltraSword;
      import org.bukkit.Material;
      import org.bukkit.command.CommandSender;
      import org.bukkit.enchantments.Enchantment;
      import org.bukkit.entity.Player;
      import org.bukkit.plugin.java.JavaPlugin;
      import com.mojang.brigadier.Command;
      import org.bukkit.Material;
      import org.bukkit.inventory.ItemStack;
      public class Main extends JavaPlugin {

      @Override
      public void onEnable() {

      }

      @Override

      public void onDisable() {

      }

      public void onCommand(CommandSender sender, Command cmd, String label, String[] args) {
      Player user = (Player) sender;
      if(label.equalsIgnoreCase("ultrasword") || label.equalsIgnoreCase("usword")) {
      ItemStack item = new ItemStack(Material.DIAMOND_SWORD, 1);
      item.addEnchantment(Enchantment.DAMAGE_ALL, 1000);
      user.getInventory().setItemInMainHand(item);
      }

      }
      }
      it wont work for me. I don't see a problem.

    • @mp6412
      @mp6412 4 года назад

      StrideCrafter your command uses public void, not public boolean

  • @korrasmith3448
    @korrasmith3448 2 года назад

    i swear my hands LITERALLY started to bleed

  • @lteby7247
    @lteby7247 4 года назад

    Here before insprill and tank 203

    • @tank2036
      @tank2036 4 года назад +1

      Ok i see how it is stealing my comment

    • @lteby7247
      @lteby7247 4 года назад

      Tank 203 there is that better?

  • @stephenminer383
    @stephenminer383 4 года назад

    hello there

  • @yarond_
    @yarond_ 4 года назад +3

    First

    • @yarond_
      @yarond_ 4 года назад

      @Eternal hunter idk XD

  • @mikozak2
    @mikozak2 4 года назад

    I love your tutorials, but please do me a favour. This music that goes in the background was OK at the beginning, but now it starts to become very annoing especially there is only one song. It is ok to have it on presentation at the begining, but it shouldn't be through whole video.