-
Posts
75 -
Joined
-
Last visited
Everything posted by JayZX535
-
Multiplayer is Disabled when running Minecraft through Eclipse
JayZX535 replied to JayZX535's topic in Modder Support
Update: After much more digging, I finally found an answer: Microsoft must've changed something on their end that altered authentication. If multiplayer is showing as disabled for you, you need to follow the steps listed here to get your access token from a profile that authenticates normally outside the dev environment: https://gist.github.com/50ap5ud5/beebcf056cbdd3c922cc8993689428f4#minecraft-authentication-in-dev-environments In my case it turned out I just needed my access token, it may or may not still need the UUID. The guide is older so I don't know how many versions it will hold up in, but in my case this did seem to be what Eclipse was looking for.- 1 reply
-
- 1
-
Is there a setting I need to enable to allow me to use multiplayer through Eclipse? Launching the client works, but the multiplayer and realms button are greyed out and hovering over them gives me a "multiplayer is disabled" tooltip that asks me to check my Microsoft account settings, which is... not great for testing purposes. I know on the server end you have to put it in offline mode to be able to sign in, but I've never seen it have this happen on the client end.
-
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.
-
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.
-
Prevent Loot Table and Exp Drop on Entity Death
JayZX535 replied to JayZX535's topic in Modder Support
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. -
Prevent Loot Table and Exp Drop on Entity Death
JayZX535 replied to JayZX535's topic in Modder Support
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... -
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.
-
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!
-
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.
-
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.
-
[1.16.5] Make Mod Data Editable with Datapack (adding new data type)?
JayZX535 replied to JayZX535's topic in Modder Support
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. -
[1.16.5] Make Mod Data Editable with Datapack (adding new data type)?
JayZX535 replied to JayZX535's topic in Modder Support
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... -
[1.16.5] Make Mod Data Editable with Datapack (adding new data type)?
JayZX535 replied to JayZX535's topic in Modder Support
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... -
[1.16.5] Make Mod Data Editable with Datapack (adding new data type)?
JayZX535 replied to JayZX535's topic in Modder Support
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? -
[1.16.5] Make Mod Data Editable with Datapack (adding new data type)?
JayZX535 replied to JayZX535's topic in Modder Support
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? -
[1.16.5] Make Mod Data Editable with Datapack (adding new data type)?
JayZX535 replied to JayZX535's topic in Modder Support
Oh thank you! That looks like what I was trying to figure out, and it looks like I've got it loading now! -
[1.16.5] Make Mod Data Editable with Datapack (adding new data type)?
JayZX535 replied to JayZX535's topic in Modder Support
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. -
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.
-
[1.15.2] Perform Action when Recipes Loaded or Reloaded
JayZX535 replied to JayZX535's topic in Modder Support
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... -
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!
-
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.
-
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?
-
Ah, I'd been trying the first part that way originally but saw a suggestion to try it like this. Didn't help, so I've changed it back now. Hmmm. I had mine set up to take a string (as noted in my ServerConfig file) but I tried changing it to a path. It now looks like this: @Mod.EventBusSubscriber public class ServerConfig { private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); public static final ForgeConfigSpec CONFIG; static { GeneralConfig.initServer(BUILDER); CONFIG = BUILDER.build(); } public static void loadConfig(ForgeConfigSpec config, Path path) { final CommentedFileConfig file = CommentedFileConfig.builder(path).sync().autosave().writingMode(WritingMode.REPLACE).build(); file.load(); config.setConfig(file); } } But still no dice. Still getting the error
-
Hey all, So I'm trying to set up a config for my mod and having some issues. It keeps tossing the following error at me: I've been searching high and low to figure it out and I'm having a time of it. I'm not sure if I found a forge bug or if I'm just missing something stupid, but in any case, hopefully someone here can help. Code is as follows... Main: ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, ServerConfig.CONFIG, "modid-server.toml"); ServerConfig.loadConfig(ServerConfig.CONFIG, FMLPaths.CONFIGDIR.get().resolve("modid-server.toml").toString()); ServerConfig: @Mod.EventBusSubscriber public class ServerConfig { private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); public static final ForgeConfigSpec CONFIG; static { GeneralConfig.initServer(BUILDER); CONFIG = BUILDER.build(); } public static void loadConfig(ForgeConfigSpec config, String path) { final CommentedFileConfig file = CommentedFileConfig.builder(new File(path)).sync().autosave().writingMode(WritingMode.REPLACE).build(); file.load(); config.setConfig(file); } } GeneralConfig: public class GeneralConfig { public static ForgeConfigSpec.BooleanValue SIMPLE_DAY_CYCLE; protected static void initServer(ForgeConfigSpec.Builder server){ setupGeneralSettingsConfig(server); } private static void setupGeneralSettingsConfig(ForgeConfigSpec.Builder builder){ builder.comment("General Settings").push("generalsettings"); SIMPLE_DAY_CYCLE = builder.comment("").define("simpledaycycle", false); builder.pop(); } } Thanks, and have a great day!
-
WAIT. I just realized you meant the actual entity model class itself and not the layer renderer class (this is what I get for coding late into the night asdfghjkl). My model was indeed calling this: @Override public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){ chestBase.render(matrixStack, buffer, packedLight, packedOverlay); bodyBase.render(matrixStack, buffer, packedLight, packedOverlay); tailBase.render(matrixStack, buffer, packedLight, packedOverlay); } When it should have been calling this: @Override public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){ chestBase.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); bodyBase.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); tailBase.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); } I use BlockBench for my modeling and have been working with the autogenned export mostly, so it's good to know it doesn't add those by default. Everything works great now, so thank you again for your help!