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


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

JayZX535's Achievements

Stone Miner

Stone Miner (3/8)



  1. Oh, thank you! That helped me figure it out! Looks like what I was looking for was ItemTags.getAllTags().getTagOrEmpty(location).contains(item) It appears to be functioning now!
  2. Alright... so what does that mean I need to do to access them in 1.16.5? How do I convert the code to use the Mojang names? I'm struggling to find any real examples of what the differences between them actually are.
  3. Hello, I'm trying to access the items in a custom tag list, but I'm having a very hard time figuring out how to do so. The Forge documentation is telling me to use ItemTags.getCollection().getOrCreateTag(myTagId).contains(unknownItem); but ItemTags in 1.16.5 doesn't have a getCollection() method. I thought maybe this was getAllTags() now but that doesn't have a getOrCreateTag(myTagId) function. Trying to use getTag(location) throws a null error, and getTagOrEmpty(location) appears to return an empty tag. So I'm kind of at a loss. How is one meant to go about setting up custom tags for a mod in 1.16.5? For clarity's sake, I'm trying to make a tag along the lines of "modid:my_tag" and then access that from within the Java code.
  4. Dang, still didn't upload right. Sorry Eesh, that's unfortunate. I'll have to poke around with it some more, but it may just not be doable. Is there a way to manually trigger the reload event? The one idea in my head currently is to have a boolean to see if the files have been updated, and if not, manually trigger the reload the first time it tries to run the biome event. But that sounds like it could be a bit dodgy so I'm not sure if that'd work... Thank you for your help nonetheless.
  5. Argh. Not used to github, hopefully this version works... https://github.com/JayZX535/mcbiomespawner Also, it definitely seems to me that the issue is that the datapack loads after the event runs. I ran a dedicated server and looked at the logs, and I can see my debug statements from the BiomeLoadingEvent running before the ones that get the information from the datapack. I'm just not certain how to solve that problem, unfortunately...
  6. Here it is. https://github.com/JayZX535/mcbiomespawner (this is set up to clear all entity spawns in the savanna and replace them with wolves and cats. whenever it detects a spawn has been modified, it will clear all existing spawns to ensure easy visibility.) What it's doing that has me stumped is when you first create a world, the spawns aren't modified. When you quit to menu and reload it, the spawns aren't modified. But when you relaunch the game entirely and then load the world, then the new spawns take effect. I'm still new to the way 1.16 works and I haven't worked too much with data until now, so maybe there's something I'm misunderstanding...
  7. Ohhhh hmmm, that may be what's causing the problem. I'm trying to use this info in the BiomeLoadingEvent, but it looks like the first time it runs, the data hasn't been updated. If I reload worlds the data applies properly, but the first time it runs the data hasn't been set yet, so it ignores it and carries on as usual. I'm guessing that means I have to check and see if the data needs updating at the start of that event, and then make sure I have it update data if it does? Unless this event just runs before the data is even accessible, in which case what I'm trying to do might just not be possible. Either that, or I need to reload the biomes themselves once the data is updated, but I'm guessing the prior option may be the better one. How could I go about reloading the resources if I detect they haven't been generated for the BiomeLoadingEvent? Or is that not going to be a safe thing to do?
  8. Well, I got it almost figured out. For some reason it seems to only be loading on the client? Which is odd, because my research is indicating that the AddReloadListenerEvent is supposed to be serverside? I'm registering it as the following. Fairly stumped... @EventBusSubscriber(modid = Mod.MODID, bus = EventBusSubscriber.Bus.FORGE) public class ReloadListener { @SubscribeEvent public static void addReloadListenerEvent(AddReloadListenerEvent event) { event.addListener(Mod.getDataThing()); Mod.getLogger().info("ReloadListener registered."); } } The only thread that log seems to get called on is the render one. Running it on a server never outputs that log at all. I can correctly output the data I'm getting from the json into the logs on the client side, but the server doesn't seem to have access to it. Is extending JsonReloadListener supposed to be able to work with serverside resources?
  9. Oh thank you! That looks like what I was trying to figure out, and it looks like I've got it loading now!
  10. Yes, I've worked with the existing types of data such as tags, recipes, etc. before. What I'm having difficulty with is trying to create a new type of data. Like what Origins has done to allow the adding/modifying of alternative origins and powers, a feature that is added by the mod itself and not part of Vanilla minecraft like tags, recipes, advancements, etc. That's where I'm having trouble.
  11. Hey all, I'm attempting to figure out how to make some functions of my mod editable via datapacks, in much the same way as recipes, advancements, etc. can be edited. I'd love to see examples of how others have done this, since I'm struggling to figure out how it's even set up in the first place. I know Origins makes use of custom datapacks to edit powers, but it runs on Fabric, not Forge, so not as helpful for figuring out how to do it on Forge specifically. I also need to make sure that datapacks are able to append their data to each existing entry instead of just overwriting it. If anyone has or knows of examples of this I'd love to see them, I'm having a hard time actually tracking anything down to look at since I end up just getting results for actual datapacks, oops. Thank you for your time, and have a great day! EDIT: Just to specify, I'm talking about adding new types of data, not just using existing ones. I know how to add stuff like item tags, recipes, etc. I want to add a new type of data that can be edited through a datapack in the same sort of way-- like what Origins does to allow for the adding of new powers and such. I just don't know how to do that in Forge. Sorry for the initial confusion.
  12. That does indeed sound like it-- though I'm having a hard time finding any examples of how it's used. How would I go about setting one of those up? Admittedly this is rather uncharted terrain for me...
  13. Hey all, I'm working on a mod where I need to check if items can be used in/outputted from a recipe-- in this case, campfire recipes, but I may expand that to other types at some point in the future. Since both mods and datapacks can add recipes, I'd like to make this function as dynamic as possible. I'd also like to avoid having to iterate through all the possible recipes every time I need to test if something is a viable outcome, especially since some of the checks will be for the recipe output and not input (which seems less straightforward to figure out). It seems like it'd be less resource intensive to build a list of viable items once upon each load/reload, and then just use that list to check if something is a viable option or not. But, since recipes can change when datapacks are added/reloaded, I need to make sure these lists are regenerated after every reload, as well as after the initial recipe registration. Basically, what I'd like to do is listen for a server load or reload, loop through the list of recipes to find recipe inputs/outputs that match a certain set of criteria, add them to a set of lists that just hold the proper items, and then I can just check "is this item on this list? yes, okay or no, nevermind". Is there a good way I could go about this, and is there an event or something I could listen for to know when to trigger it? Or is it better just to loop through all the recipes every time as needed, even considering that there's a possibility of other mods adding a lot of possible recipes that could qualify? Will that be a lag concern or should that be fine? (usually I err toward the side of it being better to have a larger lag spike very infrequently than smaller ones that happen more often/interruptingly). Thanks, and have a great day!
  14. Are you saying you want the entity to take damage when you are sneaking on it? Not damage except when you're sneaking on it (i.e. magma blocks)? If so, you'll want to check entityIn.isSneaking(), not !entityIn.isSneaking(). The latter returns true when the entity isn't sneaking.
  15. Anyone know what else I could try to fix this? I'm truly at a loss Edit 6/30/20: Updating for anyone who may come here seeking answers later: I... fixed it? I ended up recreating my modding workspace, and now it's working again. So I'm guessing something got goofed up there? Truly, this is one of the more mysterious things I've encountered, and I wish I had a more solid idea on what I did. But when all else fails, redo your workspace I guess?
  • Create New...

Important Information

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