#Having trouble with constructor?

6 messages · Page 1 of 1 (latest)

deft totem
#

So I've got a command working thats suppose to execute a function with (sender, target, arg).
I'm having trouble with how im suppose to link to my constructor in another class so that it will execute?

my attempt that isnt working, hopefully this makes sense.

new sendRequest(player, target, args[1]);
return true;
public class DuelEvent {
    HashMap<Player, Player> requests = new HashMap<>();
    
    public void sendRequest(Player sender, Player target, String arg) {
        //the constructor to execute
    }
}
balmy lavaBOT
#

This post has been reserved for your question.

Hey @deft totem! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

echo jetty
#

It would be more clever to remind that this is a minecraft question

deft totem
#

I assumed it just involved custom constructors/classes regardless of it being part of minecraft, my mistake.

hybrid pasture
#

sendRequest is a normal function, call it normally. you can just construct normally inside that function