So I have a command, /uplift, that you do /uplift <radius> and all entities within that radius will be thrown upwards. I was wondering how I would get it to also pick random blocks in that radius and also throw them up so it looks like the ground "shot up". Thanks for any help
jthort I haven't tried anything yet because I have no clue how to do it. But, This is my other code: Code: if(commandLabel.equalsIgnoreCase("uplift")){ if(player.isOp()){ int x = Integer.parseInt(args[0]); for(Entity e : player.getNearbyEntities(x, x, x)){ Location location = e.getLocation(); double pitch = ((location.getPitch() + 90) * Math.PI) / 180; double yaw = ((location.getYaw() + 90) * Math.PI) / 180; double x1 = Math.sin(pitch) * Math.cos(yaw); double y = Math.sin(pitch) * Math.sin(yaw); double z = 10; Vector vector = new Vector(x1, z, y); e.setVelocity(vector); } } }
the best way to do this would be to manipulate packets. i have done this before by spawning invisible bats and locking a falling block to that bats position.
thecrystalflame Ok. But im not sure how to do that. Also how would I make it choose random blocks around the player and not all of them.