[1.15.2]Minecraft数据包---搬箱器

该数据包允许玩家使用新增物品:搬箱器,来较为容易的搬运箱子。
该数据包隶属于 cAsual woRk (2/99)

效果演示

B站视频演示:
https://www.bilibili.com/video/BV1xE411P7UL

演示1

大致原理

判断玩家手持特殊胡萝卜杆,然后右键时视线追踪

1
2
execute if entity @s[distance=..7] if block ~ ~ ~ #carry:chest run summon minecraft:armor_stand ~ ~ ~ {Tags:["carry-maker"],Invisible:1b,Marker:1b,NoGravity:1b}
execute if entity @s[distance=..7] unless block ~ ~ ~ #carry:chest positioned ^ ^ ^0.005 run function carry:ray1

判断为箱子(包括陷阱箱)则在此处生成maker,然后将箱子的Items标签存进storage

1
execute as @e[type=armor_stand,tag=carry-maker] at @s run data modify storage carry Items set from block ~ ~ ~ Items

清除箱子,并在最近玩家处生成箱子物品(偷懒了,这里的判断并不准确),将storage里标签再转回去

1
2
3
execute as @e[type=armor_stand,tag=carry-maker] at @p[scores={carry-used=1}] run summon item ~ ~1 ~ {Tags:["carry"],Item:{id:"minecraft:chest",Count:1b}}
execute as @e[type=item,tag=carry,nbt={Item:{id:"minecraft:chest"}}] run data modify entity @s Item.tag.BlockEntityTag.Items set from storage carry Items
execute as @e[type=item,tag=carry,nbt={Item:{id:"minecraft:chest"}}] run data merge entity @s {PickupDelay:0s}

这个包总体来说挺简陋的,钓竿没做合成,没画材质,没做耐久(
可能有空会更新吧。但是估计永远不会再重写了

鸣谢

  • dhp真好用

datapack

链接:https://pan.baidu.com/s/1rVrsTMCo51jQzVNPJfv4fA
提取码:193g

  • 版权声明: 本博客所有文章除特别声明外,均采用 Apache License 2.0 许可协议。转载请注明出处!
  • © 2020 Argon_gas
  • Powered by Hexo Theme Ayer

请我喝杯咖啡吧~

支付宝
微信