remove original block
This commit is contained in:
parent
b8e0b32667
commit
1bd01d78a1
1 changed files with 5 additions and 3 deletions
|
|
@ -72,14 +72,16 @@ public class Bbsdfia extends JavaPlugin implements Listener {
|
||||||
// Spawn a new falling block entity with velocity to the north and upward
|
// Spawn a new falling block entity with velocity to the north and upward
|
||||||
World world = entity.getWorld();
|
World world = entity.getWorld();
|
||||||
Location location = entity.getLocation();
|
Location location = entity.getLocation();
|
||||||
Vector velocity = new Vector(0, 1.2, -6);
|
Vector velocity = new Vector(0, 1, -3);
|
||||||
Material material = ((FallingBlock) entity).getBlockData().getMaterial();
|
Material material = ((FallingBlock) entity).getBlockData().getMaterial();
|
||||||
byte data = ((FallingBlock) entity).getBlockData().getAsString().getBytes()[0];
|
byte data = ((FallingBlock) entity).getBlockData().getAsString().getBytes()[0];
|
||||||
FallingBlock newFallingBlock = world.spawnFallingBlock(location, material, data);
|
FallingBlock newFallingBlock = world.spawnFallingBlock(location, material, data);
|
||||||
newFallingBlock.setVelocity(velocity);
|
newFallingBlock.setVelocity(velocity);
|
||||||
|
|
||||||
// Remove the original falling block entity
|
// Remove the original block
|
||||||
entity.remove();
|
Location locationblock = new Location(world, 100, 49, 0);
|
||||||
|
Block block = locationblock.getBlock();
|
||||||
|
block.setType(Material.AIR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue