FireArrow.txt 896 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. event.load("projectile_hit");
  2. @wait
  3. wait();
  4. if(loc_hit != null){
  5. flame = enchantment.getLevel(enchantment.get("flame"), living.getEquip(shooter, "hand"));
  6. if(flame > 0){
  7. if(plot.check(loc_hit, shooter, 3, true)){
  8. loc = entity.getLocation(projectile);
  9. if(block.isAir(loc_hit)){
  10. block.set(loc_hit,"minecraft:fire");
  11. }
  12. if(block.isAir(loc)){
  13. fire_ring(loc,"minecraft:fire",0);
  14. }
  15. }
  16. }
  17. }
  18. goto("wait");
  19. function fire_ring(location,block,radius){
  20. loc_x = loc.getX(location);
  21. loc_y = loc.getY(location);
  22. loc_z = loc.getZ(location);
  23. for(a = -radius; a < radius+1; a++){
  24. loc.setX(location, loc_x + a);
  25. for(b = -radius; b < radius+1; b++){
  26. loc.setY(location, loc_y + b);
  27. for(c = -radius; c < radius+1; c++){
  28. loc.setZ(location, loc_z + c);
  29. if(block.isAir(location)){
  30. block.set(location,block);
  31. }
  32. }
  33. }
  34. }
  35. }