Creating and setting NBT tags

Started by RamenNoods on

Topic category: Help with modding (Java Edition)

Last seen on 04:54, 27. Apr 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Creating and setting NBT tags

I'm working on a mod that adds some blocks that act as tiles in a falling sand game (sand that falls down or diagonal, water that moves random, etc).
Right now I just have the sand check if the block below it is air before it falls, but I want to change it so that it checks if the "density" value of the block below it is lower than its own. So that sand can fall through water or gases and such.

How do I create, set, and use NBT tags in logic?

 

Last seen on 23:11, 22. Apr 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is supposed to work:If…
Tue, 02/13/2024 - 02:22

This is supposed to work:

If Density of Block at X  Y-1  Z < Density of Block at X  Y  Z (Sand)

     return(true)

return(false)

 

Last seen on 04:54, 27. Apr 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah I mean how do I create…
Tue, 02/13/2024 - 02:58

Yeah I mean how do I create and assign NBT tags? I don't even have a density tag to begin with.