Posted January 18, 201312 yr Hey everyone, long time user, first time poster. I am trying to make a mod that requires it get info from the server side, specifically, mcMMO, I want it to get the current levels of the current player, how can I achieve this? And once I do have that info, I can just use 'println' where I want it, correct? Thanks in advanced for any help provided.
January 18, 201312 yr Author Okay, so here is what I have so far, this is the class that gets the info from the server via mysql, it only gets basic info at the moment to test - package Zombie_Mod; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; public class ZScon { public static void ZScon(String[] args) throws Exception { Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost/mcmmo","root","root"); PreparedStatement statement = con.prepareStatement("select * from mcmmo_users"); ResultSet result = statement.executeQuery(); while(result.next()) { System.out.println(result.getString(1) + " " + result.getString(2)); } } } Few questions, in the MySQL database. There is mcmmo_users which contains id,user,lastlogin mcmmo_skills which contains id,taming,mining,woodcutting,ect (The current level) mcmmo_experience which contains id,taming,mining,woodcutting,ect (The current XP) How do I - look at mcmmo_users, match a user name to an ID, use that ID in skills to get the skill level, then experience to get experience? I then want to print it like so - Mining(20) 120/1060 So that is - SkillName(SkillLevel) CurrentXP/TotalXP Could someone help me with this? Im pretty new to actually making mods with Forge, not sure where to start really.
January 18, 201312 yr Author you trying to use mysql? Well people in Forge IRC said it's a bad idea so I kind of scraped it, any ideas on how to accomplish this?
January 18, 201312 yr Author Do you want to transfer the data to a connected Minecraft-Client? You can use the Custom Packet system for that. Someone on IRC suggested I make a Bukkit plugin that handles the API and prints the info how I need it. Then said to use packets but didn't explain how or anything, where do I start with that?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.