Is everything, including mods, limited to pixels in Minecraft Java?



  • I am currently making a mod mostly about color and design for creative mode, and I've been trying to figure out what function or tool should be made so users can decide on the color they want to use. There is one that I definitely will make which is the Eyedropper tool which would pick up a certain pixel's color. I am unsure of the other, which would best be if it was a block with a tool like https://www.canva.com/colors/color-wheel/ , but I wanted to check if it is possible for gradients to be included in a Minecraft block with a block entity, or would it end up turning pixelated?

    This is an example of what I mean by pixelated vs not pixelated (even though, yes, they both end up getting pixelated because they later turn out not being vectors anymore). These are both saved as 64px * 64px, but if you zoom in on them to be the same size, they look different.

    72Ppi image

    vs

    300Ppi image



  • The short answer is that blocks can have whatever textures they want. For reasons of efficiency, vanilla Minecraft limits itself to 16 logical colours for coloured items/blocks, but that is simply a choice, not a technical restriction.

    (Side note: it used to be a technical restriction when coloured blocks were stored as a single block + 4 bits of arbitrary data, but that scheme is gone since 1.13)

    However, if you are adding custom content, then your textures can be whatever colour(s) you want in the 24-bit RGB space. So, for example if you are generating textures dynamically, then you can include gradients or whatever you want with no problem.

    (While not really part of the question, as for implementing the eye dropper tool, it seems like it might be easier to read from the screen buffer than trying to do something like raycasting in the world. But, I'm not sure if that is possible in the Minecraft engine, never tried it myself)




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2