Items count doesn't change

Started by Evgen_Games on

Topic category: Help with Minecraft modding (Java Edition)

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?

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.