1.7.5 arrow field

Discussion in 'Plugin Development' started by Elimnator, Apr 6, 2014.

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

    Elimnator

    I am getting errors with 1.7.5 when I try to run my plugin.
    Code:java
    1. public void setArrowLife(Entity arrow, int lifeSet){
    2. if(arrow instanceof Arrow){
    3. CraftArrow ca = (CraftArrow)arrow;
    4. EntityArrow ea = (EntityArrow)ca.getHandle();
    5. try {
    6. Field life = ea.getClass().getDeclaredField("j");
    7. life.setAccessible(true);
    8. life.set(ea,-lifeSet);
    9. } catch(Exception e) {
    10. e.printStackTrace();
    11. }
    12. }
    13. }

    The error is:
    java.lang.NoSuchFieldException: j

    Anyone know that that field is now in 1.7.5?

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

    BillyGalbreath

    Spigot is an unsupported mod, and this is not related to the Bukkit API.
     
  3. Offline

    Elimnator

    BillyGalbreath
    Yes, I changed this topic to my real error which had nothing to do with Spigot.
     
  4. Offline

    BillyGalbreath

    This is still an NMS question, which has nothing to do with the Bukkit API.
     
  5. Offline

    Elimnator

    BillyGalbreath
    So?... I still am asking it.

    I think I found it, the new field is "h"

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

    Codex Arcanum

    BillyGalbreath
    No offense intended, but I think questions about use of NMS are completely within the purview of these forums - particularly if you consider the amount of beginning Java questions (how do switch statements operate? Why is my control flow logic not working as intended?) that show up every day.
     
  7. Offline

    RawCode

    you have invalid NMS coding strategy.

    1) Open source code
    2) Read it
    3) Get proper names of fields

    asking on forum "please open source code for me and tell me field name" is not valid.
     
Thread Status:
Not open for further replies.

Share This Page