Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

set_pinv(pinv()) clears EntityTag values

未关闭
#1,349 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
backend

调研方向

首先使用列出的物品命令重现 set_pinv(pinv()) 往返过程,然后跟踪 set_pinv 和 pinv 使用的物品栏转换。检查 EntityTag 和 BlockEntityTag 是如何表示的,并一并查看相关的 BlockStateTag 问题。当这些标签能够在往返过程中保留,并且三个示例保持其原有行为时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug

CommandHelper seems to not support EntityTag for ItemStacks, resulting in that information being lost when updating the inventory using:

set_pinv(pinv())

I guess this is similar to #1343 (BlockStateTag)

Tested on:

CommandHelper-3.3.5-b309
Purpur-1.19.3-b1895


Test item 1:

/give @s minecraft:item_frame{EntityTag:{Invisible:1b}}

Places an invisible item frame.
After set_pinv(pinv()) it will remove the invisible tag and place a normal item frame. Also applies to glow_item_frame.

Test item 2:

/give @s minecraft:polar_bear_spawn_egg{EntityTag:{id:"minecraft:iron_golem", CustomName:'{"text":"Jerry"}', CustomNameVisible:1b}}

Looks like a polar bear spawn egg but spawn an iron golem named Jerry. right-clicking a spawner makes it an iron golem spawner.
After set_pinv(pinv()) it turns into a normal polar bear spawn egg.

With 1.20 experimental features we now have a vanilla iron_golem_spawn_egg item (and other previously unobtainable eggs), which don't use EntityTag. But this tag can still be used to make the spawned mob have specific traits.

Test item 3:

/give @s bee_nest{BlockEntityTag:{Bees:[{EntityData:{id:"minecraft:bee"}},{EntityData:{id:"minecraft:bee"}},{EntityData:{id:"minecraft:bee"}}]}}

When placed during the day, 3 bees come out of the hive.
After set_pinv(pinv()) it will remove all the bee information, creating an empty hive. When placed during the day no bees come out.

This item can be obtained in vanilla survival using a silktouch enchanted tool.
Having access to this tag could allow us to check how many bees are in the beenest/hive item.

主要语言
Java
星标
128
派生
70
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

EngineHub/CommandHelper 的其他 Issue

查看 EngineHub/CommandHelper 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。