Jump to content

How do I add an ItemStack to a horse inventory slot?


Agreenstopsign

Recommended Posts

1 hour ago, Agreenstopsign said:

yes I know that, however, replaceItemInInventory asks or a number (which represents the slot), and then the itemstack,
I do not know what the number for a horses saddle/horse armor slot is

Well look through the code and find out, it has to be somewhere, my guess is 0 for the saddle and 1 for the armor.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

I have looked quite a bit.. and I have also tested 0 and 1, and it just creates the item stack in my hotbar slots 0 and 1.
I also looked through a bit of code for horses, and whenever saddle slot was brought up, I would see either 3, or -18, however, once again neither work, -18 crashes the game, and 3 simply adds it to hotbar

 

Edited by Agreenstopsign
Link to comment
Share on other sites

4 minutes ago, Agreenstopsign said:

I have looked quite a bit.. and I have also tested 0 and 1, and it just creates the item stack in my hotbar slots 0 and 1

 

I'm gonna take a wild guess and say you're calling the method on the player, I can't be certain without seeing your code.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

I have found that the horses saddle slot is most likely 400, and armor slot is 401.. however I still cannot seem to add an itemstack, I have "mc.player.getRidingEntity().replaceItemInInventory(401, itemstack);"
but still, in game nothing seems to happen

I found out the info about the slot number in the file for the /ReplaceItem command, 

 

Edited by Agreenstopsign
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.