Set a players name red

Discussion in 'Plugin Development' started by XgXXSnipz, Nov 22, 2014.

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

    XgXXSnipz

    Hey guys, Im making a plugin where when a player hits someone their name turns red for 25 seconds, now I need to make it so it works with TagAPI but the methods only seem to be accessible when I use the receive name tag method but IDK how to use it when using a damage event
    Code:java
    1. @EventHandler
    2. public void onHit(final EntityDamageByEntityEvent e){
    3.  
    4.  
    5. if(e.getDamager() instanceof Player){
    6. Bukkit.getScheduler().runTaskLater(this, new Runnable() {
    7. Player p =(Player)e.getEntity();
    8.  
    9. @Override
    10. public void run() {
    11.  
    12. }
    13.  
    14. }, 250L);
    15. }
    16.  
    17. }
    18.  
     
  2. Offline

    Skionz

  3. Offline

    teej107

    rbrick likes this.
  4. Offline

    XgXXSnipz

    Skionz no I know but if you do TagAPI out side this event handler
    Code:java
    1. AsyncPlayerReceiveNameTagEvent
    you can use all the methods, meaning I cant use TagAPI without using that method
     
  5. Offline

    Monkey_Swag

    XgXXSnipz just setup a boolean or an arraylist....
     
  6. Offline

    XgXXSnipz

  7. Offline

    Monkey_Swag

    XgXXSnipz
    *player was hit*
    *add to some list*
    *tagapi event*
    *check if player is in list*
    *if he is, make his name red*
    *runnable --> make name white*
    Ta-da!
     
  8. Offline

    XgXXSnipz

    Monkey_Swag ik how do i access the tagapi methods... thats all im asking because TagAPI only has like 4 when i use it outside of the
    Code:java
    1. AsyncPlayerReceiveNameTagEvent
     
  9. Offline

    WesJD

    XgXXSnipz
    You have to understand how TagAPI works before using it. Simple as that.
     
  10. Offline

    XgXXSnipz

    WesJD can you show me
     
  11. Offline

    WesJD

    XgXXSnipz
    Stop coming here to get spoonfed code.
     
  12. Offline

    XgXXSnipz

    WesJD I dont wanna be spoonfed
     
  13. Offline

    teej107

  14. Offline

    WesJD

    XgXXSnipz
    Show me your code after attempting to do it. Then I'll help you.
     
  15. Offline

    xepisolonxx

    WesJD He barely started learning java as of october 2014 i have him on skype he ask for code all the time
    and XgXXSnipz check within the tagapi methods especially under the section where it says
     
  16. Offline

    XgXXSnipz

    xepisolonxx I never asked you for code... I just asked for coins cause conn was getting antsy...
     
  17. Offline

    WesJD

    xepisolonxx
    Spoonfeeding doesn't make the user learn at all.
     
  18. Offline

    mastermustard

    Well if he has only been learning code for a month then maybe he should keep learning before attempting to do things he has yet to learn how to do. Asking for the code is by no means a way to learn until you give an attempt at it but can't find out how. Api's have documentation for a reason they tell you how to utilize the code if many others have used it no problem why cant he?
     
  19. Offline

    Skionz

    You have to learn to walk before learning to ride a bike. Same goes for Java. You have to learn Java before learning a Java API.
     
  20. Offline

    Gater12

    Was expecting something different, but ok.
     
  21. Offline

    jeroenhero123

    Use: p.setDisplayName(ChatColor.RED + p.getName());
     
  22. Offline

    Skionz

    He wants to change their tag to red.
     
Thread Status:
Not open for further replies.

Share This Page