mineday.txt 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /*
  2. ----TODO----
  3. Haltbarkeit der Werkzeuge reduzieren
  4. */
  5. msg("dev", "§bMineday §rwurde geladen.");
  6. event.load("inv-click");
  7. event.load("entity-hurt");
  8. event.load("block-click");
  9. event.load("block-break");
  10. event.load("block-place");
  11. setVar("honeyhead", read.item("{id:'minecraft:skull',Count:1b,tag:{SkullOwner:{Id:'04182810-16ad-4491-ab70-ba4244488e7e',Properties:{textures:[0:{Value:'eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMThjMmNkZGVlZDYyNGE1MzhmMzQ5ZDhjNzAzNWZlZjkxOGU2ZDdhMTc4MTYzMWVhYzUxZWMxODI3MTJhNTRkYSJ9fX0='}]}},display:{Name:'Honey Pot'}},Damage:3s}"));
  12. setVar("applehead", read.item("{id:'minecraft:skull',Count:1b,tag:{SkullOwner:{Id:'ad04b162-ae44-4e40-8c5b-9271cb3a40d6',Properties:{textures:[0:{Value:'eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2JiMzExZjNiYTFjMDdjM2QxMTQ3Y2QyMTBkODFmZTExZmQ4YWU5ZTNkYjIxMmEwZmE3NDg5NDZjMzYzMyJ9fX0='}]}},display:{Name:'Apple'}},Damage:3s}"));
  13. setVar("appletemplate", read.location("rpg:-55:23:-550"));
  14. setVar("honeytemplate", read.location("rpg:-54:23:-550"));
  15. setVar("resetbuttonloc", read.location("rpg:-56:23:-550"));
  16. setVar("woolloc1", read.location("rpg:-72:24:-566"));
  17. setVar("copper", read.customitem("COPPER_COIN", 1));
  18. setVar("silver", read.customitem("SILVER_COIN", 1));
  19. setVar("gold", read.customitem("GOLD_COIN", 1));
  20. list.new("coins");
  21. list.add($coins, $copper);
  22. list.add($coins, $copper);
  23. list.add($coins, $copper);
  24. list.add($coins, $silver);
  25. list.add($coins, $silver);
  26. list.add($coins, $silver);
  27. list.add($coins, $gold);
  28. list.add($coins, $gold);
  29. list.add($coins, $gold);
  30. list.add($coins, $copper);
  31. list.add($coins, $copper);
  32. list.add($coins, $copper);
  33. list.add($coins, $silver);
  34. list.add($coins, $silver);
  35. list.add($coins, $silver);
  36. list.add($coins, $gold);
  37. list.add($coins, $gold);
  38. list.add($coins, $gold);
  39. list.new("text");
  40. list.add($text, "§r1 Kupfer einzahlen");
  41. list.add($text, "§r8 Kupfer einzahlen");
  42. list.add($text, "§r64 Kupfer einzahlen");
  43. list.add($text, "§r1 Silber einzahlen");
  44. list.add($text, "§r8 Silber einzahlen");
  45. list.add($text, "§r64 Silber einzahlen");
  46. list.add($text, "§r1 Gold einzahlen");
  47. list.add($text, "§r8 Gold einzahlen");
  48. list.add($text, "§r64 Gold einzahlen");
  49. list.add($text, "§r1 Kupfer abheben");
  50. list.add($text, "§r8 Kupfer abheben");
  51. list.add($text, "§r64 Kupfer abheben");
  52. list.add($text, "§r1 Silber abheben");
  53. list.add($text, "§r8 Silber abheben");
  54. list.add($text, "§r64 Silber abheben");
  55. list.add($text, "§r1 Gold abheben");
  56. list.add($text, "§r8 Gold abheben");
  57. list.add($text, "§r64 Gold abheben");
  58. list.new("amounts");
  59. list.add($amounts, 1);
  60. list.add($amounts, 8);
  61. list.add($amounts, 64);
  62. list.add($amounts, 1);
  63. list.add($amounts, 8);
  64. list.add($amounts, 64);
  65. list.add($amounts, 1);
  66. list.add($amounts, 8);
  67. list.add($amounts, 64);
  68. list.add($amounts, 1);
  69. list.add($amounts, 8);
  70. list.add($amounts, 64);
  71. list.add($amounts, 1);
  72. list.add($amounts, 8);
  73. list.add($amounts, 64);
  74. list.add($amounts, 1);
  75. list.add($amounts, 8);
  76. list.add($amounts, 64);
  77. inv.new("bankmenu", 18, "Bank");
  78. setVar("i", -1);
  79. while(less(inc("i"), list.getSize($text))) {
  80. setVar("temp", list.getIndex($coins, $i));
  81. item.setName($temp, list.getIndex($text, $i));
  82. item.setAmount($temp, list.getIndex($amounts, $i));
  83. inv.setItem($bankmenu, $i, $temp);
  84. }
  85. removeVar("temp");
  86. setVar("copper", read.customitem("COPPER_COIN", 1));
  87. setVar("silver", read.customitem("SILVER_COIN", 1));
  88. setVar("gold", read.customitem("GOLD_COIN", 1));
  89. list.new("flowerlocs");
  90. list.add($flowerlocs, read.location("rpg:-70:23:-565"));
  91. list.add($flowerlocs, read.location("rpg:-71:23:-565"));
  92. list.new("mushroomlocs");
  93. list.add($mushroomlocs, read.location("rpg:-77:23:-555"));
  94. list.add($mushroomlocs, read.location("rpg:-78:23:-555"));
  95. list.new("ironorelocs");
  96. list.add($ironorelocs, read.location("rpg:-79:23:-565"));
  97. list.add($ironorelocs, read.location("rpg:-79:23:-564"));
  98. list.add($ironorelocs, read.location("rpg:-79:24:-564"));
  99. list.add($ironorelocs, read.location("rpg:-60:23:-559"));
  100. list.add($ironorelocs, read.location("rpg:-60:23:-560"));
  101. list.new("grasslocs");
  102. list.add($grasslocs, read.location("rpg:-77:23:-560"));
  103. list.add($grasslocs, read.location("rpg:-77:23:-562"));
  104. list.add($grasslocs, read.location("rpg:-75:23:-564"));
  105. list.add($grasslocs, read.location("rpg:-72:23:-565"));
  106. list.add($grasslocs, read.location("rpg:-70:23:-566"));
  107. list.add($grasslocs, read.location("rpg:-70:23:-571"));
  108. list.add($grasslocs, read.location("rpg:-71:23:-572"));
  109. list.add($grasslocs, read.location("rpg:-72:23:-573"));
  110. list.add($grasslocs, read.location("rpg:-59:23:-564"));
  111. list.add($grasslocs, read.location("rpg:-58:23:-563"));
  112. list.add($grasslocs, read.location("rpg:-57:23:-562"));
  113. list.add($grasslocs, read.location("rpg:-56:23:-561"));
  114. list.add($grasslocs, read.location("rpg:-56:23:-560"));
  115. set.new("farmedappletrees");
  116. set.new("farmedhoneytrees");
  117. list.new("appletreelocs");
  118. list.add($appletreelocs, read.location("rpg:-68:24:-572"));
  119. list.new("applelocs0");
  120. list.add($applelocs0, read.location("rpg:-67:26:-573"));
  121. list.add($applelocs0, read.location("rpg:-67:26:-571"));
  122. list.add($applelocs0, read.location("rpg:-69:26:-571"));
  123. list.add($applelocs0, read.location("rpg:-69:26:-573"));
  124. list.new("honeytreelocs");
  125. list.add($honeytreelocs, read.location("rpg:-72:24:-574"));
  126. list.new("honeylocs0");
  127. list.add($honeylocs0, read.location("rpg:-71:26:-573"));
  128. list.add($honeylocs0, read.location("rpg:-73:26:-573"));
  129. list.add($honeylocs0, read.location("rpg:-71:26:-575"));
  130. list.add($honeylocs0, read.location("rpg:-73:26:-575"));
  131. list.new("mine0");
  132. list.add($mine0, read.location("rpg:-62:23:-569"));
  133. list.add($mine0, read.location("rpg:-61:23:-569"));
  134. list.add($mine0, read.location("rpg:-63:23:-570"));
  135. list.add($mine0, read.location("rpg:-62:23:-570"));
  136. list.add($mine0, read.location("rpg:-61:23:-570"));
  137. list.add($mine0, read.location("rpg:-60:23:-570"));
  138. list.add($mine0, read.location("rpg:-64:23:-571"));
  139. list.add($mine0, read.location("rpg:-63:23:-571"));
  140. list.add($mine0, read.location("rpg:-62:23:-571"));
  141. list.add($mine0, read.location("rpg:-61:23:-571"));
  142. list.add($mine0, read.location("rpg:-60:23:-571"));
  143. list.add($mine0, read.location("rpg:-59:23:-571"));
  144. list.add($mine0, read.location("rpg:-63:23:-572"));
  145. list.add($mine0, read.location("rpg:-62:23:-572"));
  146. list.add($mine0, read.location("rpg:-61:23:-572"));
  147. list.add($mine0, read.location("rpg:-60:23:-572"));
  148. list.add($mine0, read.location("rpg:-61:23:-573"));
  149. list.add($mine0, read.location("rpg:-62:24:-569"));
  150. list.add($mine0, read.location("rpg:-61:24:-569"));
  151. list.add($mine0, read.location("rpg:-63:24:-570"));
  152. list.add($mine0, read.location("rpg:-62:24:-570"));
  153. list.add($mine0, read.location("rpg:-61:24:-570"));
  154. list.add($mine0, read.location("rpg:-60:24:-570"));
  155. list.add($mine0, read.location("rpg:-64:24:-571"));
  156. list.add($mine0, read.location("rpg:-63:24:-571"));
  157. list.add($mine0, read.location("rpg:-62:24:-571"));
  158. list.add($mine0, read.location("rpg:-61:24:-571"));
  159. list.add($mine0, read.location("rpg:-60:24:-571"));
  160. list.add($mine0, read.location("rpg:-59:24:-571"));
  161. list.add($mine0, read.location("rpg:-63:24:-572"));
  162. list.add($mine0, read.location("rpg:-62:24:-572"));
  163. list.add($mine0, read.location("rpg:-61:24:-572"));
  164. list.add($mine0, read.location("rpg:-60:24:-572"));
  165. list.add($mine0, read.location("rpg:-61:24:-573"));
  166. list.new("oaktreelocs");
  167. list.add($oaktreelocs, read.location("rpg:-77:23:-571"));
  168. list.new("oaktree");
  169. list.add($oaktree, "0:0:0");
  170. list.add($oaktree, "0:1:0");
  171. list.add($oaktree, "0:2:0");
  172. list.add($oaktree, "0:3:0");
  173. list.add($oaktree, "0:3:0");
  174. list.add($oaktree, "0:4:0");
  175. list.add($oaktree, "0:5:0");
  176. list.add($oaktree, "1:3:0");
  177. list.add($oaktree, "0:3:1");
  178. list.add($oaktree, "1:3:1");
  179. list.add($oaktree, "-1:3:0");
  180. list.add($oaktree, "-1:3:1");
  181. list.add($oaktree, "1:3:-1");
  182. list.add($oaktree, "0:3:-1");
  183. list.add($oaktree, "-1:3:-1");
  184. list.add($oaktree, "2:3:0");
  185. list.add($oaktree, "2:3:1");
  186. list.add($oaktree, "2:3:2");
  187. list.add($oaktree, "1:3:2");
  188. list.add($oaktree, "0:3:2");
  189. list.add($oaktree, "-1:3:2");
  190. //list.add($oaktree, "-2:3:2");
  191. list.add($oaktree, "-2:3:1");
  192. list.add($oaktree, "-2:3:0");
  193. list.add($oaktree, "-2:3:-1");
  194. list.add($oaktree, "-2:3:-2");
  195. list.add($oaktree, "-1:3:-2");
  196. list.add($oaktree, "0:3:-2");
  197. list.add($oaktree, "1:3:-2");
  198. //list.add($oaktree, "2:3:-2");
  199. list.add($oaktree, "2:3:-1");
  200. list.add($oaktree, "1:4:0");
  201. list.add($oaktree, "0:4:1");
  202. list.add($oaktree, "1:4:1");
  203. list.add($oaktree, "-1:4:0");
  204. list.add($oaktree, "-1:4:1");
  205. list.add($oaktree, "1:4:-1");
  206. list.add($oaktree, "0:4:-1");
  207. list.add($oaktree, "-1:4:-1");
  208. list.add($oaktree, "2:4:0");
  209. list.add($oaktree, "2:4:1");
  210. //list.add($oaktree, "2:4:2");
  211. list.add($oaktree, "1:4:2");
  212. list.add($oaktree, "0:4:2");
  213. list.add($oaktree, "-1:4:2");
  214. //list.add($oaktree, "-2:4:2");
  215. list.add($oaktree, "-2:4:1");
  216. list.add($oaktree, "-2:4:0");
  217. list.add($oaktree, "-2:4:-1");
  218. //list.add($oaktree, "-2:4:-2");
  219. list.add($oaktree, "-1:4:-2");
  220. list.add($oaktree, "0:4:-2");
  221. list.add($oaktree, "1:4:-2");
  222. //list.add($oaktree, "2:4:-2");
  223. list.add($oaktree, "2:4:-1");
  224. list.add($oaktree, "1:5:0");
  225. list.add($oaktree, "0:5:1");
  226. list.add($oaktree, "1:5:1");
  227. list.add($oaktree, "-1:5:0");
  228. list.add($oaktree, "-1:5:1");
  229. list.add($oaktree, "1:5:-1");
  230. list.add($oaktree, "0:5:-1");
  231. list.add($oaktree, "-1:5:-1");
  232. list.add($oaktree, "0:6:0");
  233. list.add($oaktree, "0:6:1");
  234. list.add($oaktree, "1:6:0");
  235. list.add($oaktree, "-1:6:0");
  236. list.add($oaktree, "0:6:-1");
  237. sgoto(12000, "farmwool");
  238. @wait
  239. wait();
  240. if(notequal(loc.getCoord($player-loc, "w"), "rpg")) goto ("wait");
  241. if(equal($event, "block-break")) goto("break");
  242. if(equal($event, "block-place")) goto("place");
  243. if(equal($event, "block-click")) goto("blockclick");
  244. if(equal($event, "entity-hurt")) goto("entityhurt");
  245. if(and(equal($event, "inv-click"), equal($inv-type, "CHEST"))) goto ("invclick");
  246. goto("wait");
  247. @farmwool
  248. setVar("amount", block.getItemAmount($woolloc1, true, read.item("WOOL")));
  249. if(less($amount, 32)) block.addItem($woolloc1, read.item("WOOL"));
  250. removeVar("amount");
  251. sgoto(12000, "farmwool");
  252. goto("wait");
  253. @allow
  254. setVar("cancel", false);
  255. goto("wait");
  256. @invclick
  257. setVar("cancel", true);
  258. if(equal($inv-id, 1)) {
  259. if(or(equal($inv-slot, 0), equal($inv-slot, 1), equal($inv-slot, 2))) goto("copperin");
  260. if(or(equal($inv-slot, 3), equal($inv-slot, 4), equal($inv-slot, 5))) goto("silverin");
  261. if(or(equal($inv-slot, 6), equal($inv-slot, 7), equal($inv-slot, 8))) goto("goldin");
  262. if(or(equal($inv-slot, 9), equal($inv-slot, 10), equal($inv-slot, 11))) goto("copperout");
  263. if(or(equal($inv-slot, 12), equal($inv-slot, 13), equal($inv-slot, 14))) goto("silverout");
  264. if(or(equal($inv-slot, 15), equal($inv-slot, 16), equal($inv-slot, 17))) goto("goldout");
  265. }
  266. goto("wait");
  267. @copperin
  268. setVar("gvar", "coppercoins");
  269. setVar("münze", $copper);
  270. setVar("wort", "Kupfermünzen");
  271. goto("payin");
  272. @silverin
  273. setVar("gvar", "silvercoins");
  274. setVar("münze", $silver);
  275. setVar("wort", "Silbermünzen");
  276. goto("payin");
  277. @goldin
  278. setVar("gvar", "goldcoins");
  279. setVar("münze", $gold);
  280. setVar("wort", "Goldmünzen");
  281. goto("payin");
  282. @payin
  283. if(equal(ggv($player-name, $gvar), null)) sgv($player-name, $gvar, 0);
  284. if(or(equal($inv-slot, 0), equal($inv-slot, 3), equal($inv-slot, 6))) {
  285. setVar("amount", 1);
  286. goto("payincore");
  287. }
  288. if(or(equal($inv-slot, 1), equal($inv-slot, 4), equal($inv-slot, 7))) {
  289. setVar("amount", 8);
  290. goto("payincore");
  291. }
  292. if(or(equal($inv-slot, 2), equal($inv-slot, 5), equal($inv-slot, 8))) {
  293. setVar("amount", 64);
  294. goto("payincore");
  295. }
  296. goto("wait");
  297. @payincore
  298. if(greaterequal(player.getItemAmount($player, false, $münze), $amount)) {
  299. sgv($player-name, $gvar, add(ggv($player-name, $gvar), $amount));
  300. item.setAmount($münze, $amount);
  301. player.removeItem($player, $münze);
  302. goto("wait");
  303. }
  304. player.speak($player, "§6Bänker", "§rDu hast nicht genug ", $wort, " im Inventar.");
  305. goto("wait");
  306. @copperout
  307. setVar("gvar", "coppercoins");
  308. setVar("münze", $copper);
  309. setVar("wort", "Kupfermünzen");
  310. goto("payout");
  311. @silverout
  312. setVar("gvar", "silvercoins");
  313. setVar("münze", $silver);
  314. setVar("wort", "Silbermünzen");
  315. goto("payout");
  316. @goldout
  317. setVar("gvar", "goldcoins");
  318. setVar("münze", $gold);
  319. setVar("wort", "Goldmünzen");
  320. goto("payout");
  321. @payout
  322. if(equal(ggv($player-name, $gvar), null)) sgv($player-name, $gvar, 0);
  323. if(or(equal($inv-slot, 9), equal($inv-slot, 12), equal($inv-slot, 15))) {
  324. setVar("amount", 1);
  325. goto("payoutcore");
  326. }
  327. if(or(equal($inv-slot, 10), equal($inv-slot, 13), equal($inv-slot, 16))) {
  328. setVar("amount", 8);
  329. goto("payoutcore");
  330. }
  331. if(or(equal($inv-slot, 11), equal($inv-slot, 14), equal($inv-slot, 17))) {
  332. setVar("amount", 64);
  333. goto("payoutcore");
  334. }
  335. goto("wait");
  336. @payoutcore
  337. if(greaterequal(ggv($player-name, $gvar), $amount)) {
  338. sgv($player-name, $gvar, sub(ggv($player-name, $gvar), $amount));
  339. item.setAmount($münze, $amount);
  340. player.giveItem($player, $münze);
  341. goto("wait");
  342. }
  343. player.speak($player, "§6Bänker", "§rDu hast nicht genug ", $wort, " auf der Bank.");
  344. goto("wait");
  345. @entityhurt
  346. if(and(equal($entity-type, "VILLAGER"), equal($entity-name, "Bänker"))) {
  347. inv.open($bankmenu, $player);
  348. }
  349. goto("wait");
  350. @blockclick
  351. if(equal($block-loc, $resetbuttonloc)) goto("resetall");
  352. if(list.contains($appletreelocs, $block-loc)) {
  353. if(invert(set.contains($farmedappletrees, $block-loc))) {
  354. msg($player, "§8*schüttel*");
  355. if(equal(math.random(0, 3), 0)) {
  356. item.drop(loc.mod($block-loc, 1, 0, 1), read.item("APPLE"));
  357. item.drop(loc.mod($block-loc, -1, 0, -1), read.item("APPLE"));
  358. item.drop(loc.mod($block-loc, -1, 0, 1), read.item("APPLE"));
  359. item.drop(loc.mod($block-loc, 1, 0, -1), read.item("APPLE"));
  360. setVar("list", getVar(concat("applelocs", list.getIndexOf($appletreelocs, $block-loc))));
  361. setVar("i", -1);
  362. while(less(inc("i"), list.getSize($list))) {
  363. block.set(list.getIndex($list, $i), read.item("AIR"));
  364. }
  365. removeVar("list");
  366. set.add($farmedappletrees, $block-loc);
  367. msg($player, "§a*Äpfel geerntet*");
  368. }
  369. }
  370. goto("wait");
  371. }
  372. if(list.contains($honeytreelocs, $block-loc)) {
  373. if(invert(set.contains($farmedhoneytrees, $block-loc))) {
  374. msg($player, "§8*schüttel*");
  375. if(equal(math.random(0, 3), 0)) {
  376. item.drop(loc.mod($block-loc, 1, 0, 1), $honeyhead);
  377. item.drop(loc.mod($block-loc, -1, 0, -1), $honeyhead);
  378. item.drop(loc.mod($block-loc, -1, 0, 1), $honeyhead);
  379. item.drop(loc.mod($block-loc, 1, 0, -1), $honeyhead);
  380. setVar("list", getVar(concat("honeylocs", list.getIndexOf($honeytreelocs, $block-loc))));
  381. setVar("i", -1);
  382. while(less(inc("i"), list.getSize($list))) {
  383. block.set(list.getIndex($list, $i), read.item("AIR"));
  384. }
  385. removeVar("list");
  386. set.add($farmedhoneytrees, $block-loc);
  387. msg($player, "§a*Honig geerntet*");
  388. }
  389. }
  390. goto("wait");
  391. }
  392. goto("wait");
  393. @break
  394. setVar("cancel", true);
  395. if(list.contains($grasslocs, $block-loc)) {
  396. setVar("cancel", false);
  397. if(equal(math.random(0, 9), 0)) {
  398. item.drop(loc.mod($block-loc, 1, 0, 1), read.item("STRING"));
  399. }
  400. goto("wait");
  401. }
  402. if(list.contains($flowerlocs, $block-loc)) {
  403. setVar("cancel", false);
  404. }
  405. if(list.contains($mushroomlocs, $block-loc)) {
  406. setVar("cancel", false);
  407. }
  408. if(list.contains($mine0, $block-loc)) {
  409. setVar("cancel", false);
  410. }
  411. if(list.contains($ironorelocs, $block-loc)) {
  412. setVar("cancel", false);
  413. }
  414. if(equal($block-type, "CARROT")) {
  415. if(equal($block-data, 7)) {
  416. if(equal(item.getType(entity.getEquip($player, "hand")), "WOOD_HOE")) goto("allow");
  417. if(equal(item.getType(entity.getEquip($player, "hand")), "STONE_HOE")) goto("allow");
  418. if(equal(item.getType(entity.getEquip($player, "hand")), "GOLD_HOE")) goto("allow");
  419. if(equal(item.getType(entity.getEquip($player, "hand")), "IRON_HOE")) goto("allow");
  420. if(equal(item.getType(entity.getEquip($player, "hand")), "DIAMOND_HOE")) goto("allow");
  421. }
  422. goto("wait");
  423. }
  424. if(equal($block-type, "LOG")) {
  425. if(notequal(item.getType(entity.getEquip($player, "hand")), "WOOD_AXE")) {
  426. if(notequal(item.getType(entity.getEquip($player, "hand")), "STONE_AXE")) {
  427. if(notequal(item.getType(entity.getEquip($player, "hand")), "GOLD_AXE")) {
  428. if(notequal(item.getType(entity.getEquip($player, "hand")), "IRON_AXE")) {
  429. if(notequal(item.getType(entity.getEquip($player, "hand")), "DIAMOND_AXE")) goto("wait");
  430. }
  431. }
  432. }
  433. }
  434. if(list.contains($oaktreelocs, $block-loc)) {
  435. item.drop($block-loc, read.item("LOG:0:6"));
  436. block.set($block-loc, read.item("AIR"));
  437. block.set(loc.mod($block-loc, 0, 1, 0), read.item("AIR"));
  438. block.set(loc.mod($block-loc, 0, 2, 0), read.item("AIR"));
  439. block.set(loc.mod($block-loc, 0, 3, 0), read.item("AIR"));
  440. block.set(loc.mod($block-loc, 0, 4, 0), read.item("AIR"));
  441. block.set(loc.mod($block-loc, 0, 5, 0), read.item("AIR"));
  442. }
  443. if(list.contains($oaktreelocs, loc.mod($block-loc, 0, -1, 0))) {
  444. item.drop(loc.mod($block-loc, 0, -1, 0), read.item("LOG:0:6"));
  445. block.set($block-loc, read.item("AIR"));
  446. block.set(loc.mod($block-loc, 0, 1, 0), read.item("AIR"));
  447. block.set(loc.mod($block-loc, 0, 2, 0), read.item("AIR"));
  448. block.set(loc.mod($block-loc, 0, 3, 0), read.item("AIR"));
  449. block.set(loc.mod($block-loc, 0, 4, 0), read.item("AIR"));
  450. block.set(loc.mod($block-loc, 0, -1, 0), read.item("AIR"));
  451. }
  452. if(list.contains($oaktreelocs, loc.mod($block-loc, 0, -2, 0))) {
  453. item.drop(loc.mod($block-loc, 0, -2, 0), read.item("LOG:0:6"));
  454. block.set($block-loc, read.item("AIR"));
  455. block.set(loc.mod($block-loc, 0, 1, 0), read.item("AIR"));
  456. block.set(loc.mod($block-loc, 0, 2, 0), read.item("AIR"));
  457. block.set(loc.mod($block-loc, 0, 3, 0), read.item("AIR"));
  458. block.set(loc.mod($block-loc, 0, -1, 0), read.item("AIR"));
  459. block.set(loc.mod($block-loc, 0, -2, 0), read.item("AIR"));
  460. }
  461. }
  462. goto("wait");
  463. @place
  464. setVar("cancel", true);
  465. goto("wait");
  466. @resetall
  467. sgoto(1, "oaktreereset");
  468. sgoto(1, "applereset");
  469. sgoto(1, "honeyreset");
  470. sgoto(1, "grassreset");
  471. sgoto(1, "ironorereset");
  472. sgoto(1, "flowerreset");
  473. sgoto(1, "minereset");
  474. sgoto(1, "mushroomreset");
  475. goto("wait");
  476. @oaktreereset
  477. setVar("x", -1);
  478. while(less(inc("x"), list.getSize($oaktreelocs))) {
  479. setVar("treeloc", list.getIndex($oaktreelocs, $x));
  480. setVar("block", "LOG");
  481. setVar("i", -1);
  482. while(less(inc("i"), list.getSize($oaktree))) {
  483. if(equal($i, 7 )) setVar("block", "LEAVES");
  484. split("splitlist", ":", list.getIndex($oaktree, $i));
  485. setVar("tempx", list.getIndex($splitlist, 0));
  486. setVar("tempy", list.getIndex($splitlist, 1));
  487. setVar("tempz", list.getIndex($splitlist, 2));
  488. block.set(loc.mod($treeloc, $tempx, $tempy, $tempz), read.item($block));
  489. }
  490. }
  491. removeVar("splitlist");
  492. removeVar("tempx");
  493. removeVar("tempy");
  494. removeVar("tempz");
  495. goto("wait");
  496. @applereset
  497. setVar("h", -1);
  498. while(less(inc("h"), list.getSize($appletreelocs))) {
  499. setVar("list", getVar(concat("applelocs", $h)));
  500. setVar("i", -1);
  501. while(less(inc("i"), list.getSize($list))) {
  502. block.clone($appletemplate, list.getIndex($list, $i));
  503. }
  504. }
  505. removeVar("list");
  506. set.new("farmedappletrees");
  507. goto("wait");
  508. @honeyreset
  509. setVar("h", -1);
  510. while(less(inc("h"), list.getSize($honeytreelocs))) {
  511. setVar("list", getVar(concat("honeylocs", $h)));
  512. setVar("i", -1);
  513. while(less(inc("i"), list.getSize($list))) {
  514. block.clone($honeytemplate, list.getIndex($list, $i));
  515. }
  516. }
  517. removeVar("list");
  518. set.new("farmedhoneytrees");
  519. goto("wait");
  520. @flowerreset
  521. setVar("i", -1);
  522. while(less(inc("i"), list.getSize($flowerlocs))) {
  523. if(equal(math.random(0, 1), 0)) {
  524. block.set(list.getIndex($flowerlocs, $i), read.item("RED_ROSE"));
  525. } else() {
  526. block.set(list.getIndex($flowerlocs, $i), read.item("YELLOW_FLOWER"));
  527. }
  528. }
  529. goto("wait");
  530. @grassreset
  531. setVar("i", -1);
  532. while(less(inc("i"), list.getSize($grasslocs))) {
  533. block.set(list.getIndex($grasslocs, $i), read.item("LONG_GRASS:1"));
  534. }
  535. goto("wait");
  536. @mushroomreset
  537. setVar("i", -1);
  538. while(less(inc("i"), list.getSize($mushroomlocs))) {
  539. if(equal(math.random(0, 1), 0)) {
  540. block.set(list.getIndex($mushroomlocs, $i), read.item("BROWN_MUSHROOM"));
  541. } else() {
  542. block.set(list.getIndex($mushroomlocs, $i), read.item("RED_MUSHROOM"));
  543. }
  544. }
  545. goto("wait");
  546. @ironorereset
  547. setVar("i", -1);
  548. while(less(inc("i"), list.getSize($ironorelocs))) {
  549. block.set(list.getIndex($ironorelocs, $i, 0), read.item("IRON_ORE"));
  550. }
  551. goto("wait");
  552. @minereset
  553. setVar("i", -1);
  554. while(less(inc("i"), list.getSize($mine0))) {
  555. if(equal(math.random(0, 14), 0)) {
  556. block.set(list.getIndex($mine0, $i), read.item("COAL_ORE"));
  557. } else() {
  558. if(equal(math.random(0, 29), 0)) {
  559. block.set(list.getIndex($mine0, $i), read.item("IRON_ORE"));
  560. } else() {
  561. block.set(list.getIndex($mine0, $i), read.item("STONE"));
  562. }
  563. }
  564. }
  565. goto("wait");