SHARE
TWEET

Untitled

a guest May 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //imports
  2. import java.util.ArrayList;
  3. import org.bukkit.entity.Player;
  4.  
  5. //1.
  6. public static ArrayList<Player> Baumodus = new ArrayList<>();
  7.  
  8. //2.
  9. @Override
  10.     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  11.         Player p = null;
  12.         if (sender instanceof Player){
  13.             p = (Player) sender;
  14.         }
  15.  
  16.         if (command.getName().equalsIgnoreCase("bauen")){
  17.             Baumodus.add(p);
  18.             player.getInventory().clear();
  19.             p.setGameMode(GameMode.CREATIVE);
  20.             return true;
  21.         } else if (command.getName().equalsIgnoreCase("spielen")){
  22.             Baumodus.remove(p);
  23.             p.setGameMode(GameMode.SURVIVAL);
  24.             return true;
  25.         }
  26.  
  27.         return false;      
  28.  
  29.     }
RAW Paste Data
Want to get better at Java?
Learn to code Java in 2017
Top