Posted December 31, 20213 yr I have a custom block that i want always to be lit up and ignore all lighting. How can i do that?
December 31, 20213 yr add lightLevel to your Block.Properties, inside of the ToIntFunction retrun the light value you want, in your case 15
January 1, 20223 yr Author lightLevel truns the block into a light source. i realized that having the light level at 15 would not look great for what i need, i found out that .isValidSpawn(Blocks::never).isRedstoneConductor(Blocks::never).isSuffocating(Blocks::never).isViewBlocking(Blocks::never)) gives the block behavior similar to glass which is what my block is supposed to be like but the methods listed above dont seem to work in my own class
January 1, 20223 yr take a look into the GlassBlock 1 hour ago, KaboomRoads said: but the methods listed above dont seem to work in my own class 17 hours ago, Luis_ST said: add lightLevel to your Block.Properties the methode is not inside your Block class, for an example you can take a look at the Blocks.BEACON
January 1, 20223 yr Author by my own class i mean my custom blocks class where i register all my blocks the problem is that Blocks cannot be resolved when i put Blocks::never into the params of the methods
January 1, 20223 yr 42 minutes ago, KaboomRoads said: Blocks::never yeah the method does not exist in your class, learn basic java
January 1, 20223 yr Author it does i copied it from the blocks class private static boolean never(BlockState p_50806_, BlockGetter p_50807_, BlockPos p_50808_) { return false; } and then i changed Blocks::never to ModBlocks::never Edited January 1, 20223 yr by KaboomRoads
January 1, 20223 yr this should work, but only for: isValidSpawn isRedstoneConductor isSuffocating isViewBlocking but for lightLevel you need a method with BlockState as parameter and an int as retrun value
January 1, 20223 yr Author i only need isValidSpawn isRedstoneConductor isSuffocating isViewBlocking i already did the lightLevel but its not working Edited January 1, 20223 yr by KaboomRoads
January 1, 20223 yr 38 minutes ago, KaboomRoads said: but its not working define not working, also show your code
January 3, 20223 yr Author i fixed it now. there was a different never boolean somewhere in the blocks class private static Boolean never(BlockState p_50779_, BlockGetter p_50780_, BlockPos p_50781_, EntityType<?> p_50782_) { return (boolean) false; } Edited January 3, 20223 yr by KaboomRoads
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.