I'm trying to make a plugin that takes a lot of different arguments of different types but I don't know how to check to see if they are valid types with what I need. Here is the code I have for my type that I need, but I don't know how to do the argument checks other than String. This is the data type that I'm using. Code:java package com.gmail.betorages.drawbridge; public class DrawBridges { private double[] coordinates; private String name; private int length; private int width; private String direction; private int blockID; public void DrawBridges(String name, double[] coordinates, int length, int width, String direction, int blockID){ this.coordinates = coordinates; this.name = name; this.length = length; this.width = width; this.direction = direction; this.blockID = blockID; }} And here is the command where I try and parse to see if they are the correct types before sending them through. Code:java @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { boolean create = false; if (args.length == 2) { sender.sendMessage("Deleting Drawbridge."); return true; } else if(args.length == 6){ sender.sendMessage("Creating Drawbridge."); if (args[0] instanceof String){ if(args[1] ) } } return false; } //Below is where it's sending, so you know what types I need in case that helps.public void create(String sender, String name, double[] coordinates, int length, int width, String direction, int blockID)
You could possibly just skip checking if they're the right data types, but you won't get to put a custom message when the player messes it up, it'll just say An error has occurred. Also, console might get error spammed.