Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted
    public SetPlayerSpawn(Player player, BlockPos Pos) {
        ServerPlayer Server_Player = (ServerPlayer) player;
        Server_Player.setRespawnPosition(Server_Player.getRespawnDimension(), Pos, 0.0F, true, true);


        ResourceLocation advancementId = new ResourceLocation( TheDeadRise.MODID,"advancements:spawntrigger");
        Advancement advancement = Server_Player.getServer().getAdvancements().getAdvancement(advancementId);

        AdvancementProgress progress = Server_Player.getAdvancements().getOrStartProgress(advancement);

        for (String criterion : progress.getRemainingCriteria()) {
            Server_Player.getAdvancements().award(advancement, criterion);
        }

        if(advancement == null)
        {
            Server_Player.sendSystemMessage(Component.literal("shit is not working"));
        }
        else {
            Server_Player.sendSystemMessage(Component.literal("shit is sorta working"));
        }

    }

I'm trying to figure out if I'm doing something wrong with the resource location or something else. It's a simple problem, but I keep running into issues. Any help or guidance would be greatly appreciated! Also the game is not crashing at all if advancement is null.

Edited by TheCursedModder
more details

We might need more context. Are you trying to programatically trigger a custom advancement?

  • TheCursedModder changed the title to (Solved)What am I doing wrong?
  • Author

Oh I forgot to update the title. I figured out the issue and I'm rather embarrassed to say that it was a file path issue. The game already knew I was accessing the achievements so I wasn't suppose to include advancements in the file path. Minecraft file paths have always confused me a little bit...

ResourceLocation advancementId = new ResourceLocation( TheDeadRise.MODID,"adventure/spawntrigger");

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.