<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sat Jan 11 08:22:42 UTC 2025

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Mojang Studios Jira</title>
    <link>https://bugs.mojang.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en</language>    <build-info>
        <version>9.12.2</version>
        <build-number>9120002</build-number>
        <build-date>10-01-2024</build-date>
    </build-info>


<item>
            <title>[BDS-18672] [Scripting] EntityEquippableComponent and its methods: setEquipment, getEquipmentSlot and getEquipment are broken</title>
                <link>https://bugs.mojang.com/browse/BDS-18672</link>
                <project id="11700" key="BDS">Bedrock Dedicated Server</project>
                    <description>&lt;p&gt;&lt;b&gt;@minecraft/server 1.6.0-beta&lt;/b&gt;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; { EntityEquippableComponent, EquipmentSlot, system, world } from &lt;span class=&quot;code-quote&quot;&gt;&apos;@minecraft/server&apos;&lt;/span&gt;;
system.runInterval(() =&amp;gt; {
    world.getAllPlayers().forEach(player =&amp;gt; {
        /**
         * @type {EntityEquippableComponent}
         */
        &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; equippable = player.getComponent(&lt;span class=&quot;code-quote&quot;&gt;&apos;minecraft:equippable&apos;&lt;/span&gt;);
        &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; slot = equippable.getEquipmentSlot(EquipmentSlot.Offhand);
        console.warn(slot?.typeId ?? &lt;span class=&quot;code-quote&quot;&gt;&apos;&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&apos;&lt;/span&gt;);
    });
});&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Expected Results:&lt;br/&gt;
logs the type of the item in my offhand.&lt;/p&gt;

&lt;p&gt;Observed Results:&lt;br/&gt;
throws&#160;&lt;br/&gt;
TypeError: Unexpected type passed to function argument &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;. &#160; &#160;at &amp;lt;anonymous&amp;gt; (index4.js:32)&lt;br/&gt;
at forEach (native)&lt;br/&gt;
at &amp;lt;anonymous&amp;gt; (index4.js:34)&lt;br/&gt;
does the same for getEquipment&#160; and setEquipment and for &quot;Offhand&quot; or any of the others it throws a native conversion type error.&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;
&lt;span class=&quot;code-comment&quot;&gt;//line 34
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; slot = equippable.getEquipmentSlot(EquipmentSlot.Offhand);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;also entity.getComponent(&quot;equippable&quot;); might not work on entities.&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; { EntityEquippableComponent, EquipmentSlot, system, world } from &lt;span class=&quot;code-quote&quot;&gt;&apos;@minecraft/server&apos;&lt;/span&gt;;
world.getDimension(MinecraftDimensionTypes.overworld).getEntities().forEach(entity =&amp;gt; {
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (entity.typeId !== &lt;span class=&quot;code-quote&quot;&gt;&apos;minecraft:skeleton&apos;&lt;/span&gt;) &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;;
&#160; &#160; &#160; &#160; console.warn(entity.typeId);
&#160; &#160; &#160; &#160; /**
&#160; &#160; &#160; &#160; &#160;* @type {EntityEquippableComponent}
&#160; &#160; &#160; &#160; &#160;*/
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; equippable = entity.getComponent(&lt;span class=&quot;code-quote&quot;&gt;&apos;minecraft:equippable&apos;&lt;/span&gt;);
&#160; &#160; &#160; &#160; &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; slot = equippable.getEquipmentSlot(EquipmentSlot.Mainhand);
&#160; &#160; &#160; &#160; console.warn(slot?.typeId ?? &lt;span class=&quot;code-quote&quot;&gt;&apos;&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;&apos;&lt;/span&gt;);
&#160; &#160; });
});

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;For a skeleton:&lt;br/&gt;
Expected Results:&lt;br/&gt;
logs &apos;minecraft:bow&apos;.&lt;/p&gt;

&lt;p&gt;Observed Results:&lt;br/&gt;
throws &lt;br/&gt;
TypeError: cannot read property &apos;getEquipmentSlot&apos; of undefined at &amp;lt;anonymous&amp;gt; (index4.js:42)&lt;br/&gt;
at forEach (native)&lt;br/&gt;
at &amp;lt;anonymous&amp;gt; (index4.js:44)&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-javascript&quot;&gt;
&lt;span class=&quot;code-comment&quot;&gt;//line 42
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; equippable = entity.getComponent(&lt;span class=&quot;code-quote&quot;&gt;&apos;minecraft:equippable&apos;&lt;/span&gt;);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="541605">BDS-18672</key>
            <summary>[Scripting] EntityEquippableComponent and its methods: setEquipment, getEquipmentSlot and getEquipment are broken</summary>
                <type id="1" iconUrl="https://bugs.mojang.com/secure/viewavatar?size=xsmall&amp;avatarId=18903&amp;avatarType=issuetype">Bug</type>
                                    <status id="5" iconUrl="https://bugs.mojang.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="4">Incomplete</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="mrpatches123">mrpatches123</reporter>
                        <labels>
                    </labels>
                <created>Fri, 25 Aug 2023 18:43:55 +0200</created>
                <updated>Tue, 14 May 2024 18:14:08 +0200</updated>
                            <resolved>Tue, 14 May 2024 18:14:08 +0200</resolved>
                                    <version>1.20.15 Hotfix</version>
                                                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="1322807" author="JIRAUSER484247" created="Tue, 14 May 2024 18:14:08 +0200"  >&lt;p&gt;Cleaning up old tickets: This ticket had been set to &apos;Awaiting Response&apos;, but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.&lt;/p&gt;

&lt;p&gt;Quick Links:&lt;br/&gt;
&#128211; Issue Guidelines &#8211; &#128172; Mojang Support &#8211; &#128231; Suggestions &#8211; &#128214; Minecraft Wiki&lt;/p&gt;
</comment>
                            <comment id="1287246" author="JIRAUSER730564" created="Wed, 25 Oct 2023 17:42:41 +0200"  >&lt;p&gt;This also happens in 1.20.31, on local worlds. But this time you can get the player&apos;s armor, not entities such as zombies&lt;/p&gt;</comment>
                            <comment id="1277487" author="JIRAUSER648376" created="Wed, 30 Aug 2023 13:01:47 +0200"  >&lt;p&gt;Hi&lt;/p&gt;

&lt;p&gt;This occur only on Bedrock Dedicated Server or it can be reproduced on local worlds/Realms?&lt;/p&gt;

&lt;p&gt;This ticket will automatically reopen when you reply. &lt;/p&gt;</comment>
                            <comment id="1276762" author="JIRAUSER465801" created="Fri, 25 Aug 2023 23:24:16 +0200"  >&lt;p&gt;Could this get swapped to bedrock edition instead of bds some how didn&#8217;t see it. Think something messed up as when I first copied it, it was &lt;a href=&quot;https://bugs.mojang.com/browse/BDS-18672&quot; title=&quot;[Scripting] EntityEquippableComponent and its methods: setEquipment, getEquipmentSlot and getEquipment are broken&quot; class=&quot;issue-link&quot; data-issue-key=&quot;BDS-18672&quot;&gt;&lt;del&gt;MCPE-174596&lt;/del&gt;&lt;/a&gt; which points towards &lt;a href=&quot;https://bugs.mojang.com/browse/BDS-18672&quot; title=&quot;[Scripting] EntityEquippableComponent and its methods: setEquipment, getEquipmentSlot and getEquipment are broken&quot; class=&quot;issue-link&quot; data-issue-key=&quot;BDS-18672&quot;&gt;&lt;del&gt;BDS-18672&lt;/del&gt;&lt;/a&gt; which is what it is currently.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Unconfirmed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12700" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Description</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>[Briefly describe the bug here]&lt;br/&gt;
&lt;br/&gt;
*Steps to Reproduce:*&lt;br/&gt;
# [Step 1]&lt;br/&gt;
# [Step 2]&lt;br/&gt;
# [Step 3]&lt;br/&gt;
&lt;br/&gt;
*Observed Results:*&lt;br/&gt;
[Describe what happens]&lt;br/&gt;
&lt;br/&gt;
*Expected Results:*&lt;br/&gt;
[Describe what should happen]&lt;br/&gt;
&lt;br/&gt;
*Screenshots/Videos attached:* [please attach an image or short video]&lt;br/&gt;
&lt;br/&gt;
*Notes:*</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11700" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_11100" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Linked</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_11300" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>Operating System Version</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Windows 11</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i2estj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>