Jump to content

JayZX535

Members
  • Posts

    73
  • 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)

2

Reputation

  1. Oh! I will take a look at those methods, thank you! Do entities written as NBT using the built-in methods to write them to NBT tend to be particularly bulky? That's my biggest concern here. I'm hoping many of them won't be, but I'm especially worried about the sort that can actually have inventories. I need to save the data for them, ideally a potentially large quantity without having to worry about overloading anything, into a capability, but if that's likely to get out of control quickly, I'll have to figure out how to cap it.
  2. Hey all, This is another mostly theoretical question-- how much data can a capability be reasonably expected to store without getting overwhelmed and crashing (and more importantly, how does that practically correspond to the amount seen in items, entities, etc.). I've seen cases where modpacks have experienced crashes due to players putting full storage containers in storage containers in storage containers, but even when the crash occurred, it seemed like it took a lot to get to that point. If I want to create capabilities that can store the data for example of a storage container, or write the data of a bunch of entities to a capability, for example, at what point should I be concerned about storing too much data? Or is it something that I likely don't need to worry about because it really only occurs when someone is storing many full chests' worth of items within a single inventory? Thank you for your time, and have a great day.
  3. Well, right, the exact drops each time are random, but if I can get the list of what items are possible then I can compare that to the ItemStacks given in the drop event to see what to rule out as a probable natural drop. But thank you! I'll take a look at it and see what I can do.
  4. Thank you! And ooooh hm, alright, well that's a start... at the very least sounds like that's my EXP issue solved. Is there a way to get the possible list of drops from a loot table in code? And how would I go about getting the loot table from an entity? At the very least, it seems like that could give me a slightly dirty solution of killing anything that matches up with the loot table. It's not perfect because if the entity is carrying an item it can also drop, it would still get destroyed. But that would cover most cases...
  5. Hello, I'm trying to figure out how to approach a feature I'd like to include in a mod (I don't have code to show for it yet because it doesn't exist yet, I'm still determining how to go about it in the first place). In essence, I want to cancel the loot and exp drops specifically, not the entire drop event as a whole. This is conditional per entity in a way I'm pretty sure the loot tables themselves can't detect, so I can't just replace the loot table for all entities. Redirecting it to a blank one would be an acceptable solution if I can do so from within the mod. I also can't just cancel drops as a whole because I want entities with gear to still be able to drop it, nor can I override based on a list of specific predefined entities because I'd like to make this as flexible as possible. So the basic outcome I'm looking for is... Death/Drops Event is intercepted and if the entity matches the criteria-- -It will NOT drop exp -It will NOT drop its normal loot table drops -It WILL drop any gear that has been equipped to it Does this seem like something that would be possible to do, and if so, could someone point me toward some resources/examples on how I might be able to pull it off? I'm mostly not sure what events I would even need to look at, or how to catch and alter what loot table it's pulling from. Thank you for your time.
  6. 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!
  7. 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.
  8. 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.
  9. 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.
  10. 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...
  11. 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...
  12. 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?
  13. 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?
  14. Oh thank you! That looks like what I was trying to figure out, and it looks like I've got it loading now!
  15. 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.
×
×
  • Create New...

Important Information

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