Jump to content

LegendaryVortex

Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

LegendaryVortex's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. i underlined the text thats not working
  2. 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
  3. 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
  4. 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
  5. can you tell me the parameters required in total please
  6. 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
  7. 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); } }
  8. i set up everything except idk how to give the player a effect
  9. excuse me on item right click how do i give a entity a potion effect
  10. just wondering is there anything else wrong
  11. ok thx im so sorry im kinda new
  12. if you have a better idea of what i can replace context with please tell me
  13. but i need to use the context variable as itemusecontext
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.