Solved Using plugins, or otherwise modifying them in your own

Discussion in 'Plugin Development' started by Build_and_Break, Jul 15, 2014.

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

    Build_and_Break

    Hi,

    I was wondering, if I wanted to make a plugin which imported another plugin and dealt with it's code, how would I go about doing it? Also, is there any way to modify a plugin without completely decompiling it?

    Example: I want to make a plugin that grabs an integer from a minigame plugin. This integer is a player's score. I want the score to be broadcasted. How would I go about importing and getting that integer?

    Thanks,
    Build

    Of course, this is all assuming I have an author's permission to modify their plugin. :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  2. Offline

    JBoss925

    Add the plugin as a library just like craftbukkit and then as long as the mini game plugin is in the plugins folder then you're golden. But you have to know where the integer is stored.
     
  3. Offline

    Build_and_Break

    Okay, so say I know which class it is stored in. Would I import it just like I would a bukkit import?
     
  4. Offline

    JBoss925

    Yes. Just make sure you have it in your libraries because it needs to be present during compilation and then in the plugins folder because it needs to be present during runtime.
     
  5. Offline

    Build_and_Break

    Alright. So if the integer is called "int" and I've imported the class, can I just do

    Code:java
    1. Bukkit.broadcastMessage("Score: " + int);

    or do I have to do anything else?
     
  6. Offline

    JBoss925

    You have to get it from a construct of the class. Normally they'll have a method in there like getPlayerScore(Player player) or something to that effect.
     
  7. Offline

    Build_and_Break

  8. Offline

    JBoss925

    Np. Happy coding!
     
Thread Status:
Not open for further replies.

Share This Page