Hello! I'm sorry if something is not clear, I do not know much english, I'm from Russia. I use google translator. I ask for your help.
I want to display some data from the plugin. How to do it? Version 1.5.2. It is also possible to modify the client. I would be grateful.
Code:
package ru.shadow.bukkit.plugin002;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class lg extends JavaPlugin implements Listener
{
private FileConfiguration config;
public void onEnable()
{
Bukkit.getPluginManager().registerEvents(this, this);
config = getConfig();
}
public void onDisable()
{
saveConfig();
}
@EventHandler
public void OnJoin(PlayerJoinEvent event)
{
}
@EventHandler
public void onBlockPlace(BlockPlaceEvent event)
{
event.getPlayer().sendMessage(Integer.toString(config.getInt(event.getPlayer().getName()+"_Id")));
int a;
a=config.getInt(event.getPlayer().getName()+"_Id")+1;
config.set(event.getPlayer().getName()+"_Id", a);
}
}
I want to display some data from the plugin. How to do it? Version 1.5.2. It is also possible to modify the client. I would be grateful.
Code:
package ru.shadow.bukkit.plugin002; import org.bukkit.Bukkit; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.plugin.java.JavaPlugin; public class lg extends JavaPlugin implements Listener { private FileConfiguration config; public void onEnable() { Bukkit.getPluginManager().registerEvents(this, this); config = getConfig(); } public void onDisable() { saveConfig(); } @EventHandler public void OnJoin(PlayerJoinEvent event) { } @EventHandler public void onBlockPlace(BlockPlaceEvent event) { event.getPlayer().sendMessage(Integer.toString(config.getInt(event.getPlayer().getName()+"_Id"))); int a; a=config.getInt(event.getPlayer().getName()+"_Id")+1; config.set(event.getPlayer().getName()+"_Id", a); } }Modding help can be found here: http://www.minecraftforum.net/forum/140-modification-development/
Also this may be of help: http://wiki.bukkit.org/Plugin_Tutorial