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.

ToxeNRald351

Members
  • Joined

  • Last visited

Everything posted by ToxeNRald351

  1. I'm sorry, I didn't quite catch that. What do I do with it? What should I put in that function?
  2. Hello! I'm following a tutorial at moddingtutorials.org where they suggest I make an item that turns blocks into dirt on use. It works perfectly until I try to use the item on the block that is too far or out of my mining range or is too far. The block of dirt replaces the block I pointed to for just a fraction of a second and then goes back to its original state. I have no idea, how to fix this, other than setting the range of the item to match the mining range. Any suggestions? Here's my code for this: public class DirtStaff extends Item { public DirtStaff(Properties properties) { super(properties); } protected static BlockHitResult rayTrace(Level world, Player player, ClipContext.Fluid fluidMode) { float f = player.getXRot(); float f1 = player.getYRot(); Vec3 vec3 = player.getEyePosition(); float f2 = Mth.cos(-f1 * ((float)Math.PI / 180F) - (float)Math.PI); float f3 = Mth.sin(-f1 * ((float)Math.PI / 180F) - (float)Math.PI); float f4 = -Mth.cos(-f * ((float)Math.PI / 180F)); float f5 = Mth.sin(-f * ((float)Math.PI / 180F)); float f6 = f3 * f4; float f7 = f2 * f4; double d0 = 15; // range Vec3 vec31 = vec3.add((double)f6 * d0, (double)f5 * d0, (double)f7 * d0); return world.clip(new ClipContext(vec3, vec31, ClipContext.Block.OUTLINE, fluidMode, player)); } @Override public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) { BlockHitResult ray = rayTrace(world, player, ClipContext.Fluid.NONE); BlockPos lookPos = ray.getBlockPos(); world.setBlock(lookPos, Blocks.DIRT.defaultBlockState(), 1024); return super.use(world, player, hand); } }

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.