I have a main 'core' plugin which all of my other plugins depend on. In my core plugin, there is a way that it disables itself is it has been tampered with (someone has tried to crack my plugin). Is it possible to disable all of my other plugins that depend on my main one when I disable it? (Disable the other plugins from my main plugin) or do I have to create a check in each of the plugins to check if it has been disabled or not.
If it disables before the others load then it should stop the others if its a hard dependancy. Possible try using onLoad() instead of onEnable(), not sure if it will work but the logic is there.
A locked door only keeps out honest people Go through each plugin given by Bukkit#getPluginManager() and check what plugin they depend on and disable them if their depends contains your plugin
PluginDescriptionFile#getDepend returns a list of plugin names that its respective JavaPlugin depends on. You can get the PluginDescriptionFile with JavaPlugin#getDescription.
How would I go about doing this if my main core plugin loads before all of my others? If my other plugins arent loaded yet then I cant get them to disable them. At this point I just dont think what I want to do is possible.
You made it sound like you were trying to disable them if the core disabled while the server was running rather than starting. If you have your dependencies set up properly in your plugin.yml, plugins will only be enabled if their dependencies are also enabled.
Your plugins should 'depend' upon your core plugin. Code your plugins to depend upon the core being loaded. Perhaps a code excerpt should be provided by yourself, for more focused assistance?
Are you trying to disable plugins that already loaded and your core is disabled? As the only real way is to either use the event PluginDisableEvent and check if it’s your plugin or run a task. The first option is the safer and less heavy thing to do.