Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //EXPREGEN
- @EventHandler
- public void onbreako1(BlockBreakEvent e) {
- ArrayList<Location> arraylocexp = new ArrayList<Location>();
- if(e.getBlock().getType() == Material.BOOKSHELF) {
- //x ,y, z kleine zahlen
- Location eckpunkt1 = new Location(Bukkit.getWorld("world"), 33, 90, 297);
- //x ,y, z große zahl
- Location eckpunkt2 = new Location(Bukkit.getWorld("world"), 71, 120, 326);
- for(int x = eckpunkt1.getBlockX(); x < eckpunkt2.getBlockX();x++) {
- for(int y = eckpunkt1.getBlockY(); y < eckpunkt2.getBlockY();y++) {
- for(int z = eckpunkt1.getBlockZ(); z < eckpunkt2.getBlockZ();z++) {
- Location loc = new Location(Bukkit.getWorld("world"), x, y, z).add(0.5, 0, 0.5);
- arraylocexp.add(loc);
- }
- }
- }
- //anzahl der drops festlegen!! abhäng von userzahlen ?!
- for(int i = 0;i<30;i++) {
- Random r=new Random();
- int randomNumber=r.nextInt(arraylocexp.size());
- Location randloc = arraylocexp.get(randomNumber);
- ExperienceOrb orb = (ExperienceOrb) Bukkit.getWorld("world").spawnEntity(randloc, EntityType.EXPERIENCE_ORB);
- orb.setExperience(new Random().nextInt(5));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement