Started by
Evgen_Games
on
Topic category: Help with Minecraft modding (Java Edition)
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?
I know I can use command "replaceitem" but I think mcreator devs can fix bug with this code.