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.

Nuclear_Shmatt

Members
  • Joined

  • Last visited

  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.

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.