Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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. :)

  • 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.

  • 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?

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.