visual-studio-code - 我正在为自定义食物制作 Minecraft 数据包,但它不工作
问题描述
我是制作 Minecraft 数据包的新手,我有点困惑。
我按照 TimberForge 的教程制作定制食物,当我尝试将食物从 切换minecraft:sweet_berries
到 时minecraft:mutton
,它突然停止工作。(食用时不给予药水效果)。
我目前在我的 loop.mcfunction 中的代码是:
scoreboard players set @a[nbt={SelectedItem:{id:"minecraft:mutton",tag:{poop:1b}}}] poo_delay 2
#### Run command for effect or any other command or function file if player eats custon item
#### (If the player has recently held the custom item and also just ate the base item)
execute as @a[scores={poo_delay=1..,poo_eat=1}] at @s run effect give @s nausea 10 1
execute as @a[scores={poo_delay=1..,poo_eat=1}] at @s run effect give @s weakness 10 1
#### Reset eat scoreboard
scoreboard players reset @a[scores={poo_eat=1..}] poo_eat
#### Constantly remove 1 from the delay
execute as @a[scores={poo_delay=1..}] unless entity @s[nbt={SelectedItem:{id:"minecraft:mutton",tag:{poop:1b}}}] run scoreboard players remove @s poo_delay 1
我的加载文件有这个:
tellraw @a {"text":"load","color":"yellow"}
#### Scoreboards
# Detect eating the base item
scoreboard objectives add poo_eat minecraft.used:minecraft.mutton
# Delay for detecting if player has recently held custom item
scoreboard objectives add poo_delay dummy
video)
give @a mutton{poop:1b,CustomModelData:1,display:{Name:'{"text":"Kent\'s Fecal Matter","italic":false}'}}
但是这不起作用。当我把所有东西都换回甜浆果时,它就可以了。有谁知道如何修理它?
解决方案
推荐阅读
- python-3.x - 将 Azure DevOps 管道详细信息发送到 SIEM
- python - Kafka-python 脚本无法正确执行
- .net-core - 如何在嵌套的 fluentvalidation 验证器中获取类名
- sql - 第 14 行“)”附近有问题的语法错误:SQL 语句 - SAP Hana
- reactjs - 当 post call 没有返回任何响应时,我需要一个 reducer 吗?
- multithreading - FMX 和 TMediaplayer 播放多个音频文件
- reactjs - 一个表单可以提交多个吗?
- r - 创建运行长度 ID,同时允许运行中存在一定长度的间隙
- swift - 如何获取 WidgetKit 小部件的高度和宽度?
- python - Python Scrapy - 产量不起作用,但 print() 确实