Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How do I make an entity for 1.16?


Recommended Posts

If you have a tutorial you can give me, I'd appreciate it. I've been searching for 3 hours and I can't find one. All I have is a Blockbench 3d model, a texture, and some snippets of Zombie code in a .json file. I don't know how to connect the two together, or what Java Classes I would need to make.

Link to post
Share on other sites

Show us what you currently have along with what type of entity you would like it to be.

Based on your current description, I will assume it's some hostile mob which requires the following parts:

1. Something that extends MonsterEntity

2. An EntityType to register the factory to create your MonsterEntity

3. Entity Attributes which can be registered via EntityAttributeCreationEvent

4. Entity Spawn Placement which can be registered using EntitySpawnPlacementRegistry#register in the synchronous work queue of the FMLCommonSetupEvent

5. An Entity Model which probably extends SegmentedModel most likely

6. An Entity Texture that maps to the model

7. An Entity Renderer that probably extends MobRenderer that is registered via RenderingRegistry#registerEntityRenderingHandler in the FMLClientSetupEvent

8. Adding Entity Spawns which can be done via BiomeLoadingEvent to existing biomes or via json in your own biomes.

Link to post
Share on other sites
24 minutes ago, ChampionAsh5357 said:

Show us what you currently have along with what type of entity you would like it to be.

Based on your current description, I will assume it's some hostile mob which requires the following parts:

1. Something that extends MonsterEntity

2. An EntityType to register the factory to create your MonsterEntity

3. Entity Attributes which can be registered via EntityAttributeCreationEvent

4. Entity Spawn Placement which can be registered using EntitySpawnPlacementRegistry#register in the synchronous work queue of the FMLCommonSetupEvent

5. An Entity Model which probably extends SegmentedModel most likely

6. An Entity Texture that maps to the model

7. An Entity Renderer that probably extends MobRenderer that is registered via RenderingRegistry#registerEntityRenderingHandler in the FMLClientSetupEvent

8. Adding Entity Spawns which can be done via BiomeLoadingEvent to existing biomes or via json in your own biomes.

The mob I want to create, known as "Bloodghast" (unrelated to a Nether Ghast), is a Vampire Spirit, or in other words, undead. (Burns in daylight, etc) It is hostile to the player, hovers above ground but doesn't actually fly like a Ghast or a Phantom. I would also like it to be able to pass through walls 1 block thick if possible and track players through those walls, but that might be a topic for another thread.

Here is what I have so far:

image.thumb.png.8e771168486b0b85f1192e9b7618c07a.png

image.thumb.png.5f44fa691fb0f6002b08d8ccb4d38b8e.png

image.thumb.png.6efd270b08276a61c79e11a9d9e20aff.png

image.thumb.png.a4f0a980b699486a6406c6da082b6467.png

image.thumb.png.d50dc91033293c833769741f7010f652.png

I included the Blockbench texture and model here to prove that, A: I have both (.png and .java), and B: So you can have an idea what I'm going for. The Bloodghast should be around player's height. In fact, it should be very similar to a Blaze, minus the fireballs and flying part. Any and all help is appreciated.

Link to post
Share on other sites
2 hours ago, Skullblade said:

Uhh, I could still use help.

I will respond when I have time or when I'm looking through these.

 

Also, based on the formatting thing, I guess you're a bedrock addon maker? The json you have provided means absolutely nothing currently as there is nothing to handle that. You need to translate this into java.

Link to post
Share on other sites
42 minutes ago, ChampionAsh5357 said:

I will respond when I have time or when I'm looking through these.

 

Also, based on the formatting thing, I guess you're a bedrock addon maker? The json you have provided means absolutely nothing currently as there is nothing to handle that. You need to translate this into java.

I'm coding for Java edition.

Link to post
Share on other sites
2 minutes ago, ChampionAsh5357 said:

Then why did you make your entity as a bedrock behavior pack? Behavior packs do not existing in the Java edition currently.

I'm new to modding, okay? There's no tutorials online that I can find, so I'm guessing here.

Link to post
Share on other sites
2 minutes ago, Skullblade said:

I'm new to modding, okay? There's no tutorials online that I can find, so I'm guessing here.

You can be new to modding sure, and I'm not putting you down for guessing incorrectly. However, it does say that on every tutorial I just googled for creating custom entity add-ons that the feature is exclusive to Bedrock.

 

So once again, you will need to translate your json to Java within the entity itself. You can use the other entity classes as references on where certain snippets should go.

Link to post
Share on other sites
1 hour ago, ChampionAsh5357 said:

You can be new to modding sure, and I'm not putting you down for guessing incorrectly. However, it does say that on every tutorial I just googled for creating custom entity add-ons that the feature is exclusive to Bedrock.

 

So once again, you will need to translate your json to Java within the entity itself. You can use the other entity classes as references on where certain snippets should go.

That sounds like replacing an old vanilla entity with a new one. I want to make a brand new one, but I don't know how to do that. Could you direct me to a tutorial or something?

Link to post
Share on other sites
8 minutes ago, Skullblade said:

That sounds like replacing an old vanilla entity with a new one. I want to make a brand new one, but I don't know how to do that. Could you direct me to a tutorial or something?

You're not? There are NO deserializers for behavior packs for entities in Java edition. You need to create the entity data within the class directly. The json file from just a glance looks completely translatable into the format that Java edition uses (which means in code since entities, I repeat, are NOT data driven).

And probably not. Entity tutorials for 1.16 are not really existent as it requires learning in more detail about pathfinding and the new brain system. This is not to mention logic is usually unique to the user.

Link to post
Share on other sites
37 minutes ago, ChampionAsh5357 said:

You're not? There are NO deserializers for behavior packs for entities in Java edition. You need to create the entity data within the class directly. The json file from just a glance looks completely translatable into the format that Java edition uses (which means in code since entities, I repeat, are NOT data driven).

And probably not. Entity tutorials for 1.16 are not really existent as it requires learning in more detail about pathfinding and the new brain system. This is not to mention logic is usually unique to the user.

So I can copy and paste the Zombie code into my class, or do I have to translate it? If so... well, I don't know how to do something like that.

Link to post
Share on other sites
29 minutes ago, Skullblade said:

So I can copy and paste the Zombie code into my class, or do I have to translate it? If so... well, I don't know how to do something like that.

You need to translate that. And I was suggesting using already existing classes like CreeperEntity, ZombieEntity, and so forth for a base on how the translation might occur.

Link to post
Share on other sites
7 minutes ago, ChampionAsh5357 said:

You need to translate that. And I was suggesting using already existing classes like CreeperEntity, ZombieEntity, and so forth for a base on how the translation might occur.

Would these classes be found somewhere in the .minecraft folder?

Link to post
Share on other sites
21 minutes ago, ChampionAsh5357 said:

No, they would be found in your IDE within the dependencies of your project explorer. I think IntelliJ calls them referenced libraries or something similar.

I think I found the dependencies, known as "External Libraries." There's a ton of folders though, and I don't know where to look. I can find block and item data just fine, but the entity data seems separate.

Link to post
Share on other sites
On 5/16/2021 at 5:49 PM, ChampionAsh5357 said:

Should be able to search for class names or find a type hierarchy for MonsterEntity. I don't use IntelliJ so I'm not familiar with the keybinds.

I found it in "Gradle: net.minecraftforge:forge1.16.5-36.1.0_mapped_official_1.16.5/forge-1.16.5_36.1.0_mapped_official_1.16.5-recomp.jar/net/minecraft/entity/monster"

Thank you.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I'm currently trying to make a new cauldron-type block, and I'm having difficulty implementing blockstates. Here's the relevant part of the alchemical cauldron's code:   public class AlchemicalCauldronBlock extends Block { public static final IntegerProperty LEVEL = IntegerProperty.create("level", 1, 3); private static final VoxelShape INSIDE = box(2.0D, 4.0D, 2.0D, 14.0D, 16.0D, 14.0D); protected static final VoxelShape SHAPE = VoxelShapes.join(VoxelShapes.block(), VoxelShapes.or(box(0.0D, 0.0D, 4.0D, 16.0D, 3.0D, 12.0D), box(4.0D, 0.0D, 0.0D, 12.0D, 3.0D, 16.0D), box(2.0D, 0.0D, 2.0D, 14.0D, 3.0D, 14.0D), INSIDE), IBooleanFunction.ONLY_FIRST); public AlchemicalCauldronBlock() { super(Properties.of(Material.METAL).sound(SoundType.METAL).harvestLevel(3).strength(2F,2F)); // this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, 0)); // this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(0))); } ... When I try to run this with either of the two attempts at registerDefaultState uncommented, I get this error: https://pastebin.com/vPf3UryC. For convenience, I believe this part is most relevant: How can I avoid this? My registry classes look like this, if it helps: public class registry { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, AlchemyPlus.MODID); public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, AlchemyPlus.MODID); public static void register() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); BLOCKS.register(modEventBus); ITEMS.register(modEventBus); registerItems.register(); registerBlocks.register(); } } public class registerBlocks { public static final RegistryObject<Block> ALCHEMICAL_CAULDRON = register("alchemical_cauldron", AlchemicalCauldronBlock::new); static void register() {} private static <T extends Block> RegistryObject<T> registerNoItem(String name, Supplier<T> block) { return registry.BLOCKS.register(name, block); } private static <T extends Block> RegistryObject<T> register(String name, Supplier<T> block) { RegistryObject<T> ret = registerNoItem(name, block); registry.ITEMS.register(name, () -> new BlockItem(ret.get(), new Item.Properties().tab(ItemGroup.TAB_BREWING))); return ret; } } Full GitHub repository available here.   (Other minor problem(?):  I copied the methods getShape and getInteractionShape from net.minecraft.block.CauldronBlock and I'm getting these weird warnings. What's up with that? Do I need to worry about it?)  
    • Personally I use IForgeRegistryEntry#getRegistryName and then ResourceLocation#getNameSpace to get the id of the object.
    • you can get a block form a ResourceLocation, take a look at NBTUtil#readBlockState, do somthing like that
    • I am running forge version 1.16.5 36.1.31 on a server with a lot of mods and when a player refreshes the server list, it sends a long error in the server console. Additionally, the server list displays "Can't connect to server", despite refreshing and actually being able to connect to the server. here's the links to the logs: https://gist.github.com/WaffleTraits/83885b1539d5711fabff73a91924e665 https://gist.github.com/WaffleTraits/5ae78e6eaa330422bbc9f7226faf60ce Here's what's displayed in console when a player refreshes server listing: https://hastebin.com/ativexeyoy.properties server is running on ubuntu 20.04 and is using java 8 for this forge instance.
    • I kept getting this error whenever I tried joining my modded server I want to find a solution to this I checked every mod and it all matched Client : https://mclo.gs/Q39SSu5 server : https://mclo.gs/UO2kbDz
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.