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

Posted

I'm having some trouble getting the correct light value at the players coordinates.
 

Double playerX = Minecraft.getMinecraft().thePlayer.posX;
Double playerY = Minecraft.getMinecraft().thePlayer.posY;
Double playerZ = Minecraft.getMinecraft().thePlayer.posZ;
int playerlightlevel = Minecraft.getMinecraft().theWorld.getBlockLightValue(playerX.intValue(), playerY.intValue(), playerZ.intValue());
System.out.println("Light Level modifier is " + playerlightlevel);

 

In full daylight outdoors this returns 15 to console as expected, however if there is a block at eye level next to and behind the player (not on top) the value returns 0, even though F3 Screen shows 15 still.

 

See:

http://imgur.com/a/1JzVV

 

This code occurs inside a LivingUpdateEvent and triggers once every tick, but slowing the rate at which its checked did not help either.  Also checking at y-1 did not effect it, except the requirement for it to output zero is that you needed to stand three blocks deep instead of two.

 

Being that it's after 3 am maybe it's just me missing something simple, but how can I get the same light value as the one registered in the f3 screen?

 

Edit: Here is the whole class: http://pastebin.com/UWt6m62A

Edited by ignatio

  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.