Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by kiou.23

  1. 48 minutes ago, eggpasta said:

    BananaSquares/ForgeMod (github.com) I uploaded the src folder

    It's the file in the Main package called brewrecipe

    the forge mdk already provides a .gitignore that's on the root were you should create yout git repo

    also, delete the exampleMod package if you're not using it

    also, please use any for mof proper file structure on your mod files, why the heck are your RegistryObjects under ModEventSubscribers??? that class has literally 0 event  subscribers

    also, don't create an ItemBase, that's an antipattern and is explained why it's bad code practice in the pinned thread on this subforum

    also, please use proper casing, why do you have a class that's all uppercase and another that's all lowercase?? classes should be PascalCased

    also, again, there's no need to extend IBrewingRecipe

    also, you should be using the proper RegistryEvent to register your brewing recipes, not through deferred work in the setup

  2. 50 minutes ago, Alpha0 said:

    I've been trying to make a block loot table that when broken with silk touch has a 1/3 chance to drop an item. I've looked for documentation on this but haven't had any luck.

    if I'm not mistaken: you just add two conditions in the json array for conditions, one to check for the tool enchantment, and one to check for a random rol. you can look at the glass loot table to see how to check for the enchantment, and at the grass loot table to see how to drop on a random chance with a given probability

  3. 8 minutes ago, djofox said:

    Yes! thank you, it works great now. One more thing though, I followed default minecraft code for the armor, but even though I have all my layers in assets/gemstones/textures/models/armor it still shows up on my character as the 'no-texture' texture.

    now I don't know how to help you
    you may want to create a new topic asking for help with that


    the only thing that comes to mind isthat if you're on intelliJ, check if those are actaully subdirectories and not a single directory with dots in the name (as that is a very common problem that happens when people are modding with intelliJ)

  4. 4 hours ago, djofox said:

    So I already created an Armor class and Item Tier class for my new set of Mod tools and armor, but I can't figure out how to set the repair material as my Mod Item. The Item I would like to use is declared as a Registry Object because that's the new way forge does it, however "fromItems" takes IItemProvider and I'm not sure how to properly declare that, also I found another 'fix' that said use "get" but that doesnt work either


    Can someone help me figure this out please? 


    My repair

    	   	   BERYLC("berylc", 40, new int[]{1, 2, 3, 1}, 1, SoundEvents.EXPERIENCE_ORB_PICKUP, 1.0F, 0.0F, () -> {
    		      return Ingredient.get(ItemInit.beryl); //This line gets the error

    My Item

    	public static final RegistryObject<Item> beryl = ITEMS.register("beryl",
    			() -> new Item(new Item.Properties().tab(Main.GEMSTONES_GROUP)));


    Thanks in advance!

    your "beryl" Item is not an Item, it's a RegistryObject of an Item, think of it like a box which at the starts is empty, and that after registration your item gets put inside of it.
    you're passing a RegistryObject to the Ingredient, while it expects an IItemProvider
    you can call RegistryObject#get to get the item that's inside it
    but note that if you call it before registration happens, the box is going to be empty and there won't be an item yet

  5. 9 minutes ago, diesieben07 said:

    You don't need a custom baked model for this. Look at the composter model for an example.

    hm... when I had a similar issue the discord pointed me towards using baked models. but multiparts does seem way simpler, and with datagen I could even do it proceduraly

  6. whenever you find a solution by yourself, you can leave the original question, but add a comment mentioning that you fixed it, and how. so that if anyone comes accross the same problem, they can find your solution and try it without needing to make a new topic.

    also, I don't see how intellij syncing with github has anything to do with forge

  7. you need to create a new class which implements IBakedModel, overwrite getQuads (the one which takes an IModelData) an make it return the quads for your model, the IModelData shouls contain the info on the list

    and you set the info on the IModelData by overwriting getModelData in your tile entity. you need to sync the data from, the Server tile entity, to the client, which you can do by overwriting getUpdatePacket (Server sends updated data to the client), and onDataPacket  (Client handles an update packet received).

    then, whenever that data changes you can call World#notifyUpdate, and whenever the client receives an update (so in the end of onDataPacket) you call requestModelUpdate().


    for the BakedModel, what I do is:

    I pass in an existing IBakedModel (that works as a base that I can add quads to) to the constructor, and store it in a field. then I can call IBakedModel#getQuads on the base model, which gives a list of BakedQuads, and add any new quads to it. and you can create your quads by using FaceBakey#bakeQuad, it takes the start and end positions of the quad (in block space, so 0 -> 16), an instance of a BlockPartFace, the sprite you want to use, which you can get from an AtlasTexture, the Direction of that quad, a transform (I just use SimpleModelTransform.IDENTITY), a rotation, which you can just pass null, a boolean that tells wether that face should be shaded or not, and then a throwaway ResourceLocation.

    and you can decide on all those properties, and on what faces to add, given the IModelData


    EDIT: oh, and to register it you can do so through the modelRegistry in the ModelBakeEvent (this event is client-side only (I think))

    if you need some examples, I used this repo to learn how to use BakedModels: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe04_block_dynamic_block_models

  8. 15 minutes ago, rafferty.smith@hotmail.com said:

    It is a tile entity block, the list will max out at 9 slots, so there will be 9 block models (a bit like a composter)

    Blockstates is far from what you want, what you need to do is an IBakedModel

  9. 57 minutes ago, ianm1647 said:

    and I have no idea why there is an error.

    It'd be useful if  you could've told the error

    public static final ConfiguredFeature <?,?> KUNZITE_FEATURE = new ConfiguredFeature<?, ?>((KUNZITE_ORE).withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, BlockInit.KUNZITE_ORE.get().defaultBlockState(), 6)).range(20).square().func_242731_b(20));

    this should throw an error as you call RegistryObject#get before the objects have been registered (i.e.: in static initialization). I'd instantiate the ore features in the common setup event

  10. I have a block, with a tile entity, the block uses of a BakedModel to render based on some data from the tile entity. I've made a custom BlockItem which gets dropped with the tile data serialized to a nbt tag, and that when placed, deserializes the nbt for the tile entity.

    The baked model is simple. I have a base model defined in json, and the getQuads simply adds a new cuboid shape inside the base model, representing how much the block is filled (The block is a jar)

    but the Item renders just the base model (as would be expected). How could I make it render the model from the BakedModel? I've looked into ISTERs, but it doesn't seem that I can get the BakedModel quads from there

  11. hm, I'm thinking you could use of a shader, there may be a simpler way which I'm not aware of;

    Silhouete and outline are different things, to shade for a silhoute you could render any non-tranparent pixel of the item texture as black (or whatever color you'd want for the silhoute. actually, if you grayscaled the item texture you could tint it to whatever monochrome color you'd want). shaders for outline are a little more complicated, but not much, you can find info on such shaders online

    again, there maybe be an easier way to do it, but I'm not sure

  • Create New...

Important Information

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