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.

Qplay123

Members
  • Joined

  • Last visited

Everything posted by Qplay123

  1. Maybe this will work as replacement for default rayTrace method: import net.minecraft.entity.effect.LightningBoltEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.math.*; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; public class CustomItem extends Item { public CustomItem() { super(new Item.Properties().group(ItemGroup.TOOLS)); } @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { if (worldIn instanceof ServerWorld) { ServerWorld world = (ServerWorld) worldIn; RayTraceResult raytraceresult = rayTrace(worldIn, playerIn, RayTraceContext.FluidMode.ANY); double posX = raytraceresult.getHitVec().x; double posY = Math.floor(raytraceresult.getHitVec().y); double posZ = raytraceresult.getHitVec().z; System.out.println(posX); System.out.println(posY); System.out.println(posZ); BlockPos pos = new BlockPos(posX, posY, posZ); LightningBoltEntity l = new LightningBoltEntity(worldIn, posX, posY, posZ, false); world.addLightningBolt(l); } return super.onItemRightClick(worldIn, playerIn, handIn); } protected static RayTraceResult rayTrace(World worldIn, PlayerEntity player, RayTraceContext.FluidMode fluidMode) { float f = player.rotationPitch; float f1 = player.rotationYaw; Vec3d vec3d = player.getEyePosition(1.0F); float f2 = MathHelper.cos(-f1 * ((float)Math.PI / 180F) - (float)Math.PI); float f3 = MathHelper.sin(-f1 * ((float)Math.PI / 180F) - (float)Math.PI); float f4 = -MathHelper.cos(-f * ((float)Math.PI / 180F)); float f5 = MathHelper.sin(-f * ((float)Math.PI / 180F)); float f6 = f3 * f4; float f7 = f2 * f4; double d0 = 8192; Vec3d vec3d1 = vec3d.add((double)f6 * d0, (double)f5 * d0, (double)f7 * d0); return worldIn.rayTraceBlocks(new RayTraceContext(vec3d, vec3d1, RayTraceContext.BlockMode.OUTLINE, fluidMode, player)); } } I just got it from Item.rayTrace and changed this line: double d0 = double d0 = player.getAttribute(PlayerEntity.REACH_DISTANCE).getValue();; to: double d0 = 8192d; You can change the value if you want.
  2. Yes It's also working with minecraft 1.12.2
  3. My Minecraft no longer works by Forge on Ubuntu 18.10. And I am really serious. And I do not have a crash report. So it is difficult to gather information. I do have an nVidia GeForce 390 series GPU 4 GB Video Ram 8 GB of Ram OS: Ubuntu 18.10 (No LTS) Java version OpenJDK 8 (JRE and JDK) Intel Core i7 8th Gen. EDIT: I found a log where possible good information. launcher_log.txt

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.