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.

LegendaryVortex

Members
  • Joined

  • Last visited

  1. package net.legendaryvortex.tutorialmod.Block; import net.legendaryvortex.tutorialmod.TutorialMod; import net.legendaryvortex.tutorialmod.item.ModItems; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockBehaviour.Properties; import net.minecraft.world.level.material.Material; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public class ModBlocks { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS , TutorialMod.MOD_ID); public static final RegistryObject<Block> CITRINE_BLOCK = registerBlock("citrine_block", CreativeModeTab.TAB_BREWING,() -> new Block(BlockBehaviour.Properties.of(Material.METAL).strength(9f).requiresCorrectToolForDrops())); private static <T extends Block>RegistryObject<T> registerBlock(String name, RegistryObject<T> block, CreativeModeTab tab){ RegistryObject<T> toReturn = BLOCKS.register(name, block); registerBlockItem(name,toReturn,tab); return toReturn; } private static <T extends Block>RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block, CreativeModeTab tab){ return ModItems.Items.register(name, ()-> new BlockItem(block.get(), new Item.Properties().tab(tab))); } public static void register(IEventBus eventBus) { BLOCKS.register(eventBus); } } the underlined text doesnt work
  2. THX it works and i have but minecraft modding and java i think are are a bit different because it doesnt teach you about minecraft just java
  3. plz i just need a answer like you just need to put this in and it will work i am tying to spawn lightning on the player
  4. can you tell me the parameters required in total please
  5. sorry i cant quite fuiger it out because the constructor has this in the parenthesis p_i231491_1_, World world so can you help me a bit
  6. what do i put in line that i underlined and that is red public class Speed_Artifact extends Item { public Speed_Artifact(Properties properties) { super(properties); } public ActionResultType onItemUse(ItemUseContext context) { World world = context.getWorld(); if (!world.isRemote) { ItemStack stack = context.getItem(); PlayerEntity playerEntity = context.getPlayer(); playerEntity.addPotionEffect(new EffectInstance(Effects.SPEED,600)); playerEntity.addPotionEffect(new EffectInstance(Effects.JUMP_BOOST,600)); stack.damageItem(1, playerEntity, player -> player.sendBreakAnimation(Hand.MAIN_HAND)); Double x = playerEntity.getPosX(); Double y = playerEntity.getPosY(); Double z = playerEntity.getPosZ(); LightningBoltEntity entitybolt = new LightningBoltEntity(world); entitybolt.setPosition(playerEntity.getPosX(),playerEntity.getPosY(),playerEntity.getPosZ()); world.addEntity(entitybolt); return super.onItemUse(context); } return super.onItemUse(context); } }
  7. i set up everything except idk how to give the player a effect
  8. excuse me on item right click how do i give a entity a potion effect
  9. just wondering is there anything else wrong
  10. ok thx im so sorry im kinda new
  11. if you have a better idea of what i can replace context with please tell me
  12. but i need to use the context variable as itemusecontext

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.