Jump to content

Johnnycakes

Members
  • Posts

    2
  • Joined

  • Last visited

Johnnycakes's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Okay so I fixed the constructor, but I only solved half of my problems. What is the proper way to register an entity if EntityType$Builder objects are not valid to supply? Because after reading the forge docs it seems like entities can only be created using their $Builder classes.
  2. Hello, I am unable to register a custom TNT block I made. I am getting two errors, one in the constructor in my Primed_Dynamite class. I am unsure of what type to cast, here is the code for it: public Primed_Dynamite(Level p_32079_, double p_32080_, double p_32081_, double p_32082_, @Nullable LivingEntity p_32083_) { //this(CustomEntityType.DYNAMITE, p_32079_); this((EntityType<Primed_Dynamite>)CustomEntityType.PRIMED_DYNAMITE, p_32079_); this.setPos(p_32080_, p_32081_, p_32082_); double d0 = p_32079_.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 = p_32080_; this.yo = p_32081_; this.zo = p_32082_; this.owner = p_32083_; } I am also clueless as to how to make a registryObject for the primed dynamite entity, with my current code I get the errors: "The method register(String, Supplier<? extends I>) in the type DeferredRegister<EntityType<?>> is not applicable for the arguments (String, () -> {})" and "The method build(null) is undefined for the type Block" public static final RegistryObject<EntityType<Primed_Dynamite>> PRIMED_DYNAMITE = ENTITY_TYPES.register("dynamite", () -> EntityType.Builder.of(Primed_Dynamite::new, ModBlocks.DYNAMITE.get().build(null))); Here is my github repositry and the specific files in question: https://github.com/John-Tsiglieris/Mod https://github.com/John-Tsiglieris/Mod/blob/main/src/main/java/block/custom/Dynamite.java https://github.com/John-Tsiglieris/Mod/blob/main/src/main/java/block/custom/Primed_Dynamite.java https://github.com/John-Tsiglieris/Mod/blob/main/src/main/java/entity/custom/CustomEntityType.java
×
×
  • Create New...

Important Information

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