Jump to content

Tadpoling

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Tadpoling

  1. Well I tried doing as you said, copying a Projectile From Minecraft I basically Copied the LamaSpit Class with some minor edits to make it work: The important Parts of the ProjectileCopy Class: As in the two constructors(There are no other constructors) https://imgur.com/a/uPbkOrz Registering the Projectile: https://imgur.com/a/qZestoE the error under the constructor says that "Cannot resolve constructor 'ProjectileCopy' " Which I know means it cant find the correct constructor, because it wants a constructor that Accepts the parameters (EntityType<Entity>, Level) But trying to make that constructor doesn't work, well rather calling to the father's constructor doesnt work because it requires a Class that inherits from Projectile, rather than Entity, which is what we gave it https://imgur.com/a/3EEpKDm Here's an example of what I did(Only to demonstrate the Issue, because keeping this constructor conflicts with the second constructor from above) Thank for you for your time!
  2. Hi! For the past few days I've tried looking for a good example or guide from which I could understand how to make a new Projectile, but it has largely been unsuccessful. I've searched Youtube for guides, the internet for examples, I tried looking up source code of some mods, but I still largely don't get what's required. So I'd greatly appreciate it if anyone could share some (simple) custom made projectile, and how they add it to the registry, or alternatively some guide that shows what's necessary so that I can base my own custom projectile off of. Thanks a lot
  3. Okay, yeah I got it to work, You were awesome thanks a bunch!
  4. Okay so let me start off by saying Your explanation was excellent! My only issue is that im on Version 1.18.2, and i double and triple checked that the Constructor for a Block Entity requires a BlockEntityType parameter. So I'm confused as to why it shouldn't be there? Because we need to call the constructor for the class we're inheriting from and all. And I have no idea if this is important but the guides are both on 1.18 or 1.18.2.
  5. Hi, Im trying to Create a simple block entity, following a guide, and for some reason there's an error registering it(with the deferred register) Here is my MobRepellentBlockEntity Class package com.Tadpolling.tutorialmod.block.entity; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; public class MobRepellentBlockEntity extends BlockEntity { public MobRepellentBlockEntity(BlockEntityType<?> pType, BlockPos pPos, BlockState pState) { super(pType, pPos, pState); } } Here is my ModBlockEntities Class where I have my deferred register package com.Tadpolling.tutorialmod.block.entity; import com.Tadpolling.tutorialmod.TutorialMod; import com.Tadpolling.tutorialmod.block.ModBlocks; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public class ModBlockEntities { public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITIES= DeferredRegister.create(ForgeRegistries.BLOCK_ENTITIES, TutorialMod.MOD_ID); public static final RegistryObject<BlockEntityType<MobRepellentBlockEntity>> MOB_REPPLLENT_BLOCK_ENTITY= BLOCK_ENTITIES.register("mob_repellent_block_entity",()-> BlockEntityType.Builder.of(MobRepellentBlockEntity::new, ModBlocks.MOB_REPELLENT_BLOCK.get()).build(null)); public static void register(IEventBus eventBus) { BLOCK_ENTITIES.register(eventBus); } } On the Line of the of the "BlockEntityType.Builder.of" function call, it gives me an error on the given parameters of the function 'of' and the error given is: "Cannot resolve method 'of(<method reference> , Block)' In case it's relevant the Mob Repellent Block does exist and works(I've tested it). I've looked at a few guides so far and they all do the same thing. Thank you for your time!
×
×
  • Create New...

Important Information

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