Create

预计阅读时间: 5 分钟

示例脚本仅在这里展示配方,并不打算与显示的物品一起使用。

Compacting

语法:compacting(output[], input[])

Compacting使用机械式压力机水槽和可选的烈焰燃烧器

特性:

  • 支持多种输入和输出
  • 支持.heated().superheated()
  • 只要有另一个物品输出,就可以有流体输出
  • 支持基于概率的输出
ServerEvents.recipes(event => {
  event.recipes.create.compacting('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.compacting('minecraft:diamond', 'minecraft:coal_block').heated()
  event.recipes.create.compacting('minecraft:diamond', 'minecraft:coal_block').superheated()
  event.recipes.create.compacting([Fluid.of('minecraft:water', 10), 'minecraft:dead_bush'], [Ingredient.of('#minecraft:saplings'), Ingredient.of('#minecraft:saplings')])
  event.recipes.create.compacting(['minecraft:diamond', CreateItem.of('minecraft:diamond', 0.3)], 'minecraft:coal_block')
})

Crushing

语法:crushing(output[], input)

Crushing使用粉碎轮

特性:

  • 支持多种基于概率的输出
  • 支持.processingTime()
ServerEvents.recipes(event => {
  event.recipes.create.crushing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.crushing('minecraft:diamond', 'minecraft:coal_block').processingTime(500)
  event.recipes.create.crushing(['minecraft:diamond', CreateItem.of('minecraft:diamond', 0.5)], 'minecraft:coal_block')
})

Cutting

语法:cutting(output[], input)

Cutting使用机械锯

特性:

  • 支持多种基于概率的输出
  • 支持.processingTime()
ServerEvents.recipes(event => {
  event.recipes.create.cutting('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.cutting('minecraft:diamond', 'minecraft:coal_block').processingTime(500)
  event.recipes.create.cutting(['minecraft:diamond', CreateItem.of('minecraft:diamond', 0.5)], 'minecraft:coal_block')
})

Deploying

语法:deploying(output[], input[])

Deploying使用部署器

特性:

  • 支持多种基于概率的输出
  • 恰好需要两个输入,第二个输入是部署器持有的物品
  • 支持.keepHeldItem()
ServerEvents.recipes(event => {
  event.recipes.create.deploying('minecraft:diamond', ['minecraft:coal_block', 'minecraft:sand'])
  event.recipes.create.deploying(['minecraft:diamond', 'minecraft:emerald'], ['minecraft:coal_block', 'minecraft:sand']).keepHeldItem()
  event.recipes.create.deploying(['minecraft:diamond', CreateItem.of('minecraft:diamond', 0.5)], ['minecraft:coal_block', 'minecraft:sand'])
})

Emptying

语法:emptying(output[], input)

Emptying使用物品排放器

特性:

  • 要求一个输入和两个输出,输出必须是物品和流体
ServerEvents.recipes(event => {
  event.recipes.create.emptying([Fluid.of('minecraft:water'), 'minecraft:bucket'], 'minecraft:water_bucket')
})

Filling

语法:filling(output, input[])

Filling使用喷水口

特性:

  • 要求两个输入和一个输出,输入必须是物品和流体
ServerEvents.recipes(event => {
  event.recipes.create.filling('minecraft:water_bucket', [Fluid.of('minecraft:water'), 'minecraft:bucket'])
})

Haunting

语法:haunting(output[], input)

Haunting使用封装扇灵魂火

特性:

  • 支持多种基于概率的输出
ServerEvents.recipes(event => {
  event.recipes.create.haunting('minecraft:soul_campfire', 'minecraft:campfire')
  event.recipes.create.haunting(['minecraft:wheat', 'minecraft:oak_sapling'], 'minecraft:potato')
  event.recipes.create.haunting(['minecraft:wheat', CreateItem.of('minecraft:oak_sapling', 0.2)], 'minecraft:potato')
})

Mechanical Crafting

语法:mechanical_crafting(output, pattern[], key{})

Mechanical Crafting使用机械合成器

特性:

  • 大部分与默认的有序合成相同
  • 支持最多9x9的网格大小
ServerEvents.recipes(event => {
  event.recipes.create.mechanical_crafting('minecraft:emerald', [
    ' DDD ',
    'D   D',
    'D   D',
    'D   D',
    ' DDD '
  ], {
    D: 'minecraft:dirt'
  })
})

Milling

语法:milling(output[], input)

Milling使用磨石

特性:

  • 支持多种基于概率的输出
ServerEvents.recipes(event => {
  event.recipes.create.milling('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.milling(['minecraft:diamond', 'minecraft:emerald'], 'minecraft:coal_block')
  event.recipes.create.milling(['minecraft:diamond', CreateItem.of('minecraft:diamond', 0.5)], 'minecraft:coal_block')
})

Mixing

语法:mixing(output[], input[])

Mixing使用机械混合器水槽和可选的烈焰燃烧器

特性:

  • 支持多种基于概率的输出
  • 支持流体输入和输出
  • 支持.heated().superheated()
ServerEvents.recipes(event => {
  event.recipes.create.mixing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.mixing('minecraft:diamond', 'minecraft:coal_block').heated()
  event.recipes.create.mixing('minecraft:diamond', 'minecraft:coal_block').superheated()
  event.recipes.create.mixing([Fluid.of('minecraft:water'), 'minecraft:dead_bush'], [Ingredient.of('#minecraft:saplings'), Ingredient.of('#minecraft:saplings')])
  event.recipes.create.mixing(['minecraft:diamond', CreateItem.of('minecraft:diamond', 0.3)], 'minecraft:coal_block')
})

Pressing

语法:pressing(output[], input)

Pressing使用机械式压力机

特性:

  • 支持多种基于概率的输出
ServerEvents.recipes(event => {
  event.recipes.create.pressing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.pressing(['minecraft:diamond', 'minecraft:emerald'], 'minecraft:coal_block')
  event.recipes.create.pressing(['minecraft:diamond', CreateItem.of('minecraft:diamond', 0.5)], 'minecraft:coal_block')
})

Sandpaper Polishing

语法:sandpaper_polishing(output, input)

Sandpaper Polishing使用任何用create:sandpaper标签的物品。

特性:

  • 支持基于概率的输出
ServerEvents.recipes(event => {
  event.recipes.create.sandpaper_polishing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.sandpaper_polishing(CreateItem.of('minecraft:diamond', 0.5), 'minecraft:coal_block')
})

Sequenced Assembly

语法:sequenced_assembly(output[], input, sequence[]).transitionalItem(item).loops(int)

Output是物品或物品数组。如果它是一个数组:

  • 第一个物品是真实输出,其余的是随机回收
  • 只选择一个物品,每个物品的概率相等
  • 您可以使用Item.of('create:shaft').withChance(2)来翻倍该物品被选中的概率

Transitional Item是在装配中间阶段使用的任何物品。

Sequence是以下类型配方的数组:

  • create:cutting
  • create:pressing
  • create:deploying
  • create:filling

过渡物品需要是这些配方每个的输入输出。

Loops是配方重复的次数。调用.loops()是可选的,在1.19.2+上默认为4,在1.21.1上为5

ServerEvents.recipes(event => {
  event.recipes.create.sequenced_assembly(
    // 输出:
    [
      CreateItem.of('create:precision_mechanism', 0.13), // 主输出,将在JEI中作为结果显示
      CreateItem.of('create:golden_sheet', 0.008), // 其余这些物品将被视为随机回收
      CreateItem.of('create:andesite_alloy', 0.008),
      CreateItem.of('create:cogwheel', 0.005),
      CreateItem.of('create:shaft', 0.002),
      CreateItem.of('create:crushed_gold_ore', 0.002),
      CreateItem.of('2x minecraft:gold_nugget', 0.002),
      CreateItem.of('minecraft:iron_ingot', 0.001),
      CreateItem.of('minecraft:clock', 0.001)
    ],
    // 输入:
    'create:golden_sheet',
    // 序列:
    [
      event.recipes.create.deploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'create:cogwheel']),
      event.recipes.create.deploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'create:large_cogwheel']),
      event.recipes.create.deploying('create:incomplete_precision_mechanism', ['create:incomplete_precision_mechanism', 'minecraft:iron_nugget']),
    ]
  ).transitionalItem('create:incomplete_precision_mechanism').loops(5)
})

Splashing/Washing

语法:splashing(output[], input)washing(output[], input)

Splashing/Washing使用水力喷射器

特性:

  • 支持多种基于概率的输出
ServerEvents.recipes(event => {
  event.recipes.create.splashing('minecraft:diamond', 'minecraft:coal_block')
  event.recipes.create.washing('minecraft:diamond', 'minecraft:coal_block')
})

Mysterious Conversion

语法:mysterious_conversion(output[], input)

Mysterious Conversion使用神秘转换框

特性:

  • 支持多种基于概率的输出
ServerEvents.recipes(event => {
  event.recipes.create.mysterious_conversion('minecraft:diamond', 'minecraft:coal_block')
})

Preventing Recipe Auto-Generation

您可以使用以下方法防止特定配方自动生成:

ServerEvents.recipes(event => {
  event.remove({mod: 'create'})
})