Jump to content

Nuclear_Shmatt

Members
  • Posts

    3
  • Joined

  • Last visited

Nuclear_Shmatt's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Well, I somehow fixed the issue by just removing the constructor and rewriting the same thing. I don't understand but I'm okay with this. public PrimedLumeniteTnt(EntityType<? extends PrimedLumeniteTnt> entityType, Level level) { super(entityType, level); } So, my issue is solved.
  2. Well, that has resolved that. Now a new problem has showed up: Overlayed on "(EntityType<? extends PrimedTnt> type)", it says "Unchecked cast: 'net.minecraft.world.entity.EntityType<net.minecraft.world.entity.Entity>' to 'net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.item.PrimedTnt>' " public PrimedLumeniteTnt(EntityType<Entity> type, Level level) { super((EntityType<? extends PrimedTnt>) type, level); }
  3. I've been trying to create custom TNT, and it keeps saying "Cannot resolve constructor" in the RegistryObject: The custom TNT class: package net.nuclear_shmatt.yournewmod.entity.item.custom; import net.minecraft.world.entity.*; import net.minecraft.world.entity.item.PrimedTnt; import net.minecraft.world.level.Level; import net.nuclear_shmatt.yournewmod.entity.ModEntityTypes; import javax.annotation.Nullable; public class PrimedLumeniteTnt extends PrimedTnt { @Nullable private LivingEntity owner; public PrimedLumeniteTnt(EntityType<? extends PrimedLumeniteTnt> type, Level level) { super(type, level); } public PrimedLumeniteTnt(Level level, double x, double y, double z, @Nullable LivingEntity igniter) { this(ModEntityTypes.LUMENITE_TNT.get(), level); this.setPos(x, y, z); double d0 = level.random.nextDouble() * (double)((float)Math.PI * 2F); this.setDeltaMovement(-Math.sin(d0) * 0.02D, (double)0.2F, -Math.cos(d0) * 0.02D); this.setFuse(80); this.xo = x; this.yo = y; this.zo = z; this.owner = igniter; } @Nullable public LivingEntity getOwner() { return this.owner; } @Override protected void explode() { float f = 4.0F; this.level.explode(this, this.getX(), this.getY(0.0625D), this.getZ(), f, Level.ExplosionInteraction.TNT); } } And this is the registry: package net.nuclear_shmatt.yournewmod.entity; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MobCategory; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import net.nuclear_shmatt.yournewmod.YourNewMod; import net.nuclear_shmatt.yournewmod.entity.item.custom.PrimedLumeniteTnt; public class ModEntityTypes { public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, YourNewMod.MODID); public static final RegistryObject<EntityType<? extends PrimedLumeniteTnt>> LUMENITE_TNT = ENTITY_TYPES.register("lumenite_tnt", () -> EntityType.Builder.of(PrimedLumeniteTnt::new, MobCategory.MISC) .fireImmune() .sized(0.98F, 0.98F) .build(new ResourceLocation(YourNewMod.MODID, "lumenite_tnt").toString())); public static void register(IEventBus eventBus) { ENTITY_TYPES.register(eventBus); } } "PrimedLumenite::new", new is underlined with red.
×
×
  • Create New...

Important Information

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