Access Minecraft.getminecraft()....

Discussion in 'Plugin Development' started by JoloCodeBrahs, Aug 21, 2015.

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

    JoloCodeBrahs

    When looking at a bukkit plugin code for a command how would you access Minecraft.getminecraft()? since server build from minecraft you should be able to access it....
     
  2. Offline

    SkyleTyler1337

  3. Offline

    JoloCodeBrahs

    @SkyleTyler1337 Minecraft.getMinecraft().thePlayer.getHealth(); for an example but not exactly what i using.
     
  4. Online

    timtower Administrator Administrator Moderator

    @JoloCodeBrahs That would be forge modding...
    That isn't accessible with Bukkit
     
  5. Offline

    RainoBoy97

    Player#getHealth is what you'd want to use server-side.
     
  6. Offline

    JoloCodeBrahs

    Must be some way to access it.

    Blank
     
    Last edited by a moderator: Aug 21, 2015
  7. Offline

    mythbusterma

    @JoloCodeBrahs

    I'm sorry, I really don't think you know what you're talking about.

    Minecraft is not the name of any class that is distrubted in the server file. And therefore there is no method with the signature Minecraft.getMinecraft()

    I suggest you listen to the people above you.
     
  8. Offline

    JoloCodeBrahs

    Ok.. how would you get user client settings? Version checking the player..
     
  9. Offline

    mythbusterma

    @JoloCodeBrahs

    Well, if your server is 1.8+ and they connect to it, they're using version 1.8+.
     
  10. Offline

    JoloCodeBrahs

    I'll go ask on other non-politicallized forums.
     
  11. Offline

    mythbusterma

    @JoloCodeBrahs

    There's nothing political about my answer? There's just no practical reason for a server side plugin to need to know a client's version beyond a major release (and there's no way to get it beyond looking at the handshake packet: http://wiki.vg/Protocol_version_numbers).
     
    ferrybig likes this.
  12. Offline

    JoloCodeBrahs

    @mythbusterma don't mean to cause stupid trouble..
    Sorry.

    And I don't use forge to mod. I do it from scratch.
     
    Last edited by a moderator: Aug 21, 2015
  13. Online

    timtower Administrator Administrator Moderator

    @JoloCodeBrahs We have the Bukkit API. It has a getPlayer method in the server class, we can do everything with it.
     
  14. Offline

    Cirno

    Not a lot of client-modding is transferable to Bukkit; Bukkit is an entirely different monster in that it's an API and not the actual server itself. Getting the version, I know how to fetch this, but it requires CraftBukkit or something similar, which you can't currently get anywhere (at least legally).
     
Thread Status:
Not open for further replies.

Share This Page