Method

Discussion in 'Plugin Development' started by micrlink, Jan 2, 2013.

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

    micrlink

    How would you make a method that you could in your plugin use player.(Method)
     
  2. Offline

    Jogy34

    I don't quite understand what you are trying to do
     
  3. Offline

    keelar

    You can't add methods to Player. You would have to wrap Player in a separate class.
     
  4. Offline

    micrlink

    ok thanks
     
  5. Offline

    tommycake50

    create a class extending player.
     
  6. Offline

    Sagacious_Zed Bukkit Docs

    Inheriting player leads to some weird situations as bukkit will only ever return the player bukkit knows about, e.g. not PluginExtendedPlayer.

    The other way around this is to make essentially a utils class with methods that take the player as the first argument
     
  7. Offline

    tommycake50

    yes but you can cast the player to the modified player that you made can you not?
     
  8. Offline

    Jogy34

    No you can't as the player that bukkit gives you isn't one of your new players. You can always just make a class that takes in a player and use that instead of the player object
     
Thread Status:
Not open for further replies.

Share This Page