Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slot for inventory PUTting #105

Closed
oblx opened this issue Jul 8, 2018 · 2 comments
Closed

Add slot for inventory PUTting #105

oblx opened this issue Jul 8, 2018 · 2 comments
Assignees
Labels
enhancement New feature for the Web-API

Comments

@oblx
Copy link
Contributor

oblx commented Jul 8, 2018

Modifying inventories is awesome but it doesn't take slot index in account.

When I GET player inventory and then PUT it back then all items are still there but they are sorted from the very first slot in the inventory and not in the action bar.

Maybe it would be possible to add a "slot" option ?

{
"inventory": [{
      "type": {"id": "minecraft:stone"},
	  "quantity": 2
	  },{
      "type": {"id": "minecraft:tipped_arrow"},
      "quantity": 1
	  }, {
      "type": {"id": "minecraft:enchanted_book"},
      "quantity": 1
	  }]
}

Becomes :

{
"inventory": [{
      "type": {"id": "minecraft:stone"},
	  "quantity": 2,
	  "slot": 5
	  },{
      "type": {"id": "minecraft:tipped_arrow"},
      "quantity": 1,
	  "slot": 8
	  }, {
      "type": {"id": "minecraft:enchanted_book"},
      "quantity": 1,
	  "slot": 0
	  }]
}

Edit : here is what I mean http://wiki.vg/File:Inventory-slots.png

@Valandur Valandur self-assigned this Jul 9, 2018
@Valandur Valandur added the enhancement New feature for the Web-API label Jul 9, 2018
@Valandur
Copy link
Owner

Valandur commented Jul 9, 2018

Implemented in v5.2.0

@Valandur Valandur closed this as completed Jul 9, 2018
@oblx
Copy link
Contributor Author

oblx commented Jul 9, 2018

Could you avoid empty slots when GETting a player/entity ? There are a lot of slots 😅

Not when PUTting because it can be useful to erase a given slot.

I can also filter when receiving request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature for the Web-API
Projects
None yet
Development

No branches or pull requests

2 participants