Advertisement
supersaiyansubtlety

dimensional_marker.sc

Apr 23rd, 2021
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. global_overworld = 'overworld';
  2. global_nether = 'the_nether';
  3. global_valid_dims = {global_overworld, global_nether};
  4.  
  5. __config() -> {
  6. 'commands' ->
  7. {
  8. '' -> _() -> main(),
  9. }
  10. };
  11.  
  12. main() -> (
  13. print('this is a root call');
  14. player = player();
  15. dim = query(player, 'dimension');
  16. other_dim;
  17. print('dim: ' + dim);
  18. if (!has(global_valid_dims, dim), print('Markers can only be created while in the nether or the overworld'); return(););
  19.  
  20. oCoords;
  21. nCoords;
  22.  
  23. if (dim == global_overworld, (
  24. other_dim = global_nether;
  25. oCoords = query(player, 'pos');
  26. delete(oCoords, 1); //delete y
  27. nCoords = [];
  28. for (oCoords, (
  29. put(nCoords, _i, _/8);
  30. ));
  31.  
  32. print('oCoords: ' + oCoords);
  33. print('nCoords: ' + nCoords);
  34. ), //else
  35. (
  36. other_dim = global_overworld;
  37. nCoords = query(player, 'pos');
  38. delete(nCoords, 1); //delete y
  39.  
  40. oCoords = [];
  41. for (nCoords, (
  42. put(oCoords, _i, _*8);
  43. ));
  44. ));
  45.  
  46. in_dimension(global_overworld, draw_shape('line', -1,
  47. {
  48. 'from' -> [get(oCoords, 0), 0, get(oCoords, 1)],
  49. 'to' -> [get(oCoords, 0), 255, get(oCoords, 1)]
  50. }));
  51.  
  52. in_dimension(global_nether, draw_shape('line', -1,
  53. {
  54. 'from' -> [get(nCoords, 0), 0, get(nCoords, 1)],
  55. 'to' -> [get(nCoords, 0), 255, get(nCoords, 1)]
  56. }));
  57. )
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement