|
|
Hover over the red "Random" in the line Random ran = new Random and then select Import Class, after that select Random (java.util) Here's a pic:
And for the randomHomePos make sure this line is in World.java under the HOME line
Code:public static final Position randomHomePos = new Position(3085, 3488, 0);
Thanks for you, and for everyone helped me here. It worked fine, I just wanted it with teleport anim instead of " GetMovment"
player.getMovement().teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
I tried to change it to startTele, etc.. I failed. cos there is no tele methods in Player.java, anyway thanks guys.
Change this line:
Change it to:Code:player.getMovement().teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
Code:teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ());
My home command:
case "home": {
Random ran = new Random();
teleport(World.randomHomePos.getX() + ran.nextInt(2),World.randomHomePos.getY() + ran.nextInt(2),World.randomHomePos.getZ()); ([Only registered and activated users can see links. ])
return true;
}
And this is what I have in World.java
public static final Position EDGEHOME = Position.of(3085, 3492, 0);
public static final Position HOME = new Position(3085, 3488, 0);
public static final Position randomHomePos = new Position(3085, 3488, 0);
| « Any great tips on how to run a server? | Collection Log not showing items » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |