Advertisement
YTMango

荔枝配方-將石頭方塊電擊後轉換成黑曜石

May 18th, 2024 (edited)
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.56 KB | Source Code | 0 0
  1. ServerEvents.recipes((event) => {
  2.   // 實際上用來將石頭轉換成黑曜石的配方
  3.   event
  4.     .custom({
  5.       type: "lychee:lightning_channeling",
  6.       hide_in_viewer: true,
  7.       post: {
  8.         type: "if",
  9.         contextual: {
  10.           type: "location",
  11.           offsetY: -1,
  12.           predicate: {
  13.             block: {
  14.               blocks: ["minecraft:stone"],
  15.             },
  16.           },
  17.         },
  18.         then: {
  19.           type: "place",
  20.           offsetY: -1,
  21.           block: "minecraft:obsidian",
  22.         },
  23.         else: { // 閃電打在避雷針上時實際上是在上面一格產生實體
  24.           type: "if",
  25.           contextual: {
  26.             type: "location",
  27.             offsetY: -2,
  28.             predicate: {
  29.               block: {
  30.                 blocks: ["minecraft:stone"],
  31.               },
  32.             },
  33.           },
  34.           then: {
  35.             type: "place",
  36.             offsetY: -2,
  37.             block: "minecraft:obsidian",
  38.           },
  39.         },
  40.       },
  41.     })
  42.     .id("kubejs:lychee-lightning_channeling/change_stone_to_obsidian_actually");
  43.  
  44.   // 僅用來在 JEI/REI 中完整顯示石頭,不會有實際作用的配方
  45.   event
  46.     .custom({
  47.       type: "lychee:lightning_channeling",
  48.       ghost: true,
  49.       item_in: [{ item: "stone" }],
  50.       comment: "將石頭電擊後轉換成黑曜石",
  51.       post: {
  52.         type: "place",
  53.         offsetY: -1,
  54.         block: "minecraft:obsidian",
  55.       },
  56.     })
  57.     .id("kubejs:lychee-lightning_channeling/change_stone_to_obsidian-view_only");
  58. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement