How do I fix certain commands returning null

Discussion in 'Plugin Development' started by funnyman850, May 31, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    funnyman850

    So i have made a plugin and this is just an update to add a few things like FunnyExplosion, FunnyFireoworks, FunnyRedstone, FunnySlime, and FunnyFootstep. All of the other 'Foots' work like FunnyFire, FunnyPotion, FunnyLove, FunnyEnd, FunnyHate, FunnyDrug, FunnyLava, FunnySeason, and FunnyCheck.

    Main Class PT 1
    Code:java
    1. package me.funnyman850.FunnyFoots;
    2.  
    3. import java.util.ArrayList;
    4. import java.util.logging.Logger;
    5.  
    6. import org.bukkit.Bukkit;
    7. import org.bukkit.ChatColor;
    8. import org.bukkit.command.Command;
    9. import org.bukkit.command.CommandSender;
    10. import org.bukkit.entity.Player;
    11. import org.bukkit.event.Listener;
    12. import org.bukkit.plugin.PluginManager;
    13. import org.bukkit.plugin.java.JavaPlugin;
    14.  
    15. public class FunnyFoots extends JavaPlugin
    16. {
    17.  
    18. public final Listener playerListener = new FunnyFootsListener(this);
    19. public static ArrayList<Player> FunnyFire;
    20. public static FunnyFoots instance;
    21. public ArrayList<Player> FunnyDrug;
    22. public ArrayList<Player> FunnyPotion;
    23. public ArrayList<Player> FunnyEnd;
    24. public ArrayList<Player> FunnyLove;
    25. public ArrayList<Player> FunnyFish;
    26. public ArrayList<Player> FunnyLava;
    27. public ArrayList<Player> FunnyHate;
    28. public ArrayList<Player> FunnySeason;
    29. public ArrayList<Player> FunnyExplosion;
    30. public ArrayList<Player> FunnyFireworks;
    31. public ArrayList<Player> FunnyRedstone;
    32. public ArrayList<Player> FunnySlime;
    33. public ArrayList<Player> FunnyFootstep;
    34.  
    35. public boolean EnableFire = true;
    36. public boolean EnableEnd = true;
    37. public boolean EnablePotion = true;
    38. public boolean EnableLove = true;
    39. public boolean EnableDrug = true;
    40. public boolean EnableFish = true;
    41. public boolean EnableHate = true;
    42. public boolean EnableLava = true;
    43. public boolean EnableSeason = true;
    44. public boolean EnableExplosion = true;
    45. public boolean EnableFireworks = true;
    46. public boolean EnableRedstone = true;
    47. public boolean EnableSlime = true;
    48. public boolean EnableFootstep = true;
    49.  
    50. Logger log;
    51.  
    52. @SuppressWarnings("static-access")
    53. public void onEnable()
    54. {
    55. this.log = getLogger();
    56. FunnyFoots.instance = this;
    57. this.saveDefaultConfig();
    58.  
    59.  
    60. this.FunnyFire = new ArrayList<Player>();
    61. this.FunnyDrug = new ArrayList<Player>();
    62. this.FunnyFire = new ArrayList<Player>();
    63. this.FunnyPotion = new ArrayList<Player>();
    64. this.FunnyEnd = new ArrayList<Player>();
    65. this.FunnyLove = new ArrayList<Player>();
    66. this.FunnyFish = new ArrayList<Player>();
    67. this.FunnyLava = new ArrayList<Player>();
    68. this.FunnyHate = new ArrayList<Player>();
    69. this.FunnySeason = new ArrayList<Player>();
    70. this.FunnyExplosion = new ArrayList<Player>();
    71. this.FunnyFireworks = new ArrayList<Player>();
    72. this.FunnyRedstone = new ArrayList<Player>();
    73. this.FunnySlime = new ArrayList<Player>();
    74. this.FunnyFootstep = new ArrayList<Player>();
    75. this.EnableFire = this.getConfig().getBoolean("EnableFire");
    76. this.EnableEnd = this.getConfig().getBoolean("EnableEnd");
    77. this.EnablePotion = this.getConfig().getBoolean("EnablePotion");
    78. this.EnableLove = this.getConfig().getBoolean("EnableLove");
    79. this.EnableDrug = this.getConfig().getBoolean("EnableDrug");
    80. this.EnableFish = this.getConfig().getBoolean("EnableFish");
    81. this.EnableHate = this.getConfig().getBoolean("EnableHate");
    82. this.EnableLava = this.getConfig().getBoolean("EnableLava");
    83. this.EnableSeason = this.getConfig().getBoolean("EnableSeason");
    84. this.EnableExplosion = this.getConfig().getBoolean("EnableExplosion");
    85. this.EnableFireworks = this.getConfig().getBoolean("EnableFireworks");
    86. this.EnableRedstone = this.getConfig().getBoolean("EnableRedstone");
    87. this.EnableSlime = this.getConfig().getBoolean("EnableSLime");
    88. this.EnableFootstep = this.getConfig().getBoolean("EnableFootstep");
    89.  
    90. this.log.info("FunnyFoots has Been Enabled!");
    91. PluginManager pm = getServer().getPluginManager();
    92. pm.registerEvents(this.playerListener, this);
    93. }
    94.  
    95. public void onDisable() {
    96. this.log.info("FunnyFoots has been disabled!");
    97. }
    98.  
    99. public boolean onCommand(CommandSender sender, Command cmd, String commandlabel, String[] args) {
    100. ChatColor red = ChatColor.RED;
    101. ChatColor aqua = ChatColor.AQUA;
    102. ChatColor yellow = ChatColor.YELLOW;
    103. ChatColor green = ChatColor.GREEN;
    104. if (args.length < 1) {
    105. if ((sender instanceof Player)) {
    106. Player player = (Player)sender;
    107. if (cmd.getName().equalsIgnoreCase("Funnyfire")) {
    108. if (player.hasPermission("FunnyFoot.FunnyFire")) {
    109. if (FunnyFoots.FunnyFire.contains(player)) {
    110. FunnyFoots.FunnyFire.remove(player);
    111. player.sendMessage(yellow + getConfig().getString("DisableFunnyFire"));
    112. return true;
    113. }
    114. FunnyFoots.FunnyFire.add(player);
    115. player.sendMessage(yellow + getConfig().getString("EnableFunnyFire"));
    116. return true;
    117. }
    118.  
    119. player.sendMessage(red + "No permission.");
    120. }
    121. else if (cmd.getName().equalsIgnoreCase("FunnyDrug")) {
    122. if (player.hasPermission("FunnyFoot.FunnyDrug")) {
    123. if (this.FunnyDrug.contains(player)) {
    124. this.FunnyDrug.remove(player);
    125. player.sendMessage(yellow + getConfig().getString("DisableFunnyDrug"));
    126. return true;
    127. }
    128. this.FunnyDrug.add(player);
    129. player.sendMessage(yellow + getConfig().getString("EnableFunnyDrug"));
    130. return true;
    131. }
    132.  
    133. player.sendMessage(red + "No permission");
    134. }
    135. else if (cmd.getName().equalsIgnoreCase("FunnyFish")) {
    136. if (player.hasPermission("FunnyFoot.FunnyFish")) {
    137. if (this.FunnyFish.contains(player)) {
    138. this.FunnyFish.remove(player);
    139. player.sendMessage(yellow + getConfig().getString("DisableFunnyFish"));
    140. return true;
    141. }
    142. this.FunnyFish.add(player);
    143. player.sendMessage(yellow + getConfig().getString("EnableFunnyFish"));
    144. return true;
    145. }
    146.  
    147. player.sendMessage(red + "No permission");
    148. }
    149. else if (cmd.getName().equalsIgnoreCase("FunnyLava")) {
    150. if (player.hasPermission("FunnyFoot.FunnyLava")) {
    151. if (this.FunnyLava.contains(player)) {
    152. this.FunnyLava.remove(player);
    153. player.sendMessage(yellow + getConfig().getString("DisableFunnyLava"));
    154. return true;
    155. }
    156. this.FunnyLava.add(player);
    157. player.sendMessage(yellow + getConfig().getString("EnableFunnyLava"));
    158. return true;
    159. }
    160.  
    161. player.sendMessage(red + "No permission");
    162. }
    163. else if (cmd.getName().equalsIgnoreCase("FunnyLove")) {
    164. if (player.hasPermission("FunnyFoot.FunnyLove")) {
    165. if (this.FunnyLove.contains(player)) {
    166. this.FunnyLove.remove(player);
    167. player.sendMessage(yellow + getConfig().getString("DisableFunnyLove"));
    168. return true;
    169. }
    170. this.FunnyLove.add(player);
    171. player.sendMessage(yellow + getConfig().getString("EnableFunnyLove"));
    172. return true;
    173. }
    174.  
    175. player.sendMessage(red + "No permission");
    176. }
    177. else if (cmd.getName().equalsIgnoreCase("FunnyHate")) {
    178. if (player.hasPermission("FunnyFoot.FunnyHate")) {
    179. if (this.FunnyHate.contains(player)) {
    180. this.FunnyHate.remove(player);
    181. player.sendMessage(yellow + getConfig().getString("DisableFunnyHate"));
    182. return true;
    183. }
    184. this.FunnyHate.add(player);
    185. player.sendMessage(yellow + getConfig().getString("EnableFunnyHate"));
    186. return true;
    187. }
    188.  
    189. player.sendMessage(red + "No permission");
    190. }
    191. else if (cmd.getName().equalsIgnoreCase("FunnySeason")) {
    192. if (player.hasPermission("FunnyFoot.FunnySeason")) {
    193. if (this.FunnySeason.contains(player)) {
    194. this.FunnySeason.remove(player);
    195. player.sendMessage(yellow + getConfig().getString("DisableFunnySeason"));
    196. return true;
    197. }
    198. this.FunnySeason.add(player);
    199. player.sendMessage(yellow + getConfig().getString("EnableFunnySeason"));
    200. return true;
    201. }
    202.  
    203. player.sendMessage(red + "No permission");
    204. }
    205. else if (cmd.getName().equalsIgnoreCase("FunnyPotion")) {
    206. if (player.hasPermission("FunnyFoot.FunnyPotion")) {
    207. if (this.FunnyPotion.contains(player)) {
    208. this.FunnyPotion.remove(player);
    209. player.sendMessage(yellow + getConfig().getString("DisableFunnyPotion"));
    210. return true;
    211. }
    212. this.FunnyPotion.add(player);
    213. player.sendMessage(yellow + getConfig().getString("EnableFunnyPotion"));
    214. return true;
    215. }
    216.  
    217. player.sendMessage(red + "No permission");
    218. }
    219. else if (cmd.getName().equalsIgnoreCase("FunnyEnd")) {
    220. if (player.hasPermission("FunnyFoot.FunnyEnd")) {
    221. if (this.FunnyEnd.contains(player)) {
    222. this.FunnyEnd.remove(player);
    223. player.sendMessage(yellow + getConfig().getString("DisableFunnyEnd"));
    224. return true;
    225. }
    226. this.FunnyEnd.add(player);
    227. player.sendMessage(yellow + getConfig().getString("EnableFunnyEnd"));
    228. return true;
    229. }
    230.  
    231. player.sendMessage(red + "No permission");
    232. }
    233. else if (cmd.getName().equalsIgnoreCase("FunnyExplosion")) {
    234. if (player.hasPermission("FunnyFoot.FunnyExplosion")) {
    235. if (this.FunnyExplosion.contains(player)) {
    236. this.FunnyExplosion.remove(player);
    237. player.sendMessage(yellow + getConfig().getString("DisableFunnyExplosion"));
    238. return true;
    239. }
    240. this.FunnyExplosion.add(player);
    241. player.sendMessage(yellow + getConfig().getString("EnableFunnyExplosion"));
    242. return true;
    243. }
    244.  
    245. player.sendMessage(red + "No permission");
    246. }
    247. else if (cmd.getName().equalsIgnoreCase("FunnyFireworks")) {
    248. if (player.hasPermission("FunnyFoot.FunnyFireworks")) {
    249. if (this.FunnyFireworks.contains(player)) {
    250. this.FunnyFireworks.remove(player);
    251. player.sendMessage(yellow + getConfig().getString("DisableFunnyFireworks"));
    252. return true;
    253. }
    254. this.FunnyFireworks.add(player);
    255. player.sendMessage(yellow + getConfig().getString("EnableFunnyFireworks"));
    256. return true;
    257. }
    258.  
    259. player.sendMessage(red + "No permission");
    260. }
    261. else if (cmd.getName().equalsIgnoreCase("FunnyRedstone")) {
    262. if (player.hasPermission("FunnyFoot.FunnyRedstone")) {
    263. if (this.FunnyRedstone.contains(player)) {
    264. this.FunnyRedstone.remove(player);
    265. player.sendMessage(yellow + getConfig().getString("DisableFunnyRedstone"));
    266. return true;
    267. }
    268. this.FunnyRedstone.add(player);
    269. player.sendMessage(yellow + getConfig().getString("EnableFunnyRedstone"));
    270. return true;
    271. }
    272.  
    273. player.sendMessage(red + "No permission");
    274. }
    275. else if (cmd.getName().equalsIgnoreCase("FunnySlime")) {
    276. if (player.hasPermission("FunnyFoot.FunnySlime")) {
    277. if (this.FunnySlime.contains(player)) {
    278. this.FunnySlime.remove(player);
    279. player.sendMessage(yellow + getConfig().getString("DisableFunnySlime"));
    280. return true;
    281. }
    282. this.FunnySlime.add(player);
    283. player.sendMessage(yellow + getConfig().getString("EnableFunnySlime"));
    284. return true;
    285. }
    286.  
    287. player.sendMessage(red + "No permission");
    288. }
    289. else if (cmd.getName().equalsIgnoreCase("FunnyFootstep")) {
    290. if (player.hasPermission("FunnyFoot.FunnyFootstep")) {
    291. if (this.FunnyFootstep.contains(player)) {
    292. this.FunnyFootstep.remove(player);
    293. player.sendMessage(yellow + getConfig().getString("DisableFunnyFootstep"));
    294. return true;
    295. }
    296. this.FunnyFootstep.add(player);
    297. player.sendMessage(yellow + getConfig().getString("EnableFunnyFootstep"));
    298. return true;
    299. }
    300.  
    301. player.sendMessage(red + "No permission");
    302. }
    303. else if (cmd.getName().equalsIgnoreCase("FunnyCheck")) {
    304. if ((player.hasPermission("FunnyFoot.FunnyFire")) || (player.hasPermission("FunnyFoot.FunnyEnd")) || (player.hasPermission("FunnyFoot.FunnyPotion")) || (player.hasPermission("FunnyFoot.FunnyLove")) || (player.hasPermission("FunnyFoot.FunnyFish")) || (player.hasPermission("FunnyFoot.FunnyLava")) || (player.hasPermission("FunnyFoot.FunnyHate")) || (player.hasPermission("FunnyFoot.FunnySeason")) || (player.hasPermission("FunnyFoot.FunnyEnd")) || (player.hasPermission("FunnyFoot.FunnyExplosion")) || (player.hasPermission("FunnyFoot.FunnyFirework")) ||(player.hasPermission("FunnyFoot.FunnyRedstone")) ||(player.hasPermission("FunnyFoot.FunnySlime")) || (player.hasPermission("FunnyFoot.FunnyFootstep"))) {
    305. player.sendMessage(yellow + "Available Feet FX:");
    306. if (FunnyFoots.FunnyFire.contains(player)) {
    307. player.sendMessage("- FunnyFire");
    308. }
    309.  
    310. if (this.FunnyDrug.contains(player)) {
    311. player.sendMessage("- FunnyDrug");
    312. }
    313.  
    314. if (this.FunnyPotion.contains(player)) {
    315. player.sendMessage("- FunnyPotion");
    316. }
    317.  
    318. if (this.FunnyEnd.contains(player)) {
    319. player.sendMessage("- FunnyEnd");
    320. }
    321.  
    322. if (this.FunnyLove.contains(player)) {
    323. player.sendMessage("- FunnyLove");
    324. }
    325.  
    326. if (this.FunnyFish.contains(player)) {
    327. player.sendMessage("- FunnyFish");
    328. }
    329.  
    330. if (this.FunnyLava.contains(player)) {
    331. player.sendMessage("- FunnyLava");
    332. }
    333.  
    334. if (this.FunnyHate.contains(player)) {
    335. player.sendMessage("- FunnyHate");
    336. }
    337.  
    338. if (this.FunnySeason.contains(player)) {
    339. player.sendMessage("- FunnySeason");
    340. }
    341.  
    342. if (this.FunnyExplosion.contains(player)) {
    343. player.sendMessage("- FunnyExplosion");
    344. }
    345.  
    346. if (this.FunnyFireworks.contains(player)) {
    347. player.sendMessage("- FunnyFireworks");
    348. }
    349.  
    350. if (this.FunnyRedstone.contains(player)) {
    351. player.sendMessage("- FunnyRedstone");
    352. }
    353.  
    354. if (this.FunnySlime.contains(player)) {
    355. player.sendMessage("- FunnySlime");
    356. }
    357.  
    358. if (this.FunnyFootstep.contains(player)) {
    359. player.sendMessage("- FunnyFootstep");
    360. }
    361.  
    362. if ((!FunnyFoots.FunnyFire.contains(player)) && (!this.FunnyDrug.contains(player)) && (!this.FunnyPotion.contains(player)) && (!this.FunnyEnd.contains(player)) && (!this.FunnyFish.contains(player)) && (!this.FunnyLava.contains(player)) && (!this.FunnyHate.contains(player)) && (!this.FunnySeason.contains(player)) && (!this.FunnyLove.contains(player)) && (!this.FunnyExplosion.contains(player)) && (!this.FunnyFireworks.contains(player)) && (!this.FunnyRedstone.contains(player)) && (!this.FunnySlime.contains(player)) && (!this.FunnyFootstep.contains(player))) {
    363. player.sendMessage("WEll You Either Dont Have Acess Or Dont Have Any Foots Turned on");
    364. }
    365. }
    366. else
    367. {
    368. player.sendMessage(red + "No Perms...#FAIL");
    369. }
    370. } else { if (cmd.getName().equalsIgnoreCase("funnyfoot")) {
    371. player.sendMessage( ChatColor.AQUA + "Funny" + ChatColor.YELLOW + "Foot" + yellow + " - By" + red + " funnyman850");
    372. player.sendMessage(aqua + "To Toggle Foots Off after turning them on is the same command for simplicity!");
    373. player.sendMessage(aqua + "Availiable commands:");
    374. player.sendMessage(green + "CrazyFeet modes:");
    375. player.sendMessage(red + "-" + green + " /funnyfire" + yellow + " - While Walking Have Fire Particles!");
    376. player.sendMessage(red + "-" + green + " /crazydrug" + yellow + " - while walking smoke =)!");
    377. player.sendMessage(red + "-" + green + " /funnypotion" + yellow + " - Walk on PotionMagicalNess!");
    378. player.sendMessage(red + "-" + green + " /funnyend" + yellow + " - While Walking Have EnderPearl Effects!");
    379. player.sendMessage(red + "-" + green + " /funnylava" + yellow + " - While Walking Have Lava Particle Effects Effects!");
    380. player.sendMessage(red + "-" + green + " /funnylove" + yellow + " -While Walking Have Heart Particle Effects!");
    381. player.sendMessage(red + "-" + green + " /funnyfish" + yellow + " - While Walking have bubble effects!");
    382. player.sendMessage(red + "-" + green + " /funnyhate" + yellow + " -While walking have storm cloud particle effects!");
    383. player.sendMessage(red + "-" + green + " /funnyseason" + yellow + "While Walking have Seasonally changing foot effects!");
    384. player.sendMessage(red + "-" + green + "/funnyexplosion" + yellow + "While walking have explosion effects!");
    385. player.sendMessage(red + "-" + green + "/funnyfireworks" + yellow + "While walking have firework spark effects!");
    386. player.sendMessage(red + "-" + green + "/funnyredstone" + yellow + "While walking have redstone dust effects!");
    387. player.sendMessage(red + "-" + green + "/funnyslime" + yellow + "While walking have slime particle effects!");
    388. player.sendMessage(red + "-" + green + "funnyfootstep" + yellow + "While walking have footsteps follow you!");
    389. player.sendMessage(red + "funnyfoot help:");
    390. player.sendMessage(red + "-" + aqua + " /funnyfoot" + red + " - Display this menu.");
    391. player.sendMessage(red + "-" + green + " /funnycheck" + yellow + " - Find which Funny modes are active!");
    392. player.sendMessage(red + "-" + aqua + " /funnydisable" + red + " - Disable all of your FunnyFoots modes!");
    393. player.sendMessage(red + "-" + green + " /funnyfoot admin" + yellow + " - Displays FunnyFoot admin commands!");
    394. player.sendMessage(red + "All commands turned on and off.");
    395. return true;
    396. }if (cmd.getName().equalsIgnoreCase("funnydisable")) {
    397. if ((player.hasPermission("FunnyFoot.FunnyFire")) || (player.hasPermission("FunnyFoot.FunnyDrug")) || (player.hasPermission("FunnyFoot.FunnyPotion")) || (player.hasPermission("FunnyFoot.FunnyEnd")) || (player.hasPermission("FunnyFoot.FunnyFish")) || (player.hasPermission("FunnyFoot.FunnyLava")) || (player.hasPermission("FunnyFoot.FunnyHate")) || (player.hasPermission("FunnyFoot.FunnySeason")) || (player.hasPermission("FunnyFoot.FunnyLove")) || (player.hasPermission("FunnyFoot.Explosion")) || (player.hasPermission("FunnyFoot.Fireworks")) || (player.hasPermission("FunnyFoot.Redstone")) || (player.hasPermission("FunnyFoot.FunnySlime")) || (player.hasPermission("FunnyFoot.FunnyFootstep"))) {
    398. if (FunnyFoots.FunnyFire.contains(player)) {
    399. FunnyFoots.FunnyFire.remove(player);
    400. }
    401.  
    402. if (this.FunnyDrug.contains(player)) {
    403. this.FunnyDrug.remove(player);
    404. }
    405.  
    406. if (this.FunnyPotion.contains(player)) {
    407. this.FunnyPotion.remove(player);
    408. }
    409.  
    410. if (this.FunnyEnd.contains(player)) {
    411. this.FunnyEnd.remove(player);
    412. }
    413.  
    414. if (this.FunnyFish.contains(player)) {
    415. this.FunnyFish.remove(player);
    416. }
    417.  
    418. if (this.FunnyLava.contains(player)) {
    419. this.FunnyLava.remove(player);
    420. }
    421.  
    422. if (this.FunnyHate.contains(player)) {
    423. this.FunnyHate.remove(player);
    424. }
    425.  
    426. if (this.FunnySeason.contains(player)) {
    427. this.FunnySeason.remove(player);
    428. }
    429.  
    430. if (this.FunnyLove.contains(player)) {
    431. this.FunnyLove.remove(player);
    432. }
    433.  
    434. if (this.FunnyExplosion.contains(player)) {
    435. this.FunnyExplosion.remove(player);
    436. }
    437.  
    438. if (this.FunnyFireworks.contains(player)) {
    439. this.FunnyFireworks.remove(player);
    440. }
    441.  
    442. if (this.FunnyRedstone.contains(player)) {
    443. this.FunnyRedstone.remove(player);
    444. }
    445.  
    446. if (this.FunnySlime.contains(player)) {
    447. this.FunnySlime.remove(player);
    448. }
    449.  
    450. if (this.FunnyFootstep.contains(player)) {
    451. this.FunnyFootstep.remove(player);
    452. }
    453.  
    454. player.sendMessage(green + "All of your FunnyFoot modes have Turned Off!");
    455. } else {
    456. player.sendMessage(yellow + "HAHA...No Perms...");
    457. }
    458. return true;
    459. }
    460. return true; }
    461. }
    462. else {
    463. sender.sendMessage(red + "You must be ingame to toggle effects for yourself. Use /command <target> to toggle for others.");
    464. }
    465. } else if (args.length == 1) {
    466. if (cmd.getName().equalsIgnoreCase("funnyfire")) {
    467. if (sender.hasPermission("FunnyFoot.fireother")) {
    468. if (Bukkit.getServer().getPlayer(args[0]) != null) {
    469. Player targ = Bukkit.getServer().getPlayer(args[0]);
    470. if (FunnyFoots.FunnyFire.contains(targ)) {
    471. FunnyFoots.FunnyFire.remove(targ);
    472. targ.sendMessage(red + sender.getName() + " has disabled your FunnyFire!");
    473. sender.sendMessage(red + targ.getDisplayName() + "'s FunnyFire has been disabled!");
    474. } else {
    475. FunnyFoots.FunnyFire.add(targ);
    476. targ.sendMessage(yellow + sender.getName() + " has given you FunnyFire!");
    477. sender.sendMessage(yellow + targ.getDisplayName() + " has been given FunnyFire!");
    478. }
    479. } else {
    480. sender.sendMessage(red + "The player " + yellow + args[0] + red + " is either offline or does not exist!");
     
  2. Offline

    funnyman850

  3. Offline

    Rocoty

    Cool. Nice to know.

    In seriousness, though: Did you have a question? You're just posting some code and telling us you are stuck. There is no way we could help you without knowing what the problem is, sorry.

    Side note: I think it would help you greatly if you learned OOP.
     
  4. Offline

    fireblast709

    Remove the useless static please.
     
    es359 likes this.
  5. Offline

    funnyman850

    fireblast709 did nothing.

    Rocoty theres a reason there are forums which is people helping other people -_-
     
  6. Offline

    PluginStudios

    Yes, you do help people when they have specific questions that can actually be answered.... I dont know how I am supposed to help you.
     
  7. Offline

    funnyman850

    PluginStudios how do i explain it more then?

    PluginStudios How do i fix a plugin from returning null on certain commands

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
  8. Offline

    PluginStudios

  9. Offline

    funnyman850

    PluginStudios It says nothing other than the command was issued.
     
  10. Offline

    Necrodoom

  11. Offline

    PluginStudios

  12. Offline

    funnyman850

    PluginStudios [14:27:45] [User Authenticator #1/INFO]: UUID of player funnyman850 is 6fb29783-e5ba-4bad-a450-0537efcc7bb5
    [14:27:46] [Server thread/INFO]: funnyman850[/127.0.0.1:49375] logged in with entity id 106 at ([world] 1128.6623575571307, 72.0, -127.45863520764622)
    [14:28:00] [Server thread/INFO]: funnyman850 issued server command: /funnyfire
    [14:28:02] [Server thread/INFO]: funnyman850 issued server command: /funnyfire
    [14:28:08] [Server thread/INFO]: funnyman850 issued server command: /funnyexplosion
    [14:28:11] [Server thread/INFO]: funnyman850 issued server command: /funnyexplosion
    [14:28:17] [Server thread/INFO]: funnyman850 issued server command: /funnyredstone
    [14:35:22] [Server thread/INFO]: funnyman850 lost connection: Disconnected
    [14:35:22] [Server thread/INFO]: funnyman850 left the game.
     
  13. Offline

    Rocoty

    funnyman850 How do you know it's returning null? What reason lies behind that conclusion?

    EDIT: Also, in this context, what you do mean by "returning null". As far as I know, a command in itself cannot return null. You will have to elaborate a bit on your problem. Tell us the issue. Ask a question if you have to.
     
  14. Offline

    funnyman850

    Rocoty it says null when teh command is run in game.
     
  15. Offline

    Rocoty

    funnyman850 What says null? And what is your expected result? And what command are you talking about?
     
    xTigerRebornx likes this.
  16. Offline

    funnyman850

    Rocoty Minecraft says "null" and it is yellow. The expected result is for a message to come up that is defined in the config and for whatever "foot" to be turned on. The commands it doesnt work on are funnyexplosion, funnyfireworks, funnyslime, funnyfootstep and funnyredstone.
     
  17. Offline

    Rocoty

    My guess is that the keys you are trying to access in the config, do not exist. Therefore you get null, and null is printed.
     
Thread Status:
Not open for further replies.

Share This Page