lava_test.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. event.load("bucket_use");
  2. block_to_destroy = "minecraft:lava";// < wichtig
  3. lava_max = 200;// < wichtig
  4. @wait
  5. wait();
  6. if(player.getName(player) == "SirTerence7"){//---------------- wichtig >
  7. if(has_block){
  8. if(block_type == block_to_destroy){
  9. lava.get(block_loc);
  10. }
  11. }//----------------------------------------------------------- <
  12. }
  13. goto("wait");
  14. //------------------------------------------------------------ das auch >>
  15. function lava.get(block_loc){
  16. lava_counter = 0;
  17. $lava_locs = list.new();
  18. list.add($lava_locs, block_loc);
  19. while(list.getSize($lava_locs) != 0){
  20. block_loc = list.getIndex($lava_locs, 0);
  21. list.removeIndex($lava_locs, 0);
  22. lava.add_lava(loc.mod(block_loc,1,0,0));
  23. lava.add_lava(loc.mod(block_loc,-1,0,0));
  24. lava.add_lava(loc.mod(block_loc,0,1,0));
  25. lava.add_lava(loc.mod(block_loc,0,-1,0));
  26. lava.add_lava(loc.mod(block_loc,0,0,1));
  27. lava.add_lava(loc.mod(block_loc,0,0,-1));
  28. lava_counter++;
  29. if(lava_counter > $lava_max - 1) {
  30. break;
  31. }
  32. }
  33. }
  34. function lava.add_lava(temp_loc){
  35. if(block.getType(temp_loc) == $block_to_destroy){
  36. list.add($lava_locs, temp_loc);
  37. block.set(temp_loc, "minecraft:air");
  38. }
  39. }