本篇教程由作者设定使用 CC BY-NC-SA 协议。
在我们给拔刀剑做任务时,由于拔刀剑是通过nbt区分,所以很容易出现完成不了或多个一起完成的状况,由此我提出一些重要的点,请各位整合包中有拔刀剑的作者仔细查看此教程的注意事项!!!
在创造物品栏拿出来的物品的nbt是最少的,但是只要你手中拿着那把从创造物品栏拿出来的拔刀剑时,拔刀剑的nbt就会加上你的uuid,这个多加上的nbt就是多余的nbt。
利刀白鞘与断掉的利刀白鞘的区分仅仅是一条名为“isBroken: 1 as byte”的nbt,此处提供部分最简洁的拔刀剑的代码。
任务物品为拔刀剑时,默认是ignore[忽略一切nbt],需要手动调成contain[匹配nbt],然后选择任务物品是请选择nbt最少的也就是从创造物品栏拿出来的(注意第一点!)
不要将任务调成只识别从合成得到的拔刀剑,拔刀剑的合成全程带着nbt们,若采用了只识别从合成得到则会导致任务无法完成!
这里不得不吐槽一下尼格洛兹·无尽曈曚,创造拿出来的全是问号,对整合包作者太不友好了
代码:
利刀白鞘
<flammpfeil.slashblade:slashbladewhite>.withTag({SlashBlade: {}, "SB.SEffect": {}})
断掉的利刀白鞘
<flammpfeil.slashblade:slashbladewhite:70>.withTag({SlashBlade: {}, isBroken: 1 as byte, "SB.SEffect": {}})
阎魔刀
<flammpfeil.slashblade:slashbladenamed>.withTag({ench: [{lvl: 1 as short, id: 7}, {lvl: 4 as short, id: 2}, {lvl: 5 as short, id: 48}, {lvl: 2 as short, id: 49}], SlashBlade: {}, ModelName: "named/yamato", isDefaultBewitched: 1 as byte, CurrentItemName: "flammpfeil.slashblade.named.yamato", AttackAmplifier: 10.0 as float, TargetEntity: 0, TextureName: "named/yamato", "SB.SEffect": {}})
尼尔「永恒旋转之枪」
<negorerouse:nrslashblade>.withTag({ench: [{lvl: 1 as short, id: 34}, {lvl: 8 as short, id: 48}, {lvl: 5 as short, id: 17}], SlashBlade: {}, onClick: 0 as byte, ModelName: "named/negorerouse/nier", CurrentItemName: "moflop.slashblade.nier", "isNrBlade{": 1 as byte, TextureName: "named/negorerouse/nier", "SB.SEffect": {oracle: 0, WitherEdge: 20}})
伊恩「永恒时光之轮·永劫根源魔枪」
<negorerouse:nrslashblade>.withTag({ench: [{lvl: 3 as short, id: 34}, {lvl: 5 as short, id: 16}, {lvl: 10 as short, id: 48}, {lvl: 5 as short, id: 17}], SlashBlade: {}, ModelName: "named/negorerouse/chronos", CurrentItemName: "moflop.slashblade.chronos", "isNrBlade{": 1 as byte, TextureName: "named/negorerouse/chronos", "SB.SEffect": {oracle: 0}})
厄瑞波斯「永黯沉寂」
<negorerouse:nrslashblade>.withTag({ench: [{lvl: 3 as short, id: 34}, {lvl: 5 as short, id: 16}, {lvl: 3 as short, id: 20}, {lvl: 5 as short, id: 17}, {lvl: 3 as short, id: 21}], SlashBlade: {}, ModelName: "named/negorerouse/erebus", CurrentItemName: "moflop.slashblade.erebus", "isNrBlade{": 1 as byte, TextureName: "named/negorerouse/erebus", "SB.SEffect": {oracle: 0, reversePower: 50, WitherEdge: 20}})
柯罗诺斯「永境之主」
<negorerouse:nrslashblade>.withTag({ench: [{lvl: 5 as short, id: 34}, {lvl: 10 as short, id: 16}, {lvl: 5 as short, id: 20}, {lvl: 5 as short, id: 17}, {lvl: 5 as short, id: 21}], SlashBlade: {}, ModelName: "named/negorerouse/chronosn", CurrentItemName: "moflop.slashblade.chronosn", "isNrBlade{": 1 as byte, TextureName: "named/negorerouse/chronosn", "SB.SEffect": {oracle: 0, absolutePower: 1}})
普洛托革诺伊「始源」
<negorerouse:nrslashblade>.withTag({ench: [{lvl: 10 as short, id: 34}, {lvl: 10 as short, id: 16}, {lvl: 5 as short, id: 20}, {lvl: 5 as short, id: 21}], SlashBlade: {}, ModelName: "named/negorerouse/protogenoi" , CurrentItemName: "moflop.slashblade.protogenoi", "isNrBlade{": 1 as byte, TextureName: "named/negorerouse/protogenoi", "SB.SEffect": {oracle: 0, absolutePower: 1, back: 90}})
阿尔忒弥斯「影月」
<negorerouse:nrslashblade>.withTag({ench: [{lvl: 3 as short, id: 34}, {lvl: 5 as short, id: 48}, {lvl: 3 as short, id: 61}], SlashBlade: {}, ModelName: "named/negorerouse/artemis", CurrentItemName: "moflop.slashblade.artemis", "isNrBlade{": 1 as byte, TextureName: "named/negorerouse/artemis", "SB.SEffect": {oracle: 0}})
海格力斯「闪耀之星」
<negorerouse:nrslashblade>.withTag({ench: [{lvl: 3 as short, id: 34}, {lvl: 5 as short, id: 48}, {lvl: 2 as short, id: 20}, {lvl: 1 as short, id: 1}, {lvl: 3 as short, id: 17}], SlashBlade: {}, ModelName: "named/negorerouse/hercules", CurrentItemName: "moflop.slashblade.hercules", "isNrBlade{": 1 as byte, TextureName: "named/negorerouse/hercules", "SB.SEffect": {oracle: 0, burstDrive: 20}})
再为大家提供一个拔刀剑合成表的事例吧(继承击杀,锻造,耀魂)
recipes.addShaped("whitefoxjei",<flammpfeil.slashblade:slashbladewrapper>.withTag({ench: [{lvl: 2 as short, id: 19}, {lvl: 2 as short, id: 18}, {lvl: 3 as short, id: 34}, {lvl: 3 as short, id: 21}, {lvl: 2 as short, id: 20}], WrapItem: {id: "minecraft:wooden_sword", Count: 1 as byte, Damage: 0 as short}, SlashBlade: {}, ModelName: "named/sange/sange", ProudSoul: 1000, isDefaultBewitched: 1 as byte, CurrentItemName: "flammpfeil.slashblade.named.fox.white", TextureName: "named/sange/white", SpecialAttackType: 0, comboSeq: 0, TrueItemName: "flammpfeil.slashblade.named.fox.white", killCount: 199, RepairCounter: 1, isCharged: 0 as byte, isBroken: 0 as byte, baseAttackModifier: 4.0 as float, "SB.SEffect": {}, StandbyRenderType: 1}),
[[<sakura:kitunebi>, <flammpfeil.slashblade:proudsoul:1>, <sakura:kitunebi>],
[<sakura:kitunebi>, <flammpfeil.slashblade:slashbladenamed>.withTag({ench: [{lvl: 1 as short, id: 21}], SlashBlade: {}, onClick: 0 as byte, IsManagedDamage: 0 as byte, RepairCost: 0, ProudSoul: 1000, CurrentItemName: "wrap.BambooMod.katana", AttackAmplifier: 0.0 as float, lastActionTime: 7517686 as long, TextureName: "BambooKatana", comboSeq: 0, killCount: 199, CustomMaxDamage: 45, RepairCounter: 1, isCharged: 0 as byte, isBroken: 0 as byte, baseAttackModifier: 4.0 as float, "SB.SEffect": {}}).marked("t"), <sakura:kitunebi>],
[<sakura:kitunebi>, <tofucraft:foodset:10>, <sakura:kitunebi>]],
function (out, input, info) {
return null;
},
null);
recipes.addShaped("whitefox",<flammpfeil.slashblade:slashbladenamed>,
[[<sakura:kitunebi>, <flammpfeil.slashblade:proudsoul:1>, <sakura:kitunebi>],
[<sakura:kitunebi>, <flammpfeil.slashblade:slashbladenamed>.marked("t"), <sakura:kitunebi>],
[<sakura:kitunebi>, <tofucraft:foodset:10>, <sakura:kitunebi>]],
function (out, input, info) {
var data as IData = input.t.tag;
var kill as int = data.killCount.asInt();
var Proud as int = data.ProudSoul.asInt();
var Repair as int = data.RepairCounter.asInt();
if(kill < 199 || Proud < 1000) return null;
if(data.CurrentItemName != "wrap.BambooMod.katana" || data.TextureName != "BambooKatana") return null;
if(input.t.isEnchanted){
var enchlist as IEnchantment[] = [];
for i in input.t.enchantments{
enchlist += i;
}
if(enchlist.length > 1){
return null;
}else{
for i in input.t.enchantments{
if(i.definition.id == 21 && i.level == 1){
return <flammpfeil.slashblade:slashbladewrapper>.withTag({ench: [{lvl: 2 as short, id: 19}, {lvl: 2 as short, id: 18}, {lvl: 3 as short, id: 34}, {lvl: 3 as short, id: 21}, {lvl: 2 as short, id: 20}], WrapItem: {id: "minecraft:wooden_sword", Count: 1 as byte, Damage: 0 as short}, SlashBlade: {}, ModelName: "named/sange/sange", isDefaultBewitched: 1 as byte, CurrentItemName: "flammpfeil.slashblade.named.fox.white", TextureName: "named/sange/white", SpecialAttackType: 0, comboSeq: 0, TrueItemName: "flammpfeil.slashblade.named.fox.white", isCharged: 0 as byte, isBroken: 0 as byte, baseAttackModifier: 4.0 as float, "SB.SEffect": {}, StandbyRenderType: 1} + {ProudSoul: Proud, killCount: kill, RepairCounter: Repair});
}
}
}
}
return null;
},
null);
若有需要补充之处请在评论区提及。