story.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //event.load("block_click");
  2. //event.load("snuvi_click");
  3. quest.setBlockList(list.new());
  4. transit_loc = loc.new(story_world, -1522, 64, -18);
  5. schiff_spawn = loc.new(story_world, -1636, 63, -999, 50, 0.0001);
  6. transit_inv = inv.new("333333333", text.new("Überfahrt"));
  7. inv.setItem(transit_inv, 0, read.item("minecraft:cake", 1, "§fAdmont"));
  8. inv.setItem(transit_inv, 1, read.item("minecraft:sand", 1, "§fSchiffbruch"));
  9. msg("dev", "§bStory §rloaded.");
  10. @wait
  11. wait();
  12. ignoreGoto(event);
  13. goto("wait");
  14. @block_click
  15. if(block == null) {
  16. goto("wait");
  17. }
  18. world = loc.getWorld(block_loc);
  19. if(world.getName(world) != "story") {
  20. goto("wait");
  21. }
  22. if(block_type == "minecraft:sweet_berry_bush") {
  23. scheduler.setBlock(5, block_loc, concat("minecraft:sweet_berry_bush[age=3]"), false);
  24. goto("wait");
  25. }
  26. if(slot.isOffHand(hand)) {
  27. goto("wait");
  28. }
  29. if(action == "LEFT_CLICK_BLOCK") {
  30. goto("wait");
  31. }
  32. if(block_loc == transit_loc) {
  33. inv.open(transit_inv, player);
  34. goto("wait");
  35. }
  36. goto("wait");
  37. @snuvi_click
  38. if(inv_name == "Überfahrt") {
  39. if(item.getType(item) == "minecraft:air") {
  40. goto("wait");
  41. }
  42. if(inv_slot == 0) {
  43. entity.teleport(player, world.getStorySpawn());
  44. } elseif(inv_slot == 1) {
  45. entity.teleport(player, schiff_spawn);
  46. }
  47. inv.close(player);
  48. }
  49. goto("wait");