本帖最后由 SHEEP_REALMS 于 2021-10-16 10:59 编辑
如何安装
将north_compass.zip
north_compass.zip
(10.96 KB, 下载次数: 37)
放入存档datapacks文件夹,将north_compass_resources.zip
north_compass_resources.zip
(112.57 KB, 下载次数: 34)
放入资源包文件夹,进入游戏选择该资源包即可。
备用下载地址: https://github.com/ruhuasiyu/Cra ... apacks/NorthCompass
如何添加更多指北针
参考数据包本身已有的文件,将相应的文字stronghold替换掉即可。
注册物品:在north_compass/loot_tables中添加相应的json文件,例如village_compass.json。
复制代码结构地图:在north_compass/loot_tables/map中添加相应的json文件,例如village.json,将"destination": "Stronghold"改为"destination": "Village"。初始化判断:在north_compass/functions/target/main中添加相应的指令,例如
复制代码在north_compass/functions/target/off中添加相应的指令,例如
复制代码结构位置获取:在north_compass/functions/target中添加相应的函数文件,例如village.mcfunction。
复制代码合成:在north_compass/functions/tick中追加相应的指令,例如复制代码在north_compass/functions/craft中添加相应的函数文件,例如village_compass.mcfunction。
复制代码最后在资源包中assets/lang中添加相应的翻译文本即可。
v1.2 2019/07/24
来自群组: Nuclear Fusion
指北针
添加了- 指北针
将一个指南针和一个铁锭扔在地上即可合成,或使用指令获取。指北针永远指向北方,只有玩家手持时才有效。复制代码- loot give @s loot north_compass:north_compass
- 要塞指北针
将一个指南针和一个末影之眼扔在地上即可合成,或使用指令获取。要塞指北针会指向合成时最近的要塞位置,只有玩家手持时才有效。复制代码- loot give @s loot north_compass:stronghold_compass
如何安装
将north_compass.zip
备用下载地址: https://github.com/ruhuasiyu/Cra ... apacks/NorthCompass
如何添加更多指北针
参考数据包本身已有的文件,将相应的文字stronghold替换掉即可。
注册物品:在north_compass/loot_tables中添加相应的json文件,例如village_compass.json。
- {
- "pools": [
- {
- "rolls": 1,
- "entries": [
- {
- "type": "item",
- "name": "minecraft:carrot_on_a_stick",
- "functions": [
- {
- "function": "set_nbt",
- "tag": "{display:{Name:"{\\"translate\\":\\"item.north_compass.village_compass\\"}"},id:"north_compass:village_compass",CustomModelData:10870000,dict:["north_compass"],compassTarget:[0.0d,1.0d],HideFlags:63}"
- },
- {
- "function": "set_attributes",
- "modifiers": [
- {
- "name": "mainhand_attackSpeed",
- "attribute": "generic.attackSpeed",
- "operation": "addition",
- "amount": -4,
- "slot": "mainhand"
- },
- {
- "name": "mainhand_attackSpeed",
- "attribute": "generic.attackSpeed",
- "operation": "addition",
- "amount": -4,
- "slot": "offhand"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- execute as @s[nbt={SelectedItem:{tag:{id:"north_compass:village_compass"}}}] run function north_compass:target/village
- execute as @s[nbt={Inventory:[{Slot:-106b,tag:{id:"north_compass:village_compass"}}]}] run function north_compass:target/village
- summon armor_stand ~ ~ ~ {Tags:["village_compass"],NoGravity:1b,Marker:1b}
- loot replace entity @e[type=minecraft:armor_stand,tag=village_compass,distance=..1,limit=1] weapon.mainhand loot north_compass:map/village
- execute store result score #targX NCface run data get entity @e[type=minecraft:armor_stand,tag=village_compass,distance=..1,limit=1] HandItems[0].tag.Decorations[0].x
- execute store result score #targZ NCface run data get entity @e[type=minecraft:armor_stand,tag=village_compass,distance=..1,limit=1] HandItems[0].tag.Decorations[0].z
- kill @e[type=minecraft:armor_stand,tag=village_compass,distance=..1,limit=1]
- execute as @e[type=item,nbt={Item:{id:"minecraft:compass",Count:1b}}] at @s if entity @e[type=item,nbt={Item:{id:"minecraft:emerald",Count:1b}},distance=..1] run function north_compass:craft/village_compass
- kill @s
- kill @e[type=item,nbt={Item:{id:"minecraft:ender_eye",Count:1b}},distance=..1,sort=nearest,limit=1]
- loot spawn ~ ~ ~ loot north_compass:stronghold_compass
v1.2 2019/07/24
- 修复了指北针的错误。
- 移除了主手恼人的手抖动画。
来自群组: Nuclear Fusion
可还行(下次是不是吧指东(西)针做出来的呀)
当你们亲爱的版主都开始水帖子时.jpg
小星啊啊啊 发表于 2019-7-15 11:21
可还行(下次是不是吧指东(西)针做出来的呀)
有考虑做 指要塞针 指末地城针 之类的东西……
execute store 可以更改玩家物品的数值?(震撼)
(突然觉得自己好烦( )
(突然觉得自己好烦( )
为什么要反其道而行?