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

ChampionAsh5357

Members
  • Posts

    1217
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by ChampionAsh5357

  1. 2 hours ago, DietmarKracht said:

    I don't think so, cuz i would need to modify vanilla entities for that.

    Well yeah. Ticking is handled internally by the entities that's called from some function. The method was added by forge so the entity can be updated to not tick hence it can't do anything. So, yes, the method I provided should work as intended.

  2. 1 hour ago, BudRunBun said:

    I don't know if it's possible to draw a quarter of a sphere via json models. I think you can only make a model out of cuboids.

    Forge has custom model loader support through jsons. For example, there is a model loader for .obj models that takes in the location of the obj model and its material. The omnibus PR has more information on this.

     

    As for the actual code, you shouldn't have any reason to refer to RenderSystem at all in a TER. The batch rendering system used by #renderModel should be perfectly capable of handling the shading and culling of your model.

  3. 31 minutes ago, L0raxeo said:

    Sorry I do not understand by what you mean when you say "Block#use". I googled it to no avail. Could you elaborate? Thanks for helping :)

    Use your source to look within the AbstractBlock class for a method named 'use'. If you using the mcp mapping set over mojmaps, then that would be 'onBlockActivated' instead.

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

  5. 31 minutes ago, Luis_ST said:

    But how do I put the bigger features? because my created feature is actually only a small part of what I want to generate.

    So what do you want to generate? You seem to either be combining multiple features into one feature based on what I'm seeing.

    34 minutes ago, Luis_ST said:

    and if so, how do I create these randomly because the structures are fixed, village houses, igloos, etc. ?

    Structures are perfectly capable of being randomized using pools. Currently out of what I've seen though, you don't really have any dynamic data.

  6. So to address the points:

    1. This is your block, do not use an event. You can just check if the player is sneaking within Block#use.

    2. Use the capability on the tile entity or pass in the inventory itself to the server container.

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

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

  9. The process requires a bit more work then. All worldgen stuff is handled through jsons now. You could probably find how they need to be formatted on the mc wiki. So, just format them according to that. You can also look at slicedlime's vanilla world gen extraction for examples. As for getting it in the overworld. You need to do a few things. Existing dimensions use entries hardcoded to be in code instead of through json making them inaccessible from pure json. To get around this, you have to supply a dummy entry and handle it that way.  So, register the biome using any forge registry process and supply some dummy biome to the instance. It will be replaced by the json when the server is loaded. Finally, you will need to call BiomeManager#addAdditionalOverworldBiomes within the synchronous work queue of FMLCommonSetupEvent. This adds your biome to the overworld biomes. Note, that this takes a registry key which can be gotten using RegistryKey#get and supplying Registry#BIOME_REGISTRY as the first parameter and the resource location of your biome as the second.

     

    In summary:

    1. Create biome json.

    2. Registry dummy biome to forge registry.

    3. Add biome to overworld biomes within common setup.

     

    Any other information can be derived from the primer.

    • Like 1
  10. Forge migrated to a different set of field/method/param mappings as of the latest RB of the mdk. As such, you can use either the forge-bot on the Forge Discord or Linkie to translate the old mappings (also known as MCP) to the new ones (Mojang). You can also change your mapping set back to MCP, but just be warned that they will not be available for 1.17.

  11. 2 hours ago, Yurim64 said:

    For the Attributes, i can't use the EntityAttributeCreationEvent because i only for LivingEntity, and my TestVehicleEntity is not a subclass of LivingEntity.

    Apologies, for some reason I remembered your class extending AnimalEntity.

     

    I'll address the issues now:

    1. The RenderingRegistry should be called in FMLClientSetupEvent. It is running on the client only after all since the dedicated server has no concept of rendering.

    2. At some point, you might want to look into lambdas. (not an issue, just me being picky)

    3. TestVehicle#getAddEntityPacket should return NetworkHooks#getEntitySpawningPacket. (this is most likely the root of your cause since vanilla entities have their ids hardcoded in the packet check so your entity gets spawned only on the server)

  12. 2 hours ago, Yurim64 said:

    How can i add attributes to my entity?

    You still didn't provide a debug.log, but since you don't know how to add attributes, I'm going to assume you didn't. Create an event handler on the mod bus for EntityAttributeCreationEvent. Pass in your entity type and the associated attribute map. You can look at GlobalEntityTypeAttributes for an example on how to create the attribute map. Most likely you'll chain off of some existing entity.

  13. The error is probably your entity doesn't have any attributes. But you need to provide the full debug.log if we're going to diagnose an issue as there is no error context.

     

    Other questions/issues:

    1 hour ago, Yurim64 said:

    @Override

    Why are you overriding methods you're not using or calling?

    1 hour ago, Yurim64 said:

    ForgeRegistries.ENTITIES.register(AmbulanceType.getType());

    This makes no sense. What is getType? You have the mod event bus within the constructor, pass that around.

    1 hour ago, Yurim64 said:

    matrix.pushPose();

    This and the pop does nothing. You're not doing any logic that requires these.

    1 hour ago, Yurim64 said:

    Minecraft.getInstance().getEntityRenderDispatcher().register(AmbulanceType.getType(), new AmbulanceRenderer<>(Minecraft.getInstance().getEntityRenderDispatcher()));

    This is not how you should attach a renderer, use RenderingRegistry#registerEntityRenderer or something similar.

    1 hour ago, Yurim64 said:

    ResourceLocation resourceLocation = new ResourceLocation(AmbulanceMod.MODID, "model/ambulance");

    Make this constant, don't keep reconstructing the object.

     

  14. Then if you don't expect any animation, you can just use the model loader system. Supply it in some location and create a json model with the loader forge:obj, then you would specify the model location and material. You can look at the omnibus for an example. Next, you'll want to go into the ModelRegistryEvent and call ModelLoader#addSpecialModel. You can then just render the baked model at a specific location similar to how BlockModelRenderer or ItemRenderer does it, adjust it for places such as needing a double for the location or just use the MatrixStack to offset the value.

     

    If you want animation, then you are using the wrong export type. You'll probably need to make the model loader for that on your own.

×
×
  • Create New...

Important Information

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