Jump to content

Recommended Posts

Posted

Hey all!

 

This is my first post here so please bear with me as I may not initially post all of the needed information. I am trying to create a train. Built the model, have it in java code, and using the EntityMinecart class as an extension. Although when I right click (currently)my egg to spawn it, it does nothing.

 

Would any of you be willing to glance at my code and see what the problem could be?

 

If any more code is needed just let me know and I'll be happy to provide it.

 

I want to add that I'm no longer using MCreator. I started in there and then quickly learned of the limitations. I did take everything over to Eclipse and left the structure it came up with because I have a custom rail block that works correctly that I would like to not break. lol
 

This is my TrainEntity.java

package net.mcreator.diagonalrails.entity;

import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public class TrainEntity extends EntityMinecart {

    public TrainEntity(World world) {
        super(world);
    }

    @Override
    public EntityMinecart.Type getType() {
        // Customize your minecart type or use an existing one
        return EntityMinecart.Type.RIDEABLE;
    }

    // Custom methods and overrides for your entity behavior
}

 

This is my TrainModel.java
 

// Made with Blockbench 4.9.3
// Exported for Minecraft version 1.7 - 1.12
// Paste this class into your mod and generate all required imports

package net.mcreator.diagonalrails.Client.Model;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

import net.mcreator.diagonalrails.Client.Renderer.Entity.*;

public class TrainModel extends ModelBase {
 private final ModelRenderer train;
 private final ModelRenderer light2_r1;
 private final ModelRenderer firebox4_r1;

 public TrainModel() {
 textureWidth = 300;
 textureHeight = 300;

 train = new ModelRenderer(this);
 train.setRotationPoint(0.0F, 16.0F, 0.0F);
train.setTextureOffset(8, 135).addBox(-60, -50, -230, 120, 120, 240);
train.setTextureOffset(129, 54).addBox(-70, 60, 10, 140, 10, 130);
train.setTextureOffset(32, 123).addBox(60, -170, 10, 10, 230, 10);
train.setTextureOffset(35, 154).addBox(-70, -170, 10, 10, 230, 10);
train.setTextureOffset(0, 112).addBox(50, -40, 20, 20, 100, 120);
train.setTextureOffset(0, 112).addBox(-70, -40, 20, 20, 100, 120);
train.setTextureOffset(51, 147).addBox(-70, -170, 130, 10, 130, 10);
train.setTextureOffset(25, 130).addBox(60, -170, 130, 10, 130, 10);
train.setTextureOffset(8, 102).addBox(-70, -180, 10, 140, 10, 130);
train.setTextureOffset(0, 128).addBox(-14, -141, -190, 29, 85, 170);
train.setTextureOffset(0, 128).addBox(-42, -114, -190, 84, 29, 170);
train.setTextureOffset(18, 118).addBox(-14, -60, -190, 30, 10, 170);
train.setTextureOffset(131, 136).addBox(50, -60, -210, 10, 10, 220);
train.setTextureOffset(120, 115).addBox(-60, -60, -210, 10, 10, 220);
train.setTextureOffset(131, 36).addBox(70, 0, 50, 10, 80, 40);
train.setTextureOffset(139, 51).addBox(70, 20, 30, 10, 40, 80);
train.setTextureOffset(173, 48).addBox(70, 10, 40, 10, 60, 60);
train.setTextureOffset(248, 42).addBox(80, 10, 60, 10, 60, 20);
train.setTextureOffset(261, 39).addBox(80, 30, 40, 10, 20, 60);
train.setTextureOffset(136, 22).addBox(60, 0, -80, 10, 80, 40);
train.setTextureOffset(138, 35).addBox(60, 20, -100, 10, 40, 80);
train.setTextureOffset(128, 43).addBox(60, 10, -90, 10, 60, 60);
train.setTextureOffset(267, 38).addBox(70, 10, -70, 10, 60, 20);
train.setTextureOffset(243, 42).addBox(70, 30, -90, 10, 20, 60);
train.setTextureOffset(140, 29).addBox(-80, 0, 50, 10, 80, 40);
train.setTextureOffset(118, 39).addBox(-80, 20, 30, 10, 40, 80);
train.setTextureOffset(126, 38).addBox(-80, 10, 40, 10, 60, 60);
train.setTextureOffset(269, 47).addBox(-90, 10, 60, 10, 60, 20);
train.setTextureOffset(225, 49).addBox(-90, 30, 40, 10, 20, 60);
train.setTextureOffset(130, 22).addBox(-70, 0, -80, 10, 80, 40);
train.setTextureOffset(133, 32).addBox(-70, 20, -100, 10, 40, 80);
train.setTextureOffset(124, 29).addBox(-70, 10, -90, 10, 60, 60);
train.setTextureOffset(280, 59).addBox(-80, 10, -70, 10, 60, 20);
train.setTextureOffset(243, 40).addBox(-80, 30, -90, 10, 20, 60);
train.setTextureOffset(130, 146).addBox(-50, 20, -240, 100, 40, 10);
train.setTextureOffset(237, 30).addBox(-20, -200, -170, 40, 70, 50);
train.setTextureOffset(239, 21).addBox(-30, -210, -180, 60, 20, 70);
train.setTextureOffset(251, 25).addBox(-10, -180, -80, 20, 50, 20);
train.setTextureOffset(142, 36).addBox(60, 50, -200, 10, 30, 30);
train.setTextureOffset(234, 30).addBox(70, 60, -190, 10, 10, 10);
train.setTextureOffset(135, 32).addBox(-70, 50, -200, 10, 30, 30);
train.setTextureOffset(238, 33).addBox(-80, 60, -190, 10, 10, 10);

light2_r1 = new ModelRenderer(this);
light2_r1.setRotationPoint(0.0F, 0.0F, 0.0F);
train.addChild(light2_r1);
setRotationAngle(light2_r1, 0.0F, 0.0F, -0.7854F);

light2_r1.setTextureOffset(1, 14).addBox(60, -80, -210, 20, 20, 10);
light2_r1.setTextureOffset(241, 31).addBox(50, -90, -200, 40, 40, 10);
light2_r1.setTextureOffset(0, 128).addBox(30, -90, -190, 80, 40, 170);

firebox4_r1 = new ModelRenderer(this);
firebox4_r1.setRotationPoint(0.0F, 0.0F, 0.0F);
train.addChild(firebox4_r1);
setRotationAngle(firebox4_r1, 0.0F, 0.0F, 0.7854F);

firebox4_r1.setTextureOffset(0, 128).addBox(-110, -90, -190, 80, 40, 170);
 }

 @Override
 public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
 train.render(f5);
 }

 public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
 modelRenderer.rotateAngleX = x;
 modelRenderer.rotateAngleY = y;
 modelRenderer.rotateAngleZ = z;
 }
}


And I can add my entity registering code too or i can update my github with everything so yall could take a look

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • "I want to understand how complex mods with ASM transformation and coremods work, such as Xray or AntiXray. Why do they break when you simply rename packages? What features of their architecture make refactoring difficult? And what techniques are used to protect these mods? I am interested in technical aspects in order to better understand the bytecode and Forge loader system."
    • I can't figure out if you're looking for help trying to steal someone elses work, or cheat at the game....
    • Title: Why Is It So Hard to Rename and Restructure Mods Like Xray or AntiXray? 🤔 Post text: Hey everyone! I’ve been digging into Minecraft modding for a while and have one big question that I can’t figure out on my own. Maybe someone with more experience could help or give me some advice. Here’s the issue: When I take a “normal” Minecraft mod — for example, one that just adds some blocks or new items — I can easily change its structure, package names, or even rebrand it entirely. It’s straightforward. But as soon as I try this with cheat-type mods like XrayMod or AntiXray, everything falls apart. Even if I just rename the classes, refactor the packages, or hide its identity somehow, the mod either breaks or stops working properly. XrayMod in particular is proving to be a nightmare to modify without losing its core function. So my question is — why is this so much harder with cheat mods like Xray? Is there something fundamentally different about how they’re coded, loaded, or protected that prevents simple renaming or restructuring? And if so, how can I actually learn to understand someone else’s cheat mod enough to safely refactor it without breaking the core features? I’ve already been spending over two months trying to figure this out and haven’t gotten anywhere. It feels like there must be some trick or knowledge I’m missing. Would really appreciate any thoughts, tips, or references — maybe there are guides or techniques for understanding cheat-mod internals? Or if you’ve successfully “disguised” a cheat mod like Xray before, I’d love to hear how you did it. Thanks in advance for any help or discussion. ✌️
    • just started making cinamatic contect check it out on my channel or check out my facebook page    Humbug City Minecraft Youtube https://www.youtube.com/watch?v=v2N6OveKwno https://www.facebook.com/profile.php?id=61575866982337  
    • Where did you get the schematic? Source/Link? And do use an own modpack or a pre-configured from curseforge? If yes, which one On a later time, I can make some tests on my own - but I need the schematic and the modpack name
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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