Hey guys I try to develop my first minecraft plugin. The idea was that you can stay on One block, look at it, type one command and the block change the Position vertically. Like an easy elevator. But I cant find something in the Bukket API or in the internet to solve this problem. I'm afraid the Block object hasn't the ability to change their location. I hope you have an idea how to move a block vertically.
Change he Location one tile higher set the Blocktype at the new Location to your desired blocktype and teleport the player to the new location. (and set the Block at the old Location to Air)
Try making a plugin that works with WorldEdit and automatically selects the block and moves it vertical.
easy. put this code in a async task Code: Location loc = p.getLocation().add(0,-1,0); Block block = loc.getBlock(); for (int i = 0; i < 5; i++) { Material type = block.getType(); block.setType(Material.AIR); block = loc.add(0, i, 0).getBlock(); block.setType(type); try { Thread.sleep(200); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } let me know if works EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Wow you answer my question quite fast. The code example works! (if you teleport the player when the block material is changing) Thanks for help
Don't use Thread.sleep(); Use some sort of functions that you made, add it to your code everywhere and then if its enabled then just stop it, else continue.