Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I code colored light sources for charged light source blocks? #1

Open
Ansrtion opened this issue Jul 2, 2024 · 2 comments

Comments

@Ansrtion
Copy link

Ansrtion commented Jul 2, 2024

I want to add colored light sources for blocks like the respawn anchor, sea pickle, and candle, with their light intensity changing based on their charge level. However, my coding experience is limited, and I don't know how to modify the JSON files. Additionally, I'm unsure if the canvas-colored light branch supports this feature.

@ambrosia13
Copy link
Owner

The documentation for the colored lights is under "Block Light API" in the PR: vram-guild/canvas#428.

To make the light values change depending on charge level, you can locate what blockstate affects the charge level (you'll probably find this information when looking at the block in the F3 menu) and add in the variant overrides. For example, for the respawn anchor, you can make the default light be black (a.k.a. no light) and each respective charge level have increasing light intensities.

An example of this in "Immersive Lights" can be found in some blocks like redstone ore: https://github.com/ambrosia13/Immersive_Lights/blob/main/assets/minecraft/lights/block/deepslate_redstone_ore.json

https://github.com/spiralhalo/canvas/tree/light-prism should support the colored lights feature, but no other versions of canvas support it.

@Ansrtion
Copy link
Author

Ansrtion commented Jul 3, 2024

I think it should be working normally. Variants charges are normal, and checking block properties with F3 is feasible.
Thank you for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants