Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

add lightLevel to your Block.Properties, inside of the ToIntFunction retrun the light value you want, in your case 15

  • 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

ย 

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

  • 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

ย 

42 minutes ago, KaboomRoads said:

Blocks::never

yeah the method does not exist in your class, learn basic java

  • 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 by KaboomRoads

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

  • Author

i only needย 

isValidSpawn

isRedstoneConductor

isSuffocating

isViewBlocking

i already did the lightLevel

but its not working

Edited by KaboomRoads

  • 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 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.