-
i am following a tutorial but something is not working
i underlined the text thats not working
-
i am following a tutorial but something is not working
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
-
i dont know what to put here i am following a tutorial but its not working
ik
-
i dont know what to put here i am following a tutorial but its not working
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
-
i dont know what to put here i am following a tutorial but its not working
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
-
i dont know what to put here i am following a tutorial but its not working
can you tell me the parameters required in total please
-
i dont know what to put here i am following a tutorial but its not working
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
-
i dont know what to put here i am following a tutorial but its not working
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); } }
-
how do i give the player and affect after right click
also how do i damage an item
-
how do i give the player and affect after right click
i set up everything except idk how to give the player a effect
-
My modded item crashes on right click
excuse me on item right click how do i give a entity a potion effect
-
My modded item crashes on right click
just wondering is there anything else wrong
-
My modded item crashes on right click
ok thx im so sorry im kinda new
-
My modded item crashes on right click
if you have a better idea of what i can replace context with please tell me
-
My modded item crashes on right click
but i need to use the context variable as itemusecontext
IPS spam blocked by CleanTalk.