Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HashMap<Material, Location> block = new HashMap<>();
- @EventHandler
- public void Blockläufer(PlayerMoveEvent e) {
- Player p = e.getPlayer();
- if (p.hasMetadata("angel")) {
- if (p.getLocation().add(0, -1, 0).getBlock().getType().equals(Material.AIR)) {
- p.getLocation().add(0, -1, 0).getBlock().setType(Material.GLASS);
- block.put(Material.GLASS, p.getLocation().add(0,-1,0));
- Bukkit.getScheduler().scheduleAsyncDelayedTask(Main.getPlugin(), new Runnable() {
- @Override
- public void run() {
- Bukkit.getScheduler().runTask(Main.getPlugin(), new Runnable() {
- @Override
- public void run() {
- block.get(Material.GLASS).getBlock().setType(Material.AIR);
- Bukkit.broadcastMessage("remove");
- }
- });
- }
- }, 20);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement