0

Play Now

Click to Copy IP

Java Assistance - Found some code on a map, unsure how to run.

Java Assistance - Found some code on a map, unsure how to run.

Ripple Red

Member
maplefit
maplefit
So, I recently bought a map off of the Auction House on Survival, and to my surprise, it provides java code. It reads:

@ Override
public void onCommand() {
if(label.equals("cool"){
s.sendMessage("you are cool");
}
return true;
}

Now, I'm already acquainted with Java, however, I've never actually looked into Minecraft's functions, so I don't know which Methods are being called to in the code. I'm assuming that it'll print the text "you are cool" into the chat upon word-checking for "cool" from the host, but that isn't really my main concern.

My question is... where do I throw this little tidbit to run it effectively?

I know that I can't just throw it into a new Java project on Eclipse, since it relies off of pre-existing Methods written in Minecraft's coding. I don't think it'll let me jus throw it into the chat, either.

Ideas? Thoughts? I've never really messed around with Minecraft enough to know where it would look for code entry, so ehhh... some assistance would be helpful. Thanks!
 
So, I recently bought a map off of the Auction House on Survival, and to my surprise, it provides java code. It reads:

@ Override
Public Void onCommand() {
if(label.equals("cool"){
s.sendMessage("you are cool");
}
return true;
}

Now, I'm already acquainted with Java, however, I've never actually looked into Minecraft's functions, so I don't know which Methods are being called to in the code. I'm assuming that it'll print the text "you are cool" into the chat upon word-checking for "cool" from the host, but that isn't really my main concern.

My question is... where do I throw this little tidbit to run it effectively?

I know that I can't just throw it into a new Java project on Eclipse, since it relies off of pre-existing Methods written in Minecraft's coding. I don't think it'll let me jus throw it into the chat, either.

Ideas? Thoughts? I've never really messed around with Minecraft enough to know where it would look for code entry, so ehhh... some assistance would be helpful. Thanks!
hey thats mine pog :D

so its actually a condensed version of a spigot plugin people can make.

code for future reference:
Code:
package me.icynnac.mapart;
//ps customize the package to your liking, but change ur file names too

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public final class Mapart extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (label.equalsIgnoreCase("cool")) {
            sender.sendMessage("you are cool :D");
        }
        return true;
    }
}
 
hey thats mine pog :D

so its actually a condensed version of a spigot plugin people can make.

code for future reference:
Code:
package me.icynnac.mapart;
//ps customize the package to your liking, but change ur file names too

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public final class Mapart extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (label.equalsIgnoreCase("cool")) {
            sender.sendMessage("you are cool :D");
        }
        return true;
    }
}
that's pretty sick dude
 
General Discussion
Back