• Recently Browsing

    No registered users viewing this page.

  • Posts

    • We cant Help without and Error. Pleased send the Error or describe it further.
    • I done everything I can and I've copied every tutorial I can find but I cant get it installed. I don't know if its something with java but I downloaded that and I cant figure out how, I really need someone to help out I just wanna  mod Minecraft for once
    • try { Class c = ComposterBlock.class; Method m = c.getMethod("registerCompostable", float.class, IItemProvider.class); m.setAccessible(true); } catch(NoSuchMethodException e) { System.out.println(e.toString()); }
    • 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.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 LightningStaffItem extends Item { public LightningStaffItem() { super(new Item.Properties().group(Groups.OVERPOWERED)); this.setRegistryName("lightning_staff"); } @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); /* Insert code for block */ /* Insert code for block */ /* Insert code for block */ } 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 = Vec3d adddoubledoubledoublereturn worldInrayTraceBlocksnew RayTraceContextRayTraceContextBlockModeOUTLINEfluidModeplayer 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.
  • Topics

  • Who's Online (See full list)