Coding Help

Status
This thread has been locked.

HuskyGG

Banned
Feedback score
3
Posts
79
Reactions
16
Resources
0
Hello everyone! Quick question. Not played around with java / the bukkit api for a while -
How would i get, Player recieved = Bukkit.getPlayer(args[0]); from my commands class to my Custom Class so i can use + recived.getName?
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

HuskyGG

Banned
Feedback score
3
Posts
79
Reactions
16
Resources
0
Ok so, ive got this command in a class called commands.
Code:
            if(cmd.getName().equalsIgnoreCase(cmd2)){
                Player player = (Player) sender;
                Player recieved = Bukkit.getPlayer(args[0]);
               
                CustomInventory i = new CustomInventory();
               
                i.newInventory(player);
               
            }
I want to use -
Code:
Player recieved = Bukkit.getPlayer(args[0]);
In my other class called custom inventory.
 
Banned forever. Reason: Scamming (https://builtbybit.com/threads/huskygg-scam-report.282658/)

Nerm

Deactivated
Feedback score
21
Posts
851
Reactions
714
Resources
0
You have to check if the target is null or if the target is you then check if the arguments size is 1 and the target name.
 

kampai

Feedback score
8
Posts
361
Reactions
187
Resources
0
You have to check if the target is null or if the target is you then check if the arguments size is 1 and the target name.
I don't think that was the question

To the OP: All you have to do is pass it through a constructor or method and store it like you did with the i.newInventory
 
Status
This thread has been locked.
Top