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

When i get the Player position:

int x = (int)player.posX;

int y = (int)player.posY;

int z = (int)player.posZ;

 

Its slipped sometimes away.

In default worldtype its sometimes under me sometime not!

Other cases its +1 or -1 to X or Y.

I flat its never where i stand.

For example: Playing a sound not plays where i stand.

 

 

I made a dummy dynamic light for testing reasons.

PLAYER ticking CLIENT registration.

There is no packet or anything special, just CLIENT.

TestTickHandler:

 

 

package fluffy.lantern.handler;

import java.util.EnumSet;

 

import net.minecraft.block.Block;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.world.EnumSkyBlock;

import cpw.mods.fml.common.ITickHandler;

import cpw.mods.fml.common.TickType;

public class TestTickHandler implements ITickHandler

{

private final EnumSet<TickType> ticksToGet;

 

private static int lastX = 0;

private static int lastY = 0;

private static int lastZ = 0;

 

 

public TestTickHandler(EnumSet<TickType> ticksToGet)

{

this.ticksToGet = ticksToGet;

}

 

@Override

public void tickStart(EnumSet<TickType> type, Object... tickData)

{

playerTick((EntityPlayer)tickData[0]);

}

@Override

public void tickEnd(EnumSet<TickType> type, Object... tickData)

{

}

@Override

public EnumSet<TickType> ticks()

{

return ticksToGet;

}

@Override

public String getLabel()

{

return "TutorialPlayerTick";

}

 

public static void playerTick(EntityPlayer player)

{

if(player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().itemID == Block.torchWood.blockID){

 

int x = (int)player.posX;

int y = (int)player.posY;

int z = (int)player.posZ;

 

if(x != lastX || y != lastY || z != lastZ)

{

player.worldObj.setLightValue(EnumSkyBlock.Block, x, y, z, 14);

 

player.worldObj.updateLightByType(EnumSkyBlock.Block, lastX, lastY, lastZ);

 

player.worldObj.updateLightByType(EnumSkyBlock.Block, x+1, y, z);

player.worldObj.updateLightByType(EnumSkyBlock.Block, x-1, y, z);

player.worldObj.updateLightByType(EnumSkyBlock.Block, x, y+1, z);

player.worldObj.updateLightByType(EnumSkyBlock.Block, x, y-1, z);

player.worldObj.updateLightByType(EnumSkyBlock.Block, x, y, z+1);

player.worldObj.updateLightByType(EnumSkyBlock.Block, x, y, z-1);

 

lastX = x;

lastY = y;

lastZ = z;

}

 

}else if((player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().itemID != Block.torchWood.blockID) || (player.getCurrentEquippedItem() == null))

{

player.worldObj.updateLightByType(EnumSkyBlock.Block, lastX, lastY, lastZ);

 

lastX = 0;

lastY = 0;

lastZ = 0;

}

}

}

 

 

 

I thing its a Forge or Minecraft related bug.

1) Not a support issue

2) You're not casting numbers correctly

3) We don't support 1.6.4 anymore

4) This is not the modder support area.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.