[HELP]Set someone on fire within a certain region. [HELP]

Discussion in 'Plugin Development' started by coldguy101, May 14, 2012.

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

    coldguy101

    Hello there, I am making a plugin for my server which sets people on fire when they enter a certain area. I don't want to integrate this with any standing plugin (worldguard). I know that you basically check if a player is within certain coords and outside of other coords (the two points of the corners), but am having trouble still. Any help would be greatly appreciated :D (I have the listener working, all I need is the stored coords/boolean check if the player is within the coords given by a server admin at every startup using the commands /dpos1 and /dpos2 :p) Thanks!
     
  2. Offline

    r0306

    coldguy101
    Use a PlayerMoveEvent to check the player's location (if your listener isn't listening on that already), get their location and check if each of the player's x, y, and z coordinates are within the respective dpos coordinates.
    Code:
    if (player.getLocation().getX() < dpos1.getX() && player.getLocation().getX() > dpos2.getX()) {
    if (player.getLocation().getY() < dpos1.getY() && ... //and so on.
    Then if all the statements are true, set the player on fire.
     
Thread Status:
Not open for further replies.

Share This Page