Unable to set blockitem properties..?

Started by offllne_player on

Topic category: Advanced modding

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Unable to set blockitem properties..?
Wed, 02/05/2025 - 21:32 (edited)

I'm really strugging with mcreator limiting what I can do with the mods base files.

I am trying to make a blockitem have item properties. (a modded block in item form)

Specifically, a couple netherite blocks that can't burn and have EPIC rarity. 2 item properties.

I have tried writing a seperate item file as mcreator does with a fluid bucket item, Mcreator deletes that.

I have tried writing a lot of different ways in the "MyModsItems.Java" custom code section..
no matter what I write I can't figure out how to set item properties for a blockitem.

can someone guide me to do it ANY way?

I've looked over the neoforge 1.21.1 blockitem docs and it looks like I've done it right..but..Mcreator wipes this..

this is what I'm trying to write in the "MymodsItems.Java":
( Ignore the extra 4 gold and diamond stuff at the top, just my other items photobombing):

 mcreator deletes this file too.. so this way doesn't work.

I'm hoping someone can guide me on this, I'm assuming there is a way to give blockitems properties..?


 

Edited by offllne_player on Wed, 02/05/2025 - 21:32
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey there, here's a solution…
Wed, 02/05/2025 - 21:33

Hey there, here's a solution that could help.

Create a new item that uses the "block item held" model, give it all of the properties you want.

Now I don't remember entirely, but I am pretty sure you can check the face of a block if right-clicked using the right click (block pos.) trigger. If so, add the block you want a block away from the face that was found and play the block placing sound..

 

If the above doesn't work, lock the element's code, open the item code file through the built in code editor and manually put in the properties.

I hope this helps.

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've tried creating another…
Wed, 02/05/2025 - 21:41

I've tried creating another item with the same name and giving it the properties as well, mcreator makes an item out of the block automatically, making 2 items.

It almost works, making an item that places the block. But then I end up with 2 items in the menus..clunky and yucky.

Also. That's not setting the properties of the blockitem..
That's a jimmy way I already attempted as well lol..
Thanks anyways.