Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Slit_bodmod

Members
  • Joined

  • Last visited

Everything posted by Slit_bodmod

  1. Ah ok thankyou, that looks a lot simpler than capabilities.
  2. ok thankyou, is there documentation for world save data?
  3. Hi, probably a simple question but what is the best practice method for saving a large data structure that my mod will use to a world. Ideally in a way where it can be shared between dimensions however obviously not between different levels/saves?
  4. Ok yeah thankyou, was just checking to see if there was implementation for it as I didn't want to have to deal with the access transformers and stuff and thought there might be one, Thankyou very much though.
  5. Small question. Is there a function or anything in code where I can fill an IItemHandler (specifically an ItemStackHandler) using a loot table, Ideally just handed as a resource location. I've realised all of the vanilla code only applies to IInventory and seeing as the two aren't interchangable, I was wondering if there was a function somehow included as I imagine it's a pretty common requirement. Thankyou,
  6. Ok thankyou very much. This has been endlessly helpful, one last thing, do you know if there are any examples of this being used in vanilla/forge code (or an open source mod) that I could look too. If not, that's cool I meant more for reference cause I think i kinda get it now
  7. Oh, so i should probably create my CharacterData class as something that extends "Capability.IStorage<CharacterData>" and then use the write and read nbt methods to write and read the fields in that class onto said nbt tag. Using my own functions to turn the enums and classes that I want to implement into nbt data. Have a function that hooks onto the entity attachCapability event, and if it's a player or my npc mob, attach the data to the entity. Then, if I want to access that, I can call has capability to check an entity has it and get capability to access it and then read and write data into my capabilities methods and fields. Is that correct/ did i miss anything? also, my npc mob currently has an Inventory field, what class should it have instead as I can't find an ItemHandler class that I can instantiate.
  8. Ah, thank you. I'd heard of capabilities and read the docs page but couldn't quite understand what they were or were for. I got that they were some kind of interface for handling different features but wasn't quite sure how they were added to stuff as it were. Are they little packets of data that get attached to classes somehow or are they their own separate class that is simply used in tandem with separate ones. So for example in the context of this would I create a capability that I somehow attach to a player class or is there a player capability that I need to somehow add data too, or both? What is exposing a capability? Is this how you read data from it? As you can tell I'm a bit lost tbh, maybe it's just me but I feel like I don't quite understand. btw, I also saw in the docs that it put IItemHandler on a tile entity instead of minecraft's inventory class, should I do the same?
  9. I personally would juggle the code so that it takes in an entity type instead as I don't think it's possible to access the wither's registry object as it were (I could be wrong though). If you want to have other instances of a class take in a registry object, you could always use .get() when calling the constructor or even have an overloaded constructer that takes in a registry object and calls .get() on it.
  10. So I have a class called "CharecterData" that I want each player to essentially have an instance of as though it were a field in the player class. It will contain a series of fields including ints, bools as well as some custom enums and potentially instances of classes. I was wondering what the ideal method of implementing this would be. It should be unique for each player for each world, be created on world creation (or on servers when they first log in), will survive when players die, be saved when they log out and reopened when they log back in and reopened when they log back in. I am relatively new to forge (this is my first mod) and assume that this is a relatively common thing for mods to want to implement so if anyone can help that would be greatly appreciated. thankyou,
  11. Right, Update. After some tweaking the problem has gone away, I'm not sure if I managed to disable .DS_Store files as apparently my addon doesn't seem to show them. What's more likely though is I realised there was a capitalised file in the path of the mod. However seeing as presumably both of those things predate the client run malfunctioning, I wonder why it suddenly decided to start doing that.
  12. Right so I had a look and I can't seem to find a DS_store file in my mod and I have something on my mac that allows me to see hidden system files. Also my mod doesn't have a sounds.json
  13. Right yes I managed to remove them thank-you very much, I will see if that helps the client load
  14. Oh Thankyou, The name of my a couple files in the path have capital letters but that has never caused a problem before, I think this specific line is talking about the .DS_Store file which to my knowledge is a mac os system file so I don't have any control over. I think I am on the latest version of forge but if it's been updated fairly recently theres a good chance I'm wrong. It's bizarre though that it wasn't having trouble with resource loading before however it could be something to do with the specific model I added, my mod didn't have any armour textures before and I finally got round to adding them all. Thankyou very much
  15. Hi, I've been working on a mod for a short while now and have all of a sudden hit a major problem with trying to run my game in client mode. Essentially whenever I attempt to run the client it eventually starts going round in a circle of showing me the mojang asset loading screen (the one with the swipey red bar) and then a broken menu with the standard dirt background and buttons in the shape of the game pause/esc screen showing glitched unicode characters as shown below (sorry couldn't get a great photo as they changed quite violently). I have also included a copy of the log although as far as I could see the only errors are textures which I have not made for the mod yet so I expect to be missing ie: nothing out of the ordinary. If I remember correctly the only thing I added before this problem arose was a model for some armour however this has come to me before working on a previous mod (that for some reason I simply ignored last time). Any help would be greatly appreciated, thankyou. Also I added the latest.log because the debug.log came up with a warning that said "200-" and then upload failed, I assumed it might be a size thing but there was no indication. debug.log latest.log
  16. Thankyou, Firstly, yeah I thought that seemed like it would take a while but most approaches I've seen use this and I was too focused on trying to fix this. If you have any faster way of searching an area that big I would appreciate it greatly. Secondly that's what I thought but like I said this just happened to be the final iteration of a long series of attempts made to get this to work. Thirdly when I put a log statement in before the break, that fired and said the pos existed and the second log i put in (before return) said it did and then didn't. Seeing as this logged two things, what I assume happened is that the whole find cake function is called twice, once after the other, on two seperate areas, one with cake and one without, or something like that. Find cake is called once and only once by the goals shouldExcecute function (now I've said/written that outloud/in Helvetica I might inline it) and my tick function then uses the cakePos set as an attribute and startFunction does not interact with the cakePos or any cake related functions, it does clear the navigator and set the entity state to (byte)10 (I don't know why but it looked like I should include it). I assume then that shouldExcecute isn't called twice, nevermind with different results before the first tick but I really don't know. Again thankyou,
  17. I have been having trouble with an algorithm in one of the goals of a mob I am working on, this function is supposed to find a nearby cake block so that the entity can locate it however the cake seems to keep setting itself to null. After some diving i realised this was because of the mutability of blockposses but I haven't been able to find a way around it. Here is my latest version of the code. public boolean findCake(){ BlockPos entitypos = new BlockPos(eaterEntity); for (BlockPos pos : BlockPos.getAllInBoxMutable(entitypos.add(-40, -40, -40), entitypos.add(40, 40, 40)) ){ if( isCake(entityWorld.getBlockState(pos).getBlock()) ){ cakePos = new BlockPos(pos).toImmutable(); break; } } return cakePos == null; } I have tried all manner of things when it comes to transferring the data into my cakePos variable (which is a class variable in the goal). I have tried calling pos.toImmutable, I have tried calling the x, y and z values of pos and putting them into BlockPos instead, I even tried saving them as integers independently and waiting until after the for loop to construct my BlockPos. I also at points in my code logged cakedPos, what i found was that inside of the loop it would print the coords however outside it would say that cakePos only holds null, apart from occasionally seeming to log twice, once saying it existed and then saying it had been set to null which I found incredibly strange. I have now looked up how other mods have done it and most recently changed it all to use getAllInBox( bla bla bla).foreach( pos -> {...}) and made sure while doing this i called immutable and such. I am very confused.
  18. I have a feeling that when tree features generate they have to be able to see the sky but I'm not 100% sure because I haven't tried to do this sort of thing and most of the fields inside of the tree class are obfuscated.
  19. Oh haha, thankyou, that's really useful, I should have checked really. It's like the old programming thing, someone's probably done it before and better.
  20. Yeah, I think so, glad that it seems to be loading the block tags now though. I wrote a little program to help auto generate a lot of files, it was primarily for block-states and models but it also does some other things and while it's massively helped with speed and enjoyability of developing this mod it does also mean that I'm going at a speed where it's slightly hard to debug, there's a chance there's a hiccup with that, either that or one of the extra few recipes I added manually, If I check the logs it should tell me where it is, right. Also, again, thankyou very much for helping me with this.
  21. I changed where I typed minecraft in the block tags instead of my mod id on the last 3 files you mentioned (i haven't changed it on github), when doing that I removed the first file you mentioned, the problamatic #lotb:shire_oak_logs file, entirely and it all worked fine. I then re-added the logs file unchanged and nothing seemed to have broken, all the blocks reconnected, saplings still placed trees correctly, so on. The only thing that isn't working is recipes and block loot_tables (presumably all loot tables but i only currently have the ones for block drops), for both vanilla and my mod, ie: no blocks will drop, nothing is craftable. Thanks for pointing out my silly id mess up though, I was finding it really hard to find it and you also gave me some very useful pointers in how to find issues with the data.
  22. I fixed the problem with me putting minecraft instead of lotb, that was a silly mistake to miss however I genuinely can't see the problem with the logs file. Is it something really obvious staring me in the face, is it something to do with the hashtag because I am trying to link a block tag I've created. I don't want to come across like I'm taking the mic but I'm known to be quite dyslexic at the best of times. Sorry.
  23. Oh, right, what's wrong with it, is the # supposed to come before the open quotes?
  24. Oh right yeah, just looked inside my logs folder, not sure if this is what you were looking fo but i found files named latest.log and debug.log latest.log debug.log
  25. hi, yes, sorry, just had to make a github account (I should really have had one by now). Here (hopefully) is a link to my project https://github.com/slit-bodmod/lotb-mod btw, by debug.log do you mean my latest.log file from minecraft

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.