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.

X66Herobrine66X

Members
  • Joined

  • Last visited

Everything posted by X66Herobrine66X

  1. Hello, I have been having trouble figuring out how to make my sword spawn lightning on right click where I look. I have basic knowledge of java, I am currently taking mod design 2 on youth digital. I still don't know what vectors, and par2 and all that means, Im not very advanced. This is what I have so far: package mymod.items; import library.items.LibItemSword; import library.util.Actions; import mymod.Main; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionHealth; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.PlayerInteractEvent; public class MySword2 extends LibItemSword { public MySword2(String registryName, ToolMaterial material) { super(registryName, material); this.setCreativeTab(Main.my_creative_tab_1); this.setScale(0.5F); } @Override public boolean hitEntity(ItemStack stack, EntityLivingBase hitEntity, EntityLivingBase attackingEntity) { hitEntity.addPotionEffect(new PotionEffect(Potion.getPotionById(2), 100, 10)); return true; } @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { //Actions.summonLightningAtPosition(worldIn, playerIn.get, 5); return super.onItemRightClick(worldIn, playerIn, handIn); } } If you could help that would be greatly appreciated.

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.