Items count doesn't change

Started by Evgen_Games on

Topic category: Help with modding (Java Edition)

Last seen on 08:51, 11. Jul 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Items count doesn't change

MCreator 2022.1; Minecraft Forge 1.16.5

I need to change items and count of them in main hand but I can't change count. If I held 64 items, there will be 64 dirt blocks. If I held 1 item, it will leave 1 dirt.

if (entity instanceof LivingEntity) {
    ItemStack _setstack = new ItemStack(Blocks.DIRT);
    _setstack.setCount(10);
    ((LivingEntity) entity).setHeldItem(Hand.MAIN_HAND, _setstack);
}

How can I fix that?

Last seen on 08:51, 11. Jul 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know I can use command …
Sat, 07/09/2022 - 10:04

I know I can use command "replaceitem" but I think mcreator devs can fix bug with this code.