Solved KitPvP 1v1 Plugin Help

Discussion in 'Plugin Development' started by MayoDwarf, Sep 10, 2013.

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

    MayoDwarf

    EDIT: Removed Source Code
     
  2. Offline

    xxMOxMOxx

    Cast X Y and Z to doubles
     
  3. Offline

    MayoDwarf

    EDIT: Removed Source Code
     
  4. Offline

    xxMOxMOxx

    Switch the last line back to
    Code:java
    1. player.teleport(Bukkit.getWorld("world"), x, y, z);
     
  5. Offline

    MayoDwarf

    Nope still error like this under teleport teleport
     
  6. Offline

    xxMOxMOxx

    Throw in a debug line after each IF to see how far the codes getting
     
  7. Offline

    MayoDwarf

    Fixed by myself lol.

    This fixed it: player.teleport(new Location(Bukkit.getWorld("" + config.getInt("world")), x, y, z));

    xxMOxMOxx Now for my event how would I get the player they left clicked?

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

    xxMOxMOxx

    Code:java
    1. if(event.getAction()==Action.LEFT_CLICK_AIR){
    2. //stuff
    3. }
     
  9. Offline

    WauloK

    Maybe:

    Code:java
    1. Bukkit.getServer().getWorld("World");
     
  10. Offline

    MayoDwarf

    I mean the player they left clicked with the blaze rod. Not the player who did it.
     
  11. Offline

    xxMOxMOxx

    You could use a PlayerInteractEntityEvent, but I think that only covers right clicks
     
  12. Offline

    uyuyuy99

    You'd need to use an EntityDamageByEntityEvent, rather than a PlayerInteractEvent. Then, use event.getDamager() to get the challenger and event.getEntity() to get the target player. Of course, you'd need to verify that both of the entities are Players.
     
  13. Offline

    MayoDwarf

    Any other way? bc they won't be able to pvp until they find an opponent.
     
  14. Offline

    xxMOxMOxx

    If you set the event priority to MONITOR and have it ignore if the events cancelled, it MIGHT catch it before whatever plugin is being used to block PVP
     
  15. Offline

    uyuyuy99

    MayoDwarf It's fine, just set the priority of the event to LOWEST if there's another plugin preventing PvP. Just because an EntityDamageByEntityEvent runs doesn't mean the entity will actually be damaged; the event can be cancelled.

    Edit: xxMOxMOxx No, MONITOR is the opposite of what he should use. Though if he ignores cancelled events, then I suppose it doesn't really matter.
     
  16. Offline

    MayoDwarf

    I want pvp to be enabled as this is a 1v1 pvp plugin. What if I cancel the event, will it still be able to get the damager and target clicked?
     
  17. Offline

    uyuyuy99

  18. Offline

    MayoDwarf

    Ok so how would I do this?
     
  19. Offline

    uyuyuy99

    MayoDwarf How would you do what exactly? I already explained it. And getting the damager & target is done in exactly the same way if the event was cancelled.
     
  20. Offline

    MayoDwarf

    Never mind I figured it all out haha on my own! Thanks for the help tho! :p :)
     
  21. Offline

    SgtbubblezZ

    when this is done will you post it here?
     
  22. Offline

    MayoDwarf

    Nope, on my bukkitDev page :p
     
  23. Offline

    SgtbubblezZ

    when this is done will you post it here?

    sorry double post :p

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

    MayoDwarf

    lol and just check my BukkitDev page soon haha :p :)
     
  25. Offline

    Garris0n

    You shouldn't remove the code, somebody could have the same issue and have to make a new thread.
     
  26. Offline

    MayoDwarf

    Lol if someone needs help with coding just tag me haha
     
  27. Offline

    SgtbubblezZ

    MayoDwarf Will this work with other plugins? Because I am using KingKits ATM and I don't want to have to change my kit plugins :L. Can you make it so it gives full iron armor, a diamond sword and just a hotbar of soup? (If you need a reference, go to kitpvp.com and warp to 1v1)
     
  28. Offline

    MayoDwarf

    This is a seperate plugin and has it's own kits coded into it. /1v1 will give you the blaze stick and a clay ball. When finding a match you will get your iron armor, diamond sword and soups. Please do not post here anymore also. Just pm me :p
     
  29. Offline

    LazyLemons

    If you don't know how to copy a server, you shouldn't copy it at all.
     
    JHalt and chasechocolate like this.
  30. Offline

    JHalt

    And Lemons puts it best.
     
Thread Status:
Not open for further replies.

Share This Page