Way of altering entity's item in hand

Started by Vision Quester on Sun, 03/22/2020 - 11:58

Topic category: Feature requests and ideas for MCreator

Last seen on 08:33, 9. Apr 2020
Joined Nov 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Way of altering entity's item in hand
Sun, 03/22/2020 - 16:42 (edited)

Hi.  It would be nice if we could do more with an entity's item in hand.  Example: read the quantity of the item in hand, change the quantity of the item in hand, and change the item in hand for another item.  I know we can read the item in hand and remove it from the inventory.  But there's no way to find out how many he's holding in his hand so we can remove just the amount in hand.

Application: I'm trying to make a garbage can that, when right clicked on, will remove the item in hand.  All we can do now is just remove the item in hand from the inventory.  But if the player wants to keep some of the item in the inventory and just destroy the amount in his hand, I need to know how many he has in his hand.  Otherwise I have to settle for just removing 1 item at a time, meaning the player has to click 40 times to destroy a stack of 40 items in hand.  Or, if I arbitrarily write the code to destroy 64 quantity of the item in hand, when he's holding only 40, it would end up destroying more than he wants to destroy from his inventory if he wants to keep some of it.

It would also be nice to be able to change the item in hand, for example, changing an empty custom bucket for a full one and vice-versa, or changing a bucket of one custom fluid for another custom fluid, by directly affecting the item in hand.

Edited by Vision Quester on Sun, 03/22/2020 - 16:42
Last seen on 04:35, 28. Oct 2020
Joined Jun 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
There is a plugin for this I…
Mon, 03/23/2020 - 02:08

There is a plugin for this I think