CommandUpdate类库
类库**了一套完整的方法,除了支持升级1.11+升级至1.13,还支持1.11-升级至1.11,还可以无视版本直接升级至1.13
使用方法详见https://github.com/tremblestarman/MinecraftCommandUpdate,下方**一些说明:
首先使用命名空间
关于1.13升级
- CommandUpgrade.to1_13Command.CommandConvert(string input)
复制代码 效果- /execute @r[score_good_min=1] ~ ~ ~ say hi
- ->
- execute as @a[score_good=1..,sort=random] at @s ~ ~ ~ then say hi
复制代码- CommandUpgrade.to1_13Command.BatchConvert(string input)
复制代码 效果- /execute @r[score_good_min=1] ~ ~ ~ say hi
- scoreboard players operation @a[c=1,m=2] score1 = @e[x=0,y=0,z=0,r=1] score2
- ->
- execute as @a[score_good=1..,sort=random] at @s ~ ~ ~ then say hi
- scoreboard players operation @a[gamemode=adventure,limit=1] score1 = @e[distance=..1,x=0.5,z=0.5,y=0] score2
复制代码- CommandUpgrade.to1_13Command.BlockCombine(string blockID, string blockData, string blockNBT)
复制代码 效果- blockID = minecraft:chest, blockData = facing=north, blockNBT = {Items:[{Slot:0b,id:"minecraft:apple",Count:1b,Damage:0s}]}
- ->
- minecraft:chest[facing=north]{Items:[{Slot:0b,id:"minecraft:apple",Count:1b,Damage:0s}]}
复制代码- CommandUpgrade.to1_13Command.ItemCombine(string itemID, string itemData, string itemNBT)
复制代码 效果- itemID = minecraft:apple, itemData = 0, itemNBT = {display:{Name:"my apple"}}
- ->
- minecraft:apple{display:{Name:"my apple"},Damage:0s}
复制代码- CommandUpgrade.to1_13Command.EntitySelector(string entitySelector, string entityNBT)
复制代码 效果- entitySelector = @e[type=sheep,name=jeb_,score_health_min=1,score_health=7,c=1], entityNBT = {OnGround:1b}
- ->
- @e[score_health=1..7,limit=1,name="jeb_",type=sheep,nbt={OnGround:1b}]
复制代码 关于1.11升级
- CommandUpgrade.to1_11Command.CommandConvert(string input)
复制代码 效果- testfor @e[type=Armorstand]
- ->
- testfor @e[type=armor_stand]
复制代码 多个指令批量升级:
- CommandUpgrade.to1_11Command.BatchConvert(string input)
复制代码 效果- testfor @e[type=Armorstand]
- testfor @e[type=Sheep]
- ->
- testfor @e[type=armor_stand]
- testfor @e[type=sheep]
复制代码 关于指令直接升级
- 无论版本,直接指令升级至最新(前一个是单个指令,后一个是批量):
- CommandUpgrade.helicopterCommand.CommandConvert(string input)
- CommandUpgrade.helicopterCommand.BatchConvert(string input)
复制代码
|