Datapack Utils

Datapack Utils

2k Downloads

The get_hotbar.mcfunction retrieves the entire player Inventory and not Slots 0-8

dthigpen opened this issue ยท 1 comments

commented
  1. What datapack(s) do you have installed (including ones made by me- include version if possible)?
    This one, Datapack-Utilities latest build

  2. Run /reload. Copy/paste or post a screenshot of what appears in chat (should say [Loaded ]).
    N/A

  3. What environment are you running the datapack? (Vanilla single player, Vanilla multiplayer, Forge, fabric, spigot, bukkit, paper, optifine, realms, etc). Please specify exact Minecraft version as well.
    Vanilla Single player

  4. What if happening vs. what you expect to happen?

What is happening:
After calling get_hotbar.mcfunction the entire players Inventory data is stored copied into the du block.
What I expect to happen:
After calling get_hotbar.mcfunction, it should only copy Inventory Slots 0-8 into the du block.

Steps to reproduce:
1. Load inventory hotbar and greater inventory with items. See screenshot below for Inventory data. It shows Items the hotbar slots 0,1,2 and an Item in the inventory slot 9. image
2. Run /function du:player/inv/get_hotbar
3. Run /data get block -29999999 0 1601 Items
4. Note that the returned data contains the Item with {Slot:9b}
image

commented

The restore function requires that all 27 slots be filled, otherwise it deletes items. You can safely ignore slots +9 and stick to modifying slots 0-8 and running restore.