Hook in Factions?

Discussion in 'Plugin Development' started by JustForNothing, Jan 1, 2013.

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

    JustForNothing

    Hey, i am new in making plugins, i wanna to know, how can i hook into factions? I just wanna to do if player create a factions, it will take from his equipment items :)
     
  2. Offline

    fireblast709

    • add Factions.jar as a library just like you do with Bukkit.jar
    • in your plugin.yml add the following
      Code:
      depend: [Factions]
    • now you can get the main class via Bukkit
    Code:java
    1. // Factions main class
    2. public P factions;
    3. // onEnable()
    4. public void onEnable()
    5. {
    6. if(Bukkit.getPluginManager().getPlugin("Factions") != null)
    7. {
    8. this.factions = (P)Bukkit.getPluginManager().getPlugin("Factions");
    9. }
    10. else
    11. {
    12. // Factions is not found, disable plugin
    13. Bukkit.getPluginManager().disablePlugin(this);
    14. return;
    15. }
    16. }

    Now you can use the Factions methods via the 'factions' variable
     
  3. Offline

    JustForNothing

    Thanks, but is there something like a api this plugin? Or if you know, how can i check if command is from this plugin, and it is /f create (i don't wanna : if (command.getname().equalsignorecase("f create"));
     
  4. Offline

    fireblast709

  5. Offline

    JustForNothing

  6. Offline

    fireblast709

    you can listen to the event, and get the player when he creates a faction. Then with that player, you can clear his armor
     
Thread Status:
Not open for further replies.

Share This Page