Jump to content

How to construct a HolderSet? [1.19]


SpectralGerbil

Recommended Posts

Hello there, I'm an intermediate Java programmer making a Minecraft mod that does various things. Currently I'm trying to make an item that replicates the /locate command - in this particular case, I want the item to tell the player the coordinates of the nearest jungle temple.

However, I've ran into some confusion whilst doing the code for this. I looked at the code for the /locate command and my head is spinning a bit with some of these complications. The method I'm using to find the structure (findNearestMapStructure) requires a HolderSet argument. I've been browsing the javadocs for a good while now and I'm very confused as to how to create one of these - the vanilla code for /locate seems to pull information from a resource map to make one, but I don't need to use a resource map since I'm not accepting a structure as an argument like the command, correct? In that case how would I create a HolderSet for this purpose? Is there simply a way to construct one from a ResourceKey or something similar, so that the code points to a jungle temple structure?

Thanks for the help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Start with removing: modernfix and FlyWheel
    • Vigor Vita CBD Gummies- Behind every product is a story. Vigor Vita CBD Gummies's journey involves a commitment to quality, customer satisfaction, and a genuine desire to enhance the well-being of individuals. Understanding the ethos of the company adds depth to the product experience.   Official Website==> https://bestlifecaremart.com/vigor-vita-cbd-gummies/   Facebook==> https://www.facebook.com/GetVigorVitaCBDGummies/   Groups Google:   https://groups.google.com/g/mozilla.dev.platform/c/kAoLq82Obfc   https://groups.google.com/g/comp.os.vms/c/MMy0pLUnU40   https://groups.google.com/g/mozilla.dev.platform/c/op2Zyok7iKI   Sites Google==> https://sites.google.com/view/vigor-vita-c-b-d-gummies-price/home   Gamma==> https://gamma.app/public/Is-Vigor-Vita-CBD-Gummies-Scam-Read-Reviews-Best-CBD-Gummies-Pric-x91kh5meqawi99c   Jimdo==> https://vigor-vita-cbd-gummies-us-reviews-1.jimdosite.com/   Get More Info:   https://medium.com/@yvettieany/vigor-vita-cbd-gummies-united-states-us-100-natural-benefits-pain-relief-pros-cons-scam-d6cff170cac5   https://www.facebook.com/KellyClarksonSlimFusionGummiesUSA/   https://www.mid-day.com/lifestyle/infotainment/article/vigor-vita-cbd-gummies-reviews-wellness-peak-cbd-gummies-pure-ease-cbd-gummies-23314946   https://groups.google.com/g/mozilla.dev.platform/c/hG7s3KQI2q8  
    • If anyone can help me with this . I'm creating a command to open the GUI of a book. Supposedly this should work. But it doesn't do anything. Can somebody help me? Forge 1.16.5 - Server Side Mod   dispatcher.register( Commands.literal("dummyCommand") .executes(context -> { ItemStack book = new ItemStack(Items.WRITTEN_BOOK); CompoundNBT nbt = new CompoundNBT(); ListNBT pages = new ListNBT(); pages.add(StringNBT.valueOf("{\"text\":\"Hello World\"}")); nbt.putString("author", "Steve"); nbt.putString("title", "my_book"); nbt.put("pages", pages); nbt.putByte("resolved", (byte) 1); book.setTag(nbt); context.getSource().getPlayerOrException().openItemGui(book, Hand.MAIN_HAND); return 1; }) ); I have tried with "SOpenBookWindowPacket" but it only sends the instruction to open a book that the user has in their hand. ServerPlayerEntity serverPlayerEntity = context.getSource().getPlayerOrException(); SOpenBookWindowPacket packet = new SOpenBookWindowPacket(serverPlayerEntity.getUsedItemHand()); serverPlayerEntity.connection.send(packet); The idea is that this mod is an information command for the user. You should not give a book to the user and have them read it. I have seen the Spigot documentation and have found some examples of how this is done on servers. PacketPlayOutCustomPayload packet = new PacketPlayOutCustomPayload("MC|BOpen", new PacketDataSerializer(buf)); Is there a way to do this with Forge Server Side? I've been dealing with this for 2 days and I can't find a solution. I've searched on Google and can't find anything.
    • Finally got around to fixing this, just removed the use method, and changed  FIERY_ARROW_ONLY = (stack) -> stack.getItem() instanceof InitItems.FIERY_ARROW.get(); to FIERY_ARROW_ONLY = (stack) -> stack.is(InitItems.FIERY_ARROW.get()); which fixes the issue, and also allows you to use regular arrows, which is an ability I want (I scrapped this).
    • Check Mod Versions: Ensure you are using the correct version of the Scorge mod compatible with Minecraft 1.16.5. Update or downgrade the mod accordingly. Remove or Update Problematic Mods: Identify and remove mods causing conflicts. Test the game by removing mods one by one until you find the one causing the issue. Update Forge: Use the latest version of Forge for Minecraft 1.16.5 to resolve compatibility issues. Check for Mod Updates: Ensure the Scorge mod is up to date. Mod developers release updates to address bugs and compatibility issues. If the problem persists, consider seeking help on Minecraft modding forums or contacting the mod developer for specific guidance. Always back up your world before making changes.
  • Topics

×
×
  • Create New...

Important Information

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