Jump to content

Kangalia

Members
  • Posts

    10
  • Joined

  • Last visited

  • Days Won

    1

Kangalia last won the day on March 8 2023

Kangalia had the most liked content!

Kangalia's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Hi there, I'm trying to create a custom seasons system for my mod, where a certain amount of ingame days/ticks/unknown timeframe equates to a 'season' and whenever it rolls over this time, the season changes. However, I have no idea where to start in trying to implement this. After watching this tutorial (https://www.youtube.com/watch?v=My70x9LzeUM) I had a thought; could I just attach a capability like this to the Server/Client and use a TickEvent to do the seasonal control? It's the only way so far I've found to even try and go about implementing this, but as I have miminal experience with dimensions/terrain generation/changing anything about the world itself other than entities and blocks, I'm at a loss on what to do. Please let me know if I'm on the right track and if not, please point me in the right direction. Thanks!
  2. Hi there, I'm having a problem with GUIs. I have an item that when right clicking my entities, should open a GUI. Both my entities inherit from the same base class that the item uses for 'instanceof' checks and their code is incredibly similar. However, when right clicking one entity with the item, the GUI opens fine. The other though, it doesn't open at all, there's no errors in the logs, literally nothing. I have another item that does virtually the same thing, just with a different GUI and displayed information (and almost the same code) and that works fine for both entities. I've managed to track the code and it gets to the point where the NetworkHooks.openGUI runs, the container is created, and then it stops before the screen is created. However, there's no errors to explain what's going on. At this point I'm at a complete loss as to what's happening. Any ideas? I'm using forge 1.19.2 43.2.3. Item Class: https://paste.ofcode.org/5aXnqzvB3hQr8MvyDmqeYV Item Container Class: https://paste.ofcode.org/cyWfvHJFQfEMYEQWrjq4m3 Item Screen Class: https://paste.ofcode.org/cekhBvdXJfRpUxUKYsC6Ex ClientSetup Class (Where I register all my screens): https://paste.ofcode.org/NkVGM75Cqi4sSYM7CgRBAF Let me know if you need to see anything else. Thanks!
  3. I've created a custom item whereupon right clicking one of my custom mobs, it displays some data from it, including the name, age, sex, health, etc. in a custom gui. I've managed to get the display name working by creating a custom menu provider and overriding the getDisplayName method to return my own translation component. However, I have no idea how to do the same for the rest of my data. I've tried diving into the code to find where on earth getDisplayName is actually called, but so far have had no luck. I've saved the nbt data in the itemstack, hoping to read it that way in the screen, but so far the itemstack I get in the screen (using a custom getter method from the item container) always has no nbt tag, even if through debugging I know it does have one when the nbt is saved. I'm completely lost on what is going on at this point, or even if I'm going about this the right way or not. If I could get some pointers as to where I'm going wrong, that would be great. Here's my code (item, container, and screen): https://paste.ofcode.org/34dHY86AchbydMMnCnFtkv4
  4. Thank you very much, it's working like a charm now!
  5. My entity renderer class: https://paste.ofcode.org/g2U4evwc6Lh2ZAGDzsTyGw My shared entity class: https://paste.ofcode.org/CBun4FdaSZHuYJvPLxapjP My specific entity class: https://paste.ofcode.org/EDt6dhxz4ZC2qCfNRDnK5f My entity model code: https://paste.ofcode.org/BdRAhZNFEc76ixgM2sYbYk
  6. Thank you for the quick reply! I've moved the growth code into the tick method and made that update a field I've saved with EntityDataAccessors. However, if I try and update the size in the render method using this, the entire model rendering breaks. The entity has no hitbox, cannot be pushed, and when it's killed, it remains in the world. Am I missing something?
  7. Hello. I've made a custom mob with Geckolib, which works fine. However, I want this mob to grow dynamically as it ages, rather than just popping into its adult appearance like vanilla mobs. I've managed to get this working somewhat, but there are a few problems: The mob still grows when the singleplayer client is paused. The mob only grows if it's on screen; if it's, say, behind the player, then it will never grow. Now I know these issues are caused by putting the growth code in the render method in my mob's renderer, but I have no idea where else I should put it. After doing some research, I found I should be using the scale method, but as I'm using a GeckoLib renderer (GeoEntityRenderer<>), this method does not exist for me. If anyone has any ideas in how I could either work around this issue, or some other way of solving this, that would be great. Cheers!
  8. Thank you! I managed to get this working finally after puzzling through it, and your answer gave me a good place to start. I ended up using a combination of several for loops and an int array which was filled with the values of my "weight" json attribute for each recipe. Iterating through each recipe in my main list, I could add to a new array several repeats of the same number for the weight, and this number would correlate to a specific recipe in the main list. E.g. if the weight for the recipe in index 0 was 5, then 0 would be added to the array 5 times. My random number would then be chosen from this new array, and the recipe fetched from the main list using it. This works like an absolute charm. Hope this helps anyone else that might stumble on this thread!
  9. Update to this. I've managed to get the machine to produce an output depending on a randomly generated number using the Random and SecureRandom java classes. However, I still can't figure out how to do the weighting.
  10. Hi there. I'm trying to make one of my custom machines to choose a specific custom recipe depending on a percentage chance assigned to each recipe. This percentage chance will be based on one of the ingredients. For example, ingredient 1 + ingredient 2 has a 30% to produce output 1, 20% for output 2, and 50% for output 3. However, if you do ingredient 1 + ingredient 3, they'd have a 15% chance for output 1, 10% for output 2, and 75% for output 3. I have no idea how to go about this. Cureently I have implemented the machine (including tile entity, screen, container, etc.) as as well as the RecipeType and Serialiser. My machine currently works to produce one output 100% of the time. It would be hugely appreciated if I could get, if not a solution, then maybe some ideas for implementing this, as I've been working on this for several days now and have completely run dry on ideas. Thanks!
×
×
  • Create New...

Important Information

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