Saving a blockstate to a block when broken?

Started by jmods on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Saving a blockstate to a block when broken?

I'm currently using Nerdy's Blockstates plugin to change the blockstate of blocks in my mod. However when I break the block the blockstate is reverted to the original, how could I save the blockstate to the block/item so that when its broken, picked up and placed again it places with the same blockstate it had when it was broken?

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The reason this happens…
Fri, 10/04/2024 - 21:04

The reason this happens should be pretty obvious;

You wouldn't expect if you broke a log with axis:z block state that it would then always be axis:z every time you place it...

 

You should probably use NBT for stuff that should stay on the item like that. Although I'm not familiar with that plugin so I don't know how you'd use that...

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've tried multiple…
Fri, 10/04/2024 - 21:41

I've tried multiple different ways using NBT's but just can't seem to get it to work. I've managed to be able to break the block and maintain the NBT's so it goes into a seperate stack but when I place it down it just reverts entirely

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hm, maybe that's quirk of…
Fri, 10/04/2024 - 21:51

Hm, maybe that's quirk of the blockstate plugin?