Jump to content

How to detect the title command using a mod?


RAdoNeron

Recommended Posts

What I intend to do is create a mod to "facilitate" an interesting fishing system on a Skyblock server, which means that when the animation of fishing a fish comes out, a progress bar appears (the bar is represented by this character █ and repeats about 30 times horizontally, normal cells are green and "pickup" cells are orange ~this falls on the fish's "level" of rarity, common is a band of 8-9 █, rare is a 6 █ stripe and legendary is a 4 █ stripe~; while from left to right and from right to left ~return~, each cell changes color to red as representing where to right click to pick up the fish, if you click on the in the orange area, you get the fish but if you click outside, you get a message that the fish was not caught), then I intuited that there will be a plugin (a plugin that seems to be designed by the owner of the server and is exclusive to that server) where it takes a random number between 1 to 30 where it is chosen the range of the orange stripe and then the range from 1 to 30 is iterated and that when you click the iterated number is obtained and compared with the range of numbers of the orange stripe (I think that is the logic of the functionality of the plugin).

So my question is, how can I detect the /title text that appears on the screen of that progress bar, if I don't know the variable that causes a fish to be caught when I click, how can I "check" between each and each character if a character change color and right click automatically accordingly?

 

PS: I made an external program that does that recognition and it runs perfectly but if there is a way to generate a mod that would be great.

PS 2: This bar does not appear as Minecraft usually shows it, it appears exactly centered both vertically and horizontally, additionally it does not appear with a shadow, it is only those characters mentioned above.

Edited by RAdoNeron
miscopy of p tags
Link to comment
Share on other sites

@diesieben07 I'm sorry you consider it cheating but I don't consider making it automatic to be totally cheating; I work creating automations and my job is to make people's lives easier with their manual processes, so I wanted to "facilitate" or "automate" that curious way of fishing on that server, it's as if a human were really "fishing" without being but if they don't help with this, that's fine, I'll find another way to do it, thanks.

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • A friend found this code, but I don't know where. It seems to be very outdated, maybe from 1.12? and so uses TextureManager$loadTexture and TextureManager$deleteTexture which both don't seem to exist anymore. It also uses Minecraft.getMinecraft().mcDataDir.getCanonicalPath() which I replaced with the resource location of my texture .getPath()? Not sure if thats entirely correct. String textureName = "entitytest.png"; File textureFile = null; try { textureFile = new File(Minecraft.getMinecraft().mcDataDir.getCanonicalPath(), textureName); } catch (Exception ex) { } if (textureFile != null && textureFile.exists()) { ResourceLocation MODEL_TEXTURE = Resources.OTHER_TESTMODEL_CUSTOM; TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); texturemanager.deleteTexture(MODEL_TEXTURE); Object object = new ThreadDownloadImageData(textureFile, null, MODEL_TEXTURE, new ImageBufferDownload()); texturemanager.loadTexture(MODEL_TEXTURE, (ITextureObject)object); return true; } else { return false; }   Then I've been trying to go through the source code of the reload resource packs from minecraft, to see if I can "cache" some data and simply reload some textures and swap them out, but I can't seem to figure out where exactly its "loading" the texture files and such. Minecraft$reloadResourcePacks(bool) seems to be mainly controlling the loading screen, and using this.resourcePackRepository.reload(); which is PackRepository$reload(), but that function seems to be using this absolute confusion of a line List<String> list = this.selected.stream().map(Pack::getId).collect(ImmutableList.toImmutableList()); and then this.discoverAvailable() and this.rebuildSelected. The rebuild selected seemed promising, but it seems to just be going through each pack and doing this to them? pack.getDefaultPosition().insert(list, pack, Functions.identity(), false); e.g. putting them into a list of packs and returning that into this.selected? Where do the textures actually get baked/loaded/whatever? Any info on how Minecraft reloads resource packs or how the texture manager works would be appreciated!
    • This might be a long shot , but do you remember how you fixed that?
    • Yeah, I'll start with the ones I added last night.  Wasn't crashing until today and wasn't crashing at all yesterday (+past few days since removing Cupboard), so deductive reasoning says it's likeliest to be one of the new ones.  A few horse armor mods and a corn-based add-on to Farmer's Delight, the latter which I hope to keep - I could do without the horse armor mods if necessary.  Let me try a few things and we'll see. 
    • Add crash-reports with sites like https://mclo.gs/ Add this mod: https://www.curseforge.com/minecraft/mc-mods/packet-fixer/files/5416165
  • Topics

×
×
  • Create New...

Important Information

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