基础炼药

By MCSugar_cane    2018/1/26

这个玩意本来我是做在一个还未完成的RPG里的,但由于那个地图的炼药系统有些复杂+建筑爆炸,一直处于不更病态,现在突然抽风想先做一个基础的版本。

PS: 如果此系统更新我会同步的,但是按照尿性来说...unbelivable


我的世界基础炼药0

我的世界基础炼药1我的世界基础炼药2

图片就介绍到这里,下面是详细内容以及代码部分~


详情:

关于物品丢出合成炼药锅原理,可以在此了解:检测掉落物

由于此系统比较简单,所以我就不打算将代码再讲解啦:@。

此基础炼药不支持玩家自行开始,自行结束;炼出成品不受几率影响;无品质差异;无需玩家加温;药材不分品质...(被你发现了,我在给今后完整版的炼药系统种未来草~)

使用说明:

  1. 可可豆x2+南瓜种子x1
  2. 甜菜根x1+仙人掌绿x3
  3. 玫瑰红x1+烈焰粉x2
  4. 海晶砂砾x2+淡蓝色染料x1

代码:

基础部分:

  1. scoreboard objectives add when dummy
  2. scoreboard objectives add gwater dummy

丢出合成:[高频循环]

  1. scoreboard players tag @e[type=Item] add stepi {Item:{id:"minecraft:iron_ingot",Count:10b,Damage:0s},OnGround:1b}
  2. scoreboard players tag @e[type=Item] add stepii {Item:{id:"minecraft:glass_bottle",Count:32b,Damage:0s},OnGround:1b}
  3. execute @e[type=Item,tag=stepi] ~ ~ ~ execute @e[type=Item,r=1,tag=stepii,c=1] ~ ~ ~ summon Item ~ ~0.2 ~ {Item:{id:"minecraft:spawn_egg",Count:1b,tag:{EntityTag:{id:"minecraft:bat",CustomName:"iMed",NoAI:1,Silent:1b,ActiveEffects:[{Id:14,Duration:9999999,Amplifier:50,Ambient:1}]},HideFlags:127,ench:[{id:34,lvl:10}],display:{Name:"放置炼药锅",Lore:["www.Ganxiaozhe.com"]}}},Motion:[0.0,0.4,0.0]}
  4. execute @e[type=Item,tag=stepi] ~ ~ ~ execute @e[type=Item,r=1,tag=stepii,c=1] ~ ~ ~ playsound minecraft:entity.item.break voice @a[r=8] ~ ~ ~ 1000 0.5 1
  5. execute @e[type=Item,tag=stepi] ~ ~ ~ execute @e[type=Item,r=1,tag=stepii,c=1] ~ ~ ~ kill @e[type=Item,r=1,tag=!]

炼药锅生成:[高频循环]

  1. execute @e[type=bat,name=iMed] ~ ~ ~ fill ~ ~ ~ ~ ~ ~ cauldron 2 replace
  2. execute @e[type=bat,name=iMed] ~ ~ ~ summon area_effect_cloud ~ ~ ~ {Duration:2147483647,CustomName:"Med",Tags:["idle"]}
  3. kill @e[type=bat,name=iMed]

炼药锅破坏:[高频循环]

  1. scoreboard players tag @e[type=area_effect_cloud,name=Med] add broke
  2. execute @e[type=area_effect_cloud,name=Med,tag=broke] ~ ~ ~ detect ~ ~ ~ cauldron -1 scoreboard players tag @e[type=area_effect_cloud,name=Med,r=0] remove broke
  3. execute @e[type=area_effect_cloud,name=Med,tag=broke] ~ ~ ~ setblock ~ ~ ~ air 0
  4. execute @e[type=area_effect_cloud,name=Med,tag=broke] ~ ~ ~ summon Item ~ ~0.2 ~ {Item:{id:"minecraft:spawn_egg",Count:1b,tag:{EntityTag:{id:"minecraft:bat",CustomName:"iMed",NoAI:1,Silent:1b,ActiveEffects:[{Id:14,Duration:9999999,Amplifier:50,Ambient:1}]},HideFlags:127,ench:[{id:34,lvl:10}],display:{Name:"放置炼药锅",Lore:["www.Ganxiaozhe.com"]}}},Motion:[0.0,0.4,0.0],Tags:["gxz"]}
  5. execute @e[type=area_effect_cloud,name=Med,tag=broke] ~ ~ ~ particle hugeexplosion ~ ~ ~ 0.1 0.2 0.1 1.0 1 force
  6. execute @e[type=area_effect_cloud,name=Med,tag=broke] ~ ~ ~ playsound minecraft:block.anvil.land voice @a ~ ~ ~ 1000 0.5 1
  7. execute @e[type=area_effect_cloud,name=Med,tag=broke] ~ ~ ~ kill @e[type=Item,r=1,tag=]
  8. kill @e[type=area_effect_cloud,name=Med,tag=broke]

粒子特效:[高频循环]

  1. scoreboard players add @e[type=area_effect_cloud,name=Med] when 0
  2. execute @e[type=area_effect_cloud,name=Med,score_when=0] ~ ~ ~ particle flame ~ ~-0.3 ~ 0.3 0.2 0.3 0.01 1 force
  3. execute @e[type=area_effect_cloud,name=Med,score_when_min=1,score_when=119] ~ ~ ~ particle flame ~ ~-0.2 ~ 0.3 0.2 0.3 0.01 1 force
  4. execute @e[type=area_effect_cloud,name=Med,score_when_min=120,score_when=219] ~ ~ ~ particle flame ~ ~ ~ 0.3 0.2 0.3 0.01 1 force
  5. execute @e[type=area_effect_cloud,name=Med,score_when_min=180,score_when=219] ~ ~ ~ particle flame ~ ~0.1 ~ 0.3 0.2 0.3 0.02 4 force

可识别物品标记:[高频循环]

  1. scoreboard players tag @e[type=Item] add kkd {Item:{id:"minecraft:dye",Count:2b,Damage:3s},OnGround:1b}
  2. scoreboard players tag @e[type=Item] add ngzz {Item:{id:"minecraft:pumpkin_seeds",Count:1b,Damage:0s},OnGround:1b}
  3. scoreboard players tag @e[type=Item] add tcg {Item:{id:"minecraft:beetroot",Count:1b,Damage:0s},OnGround:1b}
  4. scoreboard players tag @e[type=Item] add xrzl {Item:{id:"minecraft:dye",Count:3b,Damage:2s},OnGround:1b}
  5. scoreboard players tag @e[type=Item] add mgh {Item:{id:"minecraft:dye",Count:1b,Damage:1s},OnGround:1b}
  6. scoreboard players tag @e[type=Item] add lyf {Item:{id:"minecraft:blaze_powder",Count:2b,Damage:0s},OnGround:1b}
  7. scoreboard players tag @e[type=Item] add hjsl {Item:{id:"minecraft:prismarine_crystals",Count:2b,Damage:0s},OnGround:1b}
  8. scoreboard players tag @e[type=Item] add dlsrl {Item:{id:"minecraft:dye",Count:1b,Damage:12s},OnGround:1b}

物品标记处理:[高频循环]

  1. execute @e[type=Item,tag=!] ~ ~ ~ scoreboard players tag @e[type=area_effect_cloud,name=Med,r=1,c=1] add working
  2. scoreboard players add @e[type=area_effect_cloud,name=Med,tag=working] when 1
  3. execute @e[type=area_effect_cloud,name=Med,tag=working] ~ ~ ~ entitydata @e[type=Item,tag=!,r=1] {PickupDelay:10000,Age:-23333}
  4. execute @e[type=area_effect_cloud,name=Med,tag=working] ~ ~ ~ scoreboard players tag @e[type=Item,tag=!,r=1] add amed

检测炼药锅水量:[高频循环]

  1. execute @e[type=area_effect_cloud,name=Med,score_when_min=219,score_when=219] ~ ~ ~ detect cauldron 3 scoreboard players set @e[type=area_effect_cloud,name=Med,c=1,r=0] gwater 4
  2. execute @e[type=area_effect_cloud,name=Med,score_when_min=219,score_when=219] ~ ~ ~ detect cauldron 2 scoreboard players set @e[type=area_effect_cloud,name=Med,c=1,r=0] gwater 3
  3. execute @e[type=area_effect_cloud,name=Med,score_when_min=219,score_when=219] ~ ~ ~ detect cauldron 1 scoreboard players set @e[type=area_effect_cloud,name=Med,c=1,r=0] gwater 2
  4. execute @e[type=area_effect_cloud,name=Med,score_when_min=219,score_when=219] ~ ~ ~ detect cauldron 0 scoreboard players set @e[type=area_effect_cloud,name=Med,c=1,r=0] gwater 1
  5. scoreboard players tag @e[type=area_effect_cloud,name=Med,score_when_min=219,score_when=219,score_gwater=1] add nowater

物品识别处理:[高频循环]

    怪异的液体
  1. execute @e[type=area_effect_cloud,score_when_min=220,score_when=220,tag=!nowater] ~ ~ ~ execute @e[type=Item,tag=kkd,r=1] ~ ~ ~ execute @e[type=Item,tag=ngzz,r=1] ~ ~ ~ scoreboard players tag @e[type=area_effect_cloud,name=Med,r=1,c=1] add gydyt
  2. execute @e[type=area_effect_cloud,name=Med,tag=gydyt,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=kkd,r=1]
  3. execute @e[type=area_effect_cloud,name=Med,tag=gydyt,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=ngzz,r=1]
  4. 香甜的汁液
  5. execute @e[type=area_effect_cloud,score_when_min=220,score_when=220,tag=!nowater] ~ ~ ~ execute @e[type=Item,tag=tcg,r=1] ~ ~ ~ execute @e[type=Item,tag=xrzl,r=1] ~ ~ ~ scoreboard players tag @e[type=area_effect_cloud,name=Med,r=1,c=1] add xtdzy
  6. execute @e[type=area_effect_cloud,name=Med,tag=xtdzy,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=tcg,r=1]
  7. execute @e[type=area_effect_cloud,name=Med,tag=xtdzy,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=xrzl,r=1]
  8. 岩浆水
  9. execute @e[type=area_effect_cloud,score_when_min=220,score_when=220,tag=!nowater] ~ ~ ~ execute @e[type=Item,tag=mgh,r=1] ~ ~ ~ execute @e[type=Item,tag=lyf,r=1] ~ ~ ~ scoreboard players tag @e[type=area_effect_cloud,name=Med,r=1,c=1] add yjs
  10. execute @e[type=area_effect_cloud,name=Med,tag=yjs,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=mgh,r=1]
  11. execute @e[type=area_effect_cloud,name=Med,tag=yjs,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=lyf,r=1]
  12. 深海冰水
  13. execute @e[type=area_effect_cloud,score_when_min=220,score_when=220,tag=!nowater] ~ ~ ~ execute @e[type=Item,tag=hjsl,r=1] ~ ~ ~ execute @e[type=Item,tag=dlsrl,r=1] ~ ~ ~ scoreboard players tag @e[type=area_effect_cloud,name=Med,r=1,c=1] add shbs
  14. execute @e[type=area_effect_cloud,name=Med,tag=shbs,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=hjsl,r=1]
  15. execute @e[type=area_effect_cloud,name=Med,tag=shbs,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=dlsrl,r=1]

成品生成:[高频循环]

  1. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220] ~ ~ ~ kill @e[type=Item,tag=amed,r=1]
  2. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=gydyt] ~ ~ ~ summon Item ~ ~0.5 ~ {CustomName:"成功!",CustomNameVisible:1b,Item:{id:minecraft:potion,Count:1b,Damage:0s,tag:{Potion:"minecraft:thick",CustomPotionEffects:[{Id:9,Amplifier:1,Duration:300},{Id:23,Amplifier:1,Duration:20}],display:{Name:"怪异的液体",Lore:["好像能填饱肚子"]},HideFlags:63}}}
  3. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=xtdzy] ~ ~ ~ summon Item ~ ~0.5 ~ {CustomName:"成功!",CustomNameVisible:1b,Item:{id:minecraft:potion,Count:1b,Damage:0s,tag:{Potion:"minecraft:mundane",CustomPotionEffects:[{Id:8,Amplifier:1,Duration:400},{Id:25,Amplifier:1,Duration:40}],display:{Name:"香甜的汁液",Lore:["黄绿黄绿的"]},HideFlags:63}}}
  4. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=yjs] ~ ~ ~ summon Item ~ ~0.5 ~ {CustomName:"成功!",CustomNameVisible:1b,Item:{id:minecraft:potion,Count:1b,Damage:0s,tag:{Potion:"minecraft:mundane",CustomPotionEffects:[{Id:1,Amplifier:1,Duration:300},{Id:3,Amplifier:2,Duration:200},{Id:7,Amplifier:0,Duration:1},{Id:20,Amplifier:0,Duration:100}],display:{Name:"岩浆水",Lore:["火辣辣!"]},HideFlags:63}}}
  5. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=shbs] ~ ~ ~ summon Item ~ ~0.5 ~ {CustomName:"成功!",CustomNameVisible:1b,Item:{id:minecraft:potion,Count:1b,Damage:0s,tag:{Potion:"minecraft:mundane",CustomPotionEffects:[{Id:10,Amplifier:0,Duration:200},{Id:12,Amplifier:1,Duration:200},{Id:18,Amplifier:0,Duration:300},{Id:20,Amplifier:0,Duration:100}],display:{Name:"深海冰水",Lore:["瓶身还冒着寒气"]},HideFlags:63}}}

结尾处理:[高频循环]

  1. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220] ~ ~ ~ particle largesmoke ~ ~ ~ 0.4 0.5 0.4 0.01 100
  2. scoreboard players tag @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=gydyt] remove gydyt
  3. scoreboard players tag @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=xtdzy] remove xtdzy
  4. scoreboard players tag @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=yjs] remove yjs
  5. scoreboard players tag @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=shbs] remove shbs
  6. scoreboard players remove @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,score_gwater_min=2] gwater 1
  7. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,score_gwater_min=1,score_gwater=1] ~ ~ ~ setblock ~ ~ ~ cauldron 0
  8. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,score_gwater_min=2,score_gwater=2] ~ ~ ~ setblock ~ ~ ~ cauldron 1
  9. execute @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,score_gwater_min=3,score_gwater=3] ~ ~ ~ setblock ~ ~ ~ cauldron 2
  10. scoreboard players tag @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220,tag=nowater] remove nowater
  11. scoreboard players tag @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220] remove working
  12. scoreboard players reset @e[type=area_effect_cloud,name=Med,score_when_min=220,score_when=220] when


OOC:

v1.11.2-v1.12
展开


欢迎加群交流划水:481528679