Data Packs Challenge

Secret Life SMP (Java Data Pack)

  • Functions
  • 20,737 views • 5 today
  • 1,726 downloads • 0 today
  • 52
  • 51
  • 100
Required Resource Pack
Kirbycope
Level 71 : Legendary Programmer
454
ToDo: Additional sound effects.

Notes:
  - To start each session, click the text in the book. They must be done in order!
    - To get the books run, `function secret:session-start`
  - To gift a heart to the nearest player, run `function secret:gift`. Limited to one per session!

The Secret

  • Players can earn hearts by completing their secret for the session.
  • Players can gain up to 10 hearts by finishing their secret and turning it into the Secret Keeper.
  • If the player redeems their secret their hearts will fill to 30, after they fill to 30 they will receive items instead of hearts until they get to 10 things given.
  • Players can decide to receive a harder secret and receive up to 20 hearts upon completion. However, if they fail this harder secret, the player loses 10 hearts. (The player cannot reroll their task if they have already failed.)
  • If they tell any player what their task is, they lose instantly, unless the secret specifies that it may be shared under a certain condition. If the task is a hard task, they also lose 10 hearts.
      - Once a player completes their task, this rule no longer applies to them. (They must press the "Success" button and get their rewards first.)
  • Yellow lives are able to guess a player's secret once for each player. If they manage to guess correctly, that player fails their secret. If they get it wrong, they cannot interrogate that person again for the rest of the session.
  • Red lives can no longer attack Yellow or Green lives without any provocation, like in previous seasons, nor do they have the ability to instantly fail someone's secret by guessing it. Instead, they get a task focused on killing or hurting another player, and once that task has been completed, they immediately get a new task. Each task completed will reward them with 5 hearts, and failing to complete a task by the end of the session does not constitute a fail, but the task gets replaced at the start of the next session.

Health

  • Like in 3rd Life, players get 3 lives each.
  • Players begin with 30 hearts, and cannot regenerate health by traditional means.
  • Once per session, players can "Gift" a free heart that is not taken from their heart total to any other player of their choice. This extra heart can put the player above 30 hearts. There is no other way to exchange hearts between players.
  • Players can still receive extra hearts from golden apples during the period of the absorption effect.
  • Red names can receive up to 10 hearts by killing another player (5 per kill)
  • Red names lose 2 hearts when they fail a task

Lives

  • Unlike the previous season, only Red lives can intentionally kill other players.
  • Upon dying, players respawn on their next life with 30 full hearts.
  • There is no boogeyman this season.
  • Keep Inventory is also on, so if someone dies, they keep their inventory and XP.

Drops

  • All hostile mobs have a chance to drop their egg. These eggs can also be obtained by completing secrets.
      - Though you can make spawners for most any hostile mob using the new crafting recipe (shown below), creeper spawners are NOT allowed due to op gunpowder farming.

Crafting

  • A new crafting recipe was added for spawners. This recipe includes 8 iron bars equally distributed across the crafting grid excluding the middle, like how one would make a chest with wood.
      - Creeper spawners are not allowed.

    Thanks to @cubage for building the Secret Keeper!
    CompatibilityMinecraft 1.13
    toMinecraft 1.20
    Tags

    32 Update Logs

    Update #32 : by Kirbycope 12/16/2023 1:28:46 amDecember 16, 2023 @ 6:28 am UTC

    Added Session 9!
    LOAD MORE LOGS

      Have something to say?

    SirensGhost
    12/29/2024 11:06 am
    Level 1 : New Miner
    Hey, I know you've stopped working on this but I've looked through the comments and still can't figure it out. I've seen other people ask this but red's don't get hearts upon completing tasks. I've tried all solutions you've replied with but none seem to work. Just wondering if you'd be able to help? No worries if not, I know this is an old datapack.
    1
    yuumiko
    12/04/2024 5:59 am
    Level 1 : New Miner
    not sure if you're still updating this but I'm having trouble so I might as well ask. When you succeed a red task, it shows the title that you gain 5 hearts (or however many you would get) but doesn't actually give the hearts. I tried poking around in the datapack to see if I can solve it myself but everything seems like it should be working and I'm really not that good with datapack coding so I'm not sure what to do to fix it.

    Also, when someone gets a new red task, the countdown seems to appear for everyone in the server, is there a way to make it so it only shows up for the person who's actually getting the task?

    Thanks in advance
    2
    Kirbycope
    12/04/2024 9:57 pm
    Level 71 : Legendary Programmer
    I am no longer working on this (or any Minecraft content). It's been a long time but I briefly looked at the code on GitHub and have some notes.



    1. It looks like I wrote everything to give 5hearts except to do it. red-success.mcfunction probably needs a line like `tag @s 5hearts` or something like that.
    2. I couldn't pin down everyone getting the countdown, it should only apply to those with red lives and no red task /shrug.
    1
    yuumiko
    12/11/2024 10:10 am
    Level 1 : New Miner
    Hey, sorry to bother you again. Adding the tag command seems to have fixed the problem, but I just had another small issue. The function that gives red names extra hearts on kill doesn't seem to exist. I tried adding my own but it doesn't run properly (in the original they get 10 hearts on kill and doesn't cap at 60 so I tried to copy the commands from hearts/gain/10 and extrapolate it up to like 200). It'd be great if you could help me out again but I do understand if it would be too much of a hassle for you. Thank you so much.
    1
    SirensGhost
    12/30/2024 10:43 am
    Level 1 : New Miner
    Hey, just wondering what command you put in to make the giving hearts work?
    1
    Kirbycope
    12/11/2024 11:29 am
    Level 71 : Legendary Programmer
    I don't think I coded that since it was hard for Bedrock feature parity (I made this for both Java and Bedrock). Java has a scoreboard for player kills I think. So a function would have to run that checks if the player is tagged red and has a kill, then reward them (and also reset the kill counter).
    1
    yuumiko
    12/11/2024 11:41 pm
    Level 1 : New Miner
    I wrote the code that checks for player kills and resets the scoreboard and it even displays the title that you received 10 hearts, but just the actual part that gives the hearts doesn't work. I thought it might've been a tag thing like the red-success but I couldn't get it to work still
    1
    Kirbycope
    12/12/2024 2:48 am
    Level 71 : Legendary Programmer
    You should call, hearts/gain/5.mcfunction
    1
    yuumiko
    12/04/2024 11:03 pm
    Level 1 : New Miner
    Thanks so much, I'll take a look and see if it works.
    1
    solangeloo
    04/04/2024 4:02 pm
    Level 31 : Artisan Cow
    yo, I used this but I only have one problem. in secret life when you succeed it gives you the amount of hearts succeed gives u capped off at 30 hearts then gives you items if you have any extra heart that u didnt use, for example if i had 25 hearts and I succeeded I would be at 30 and gain 5 random items from an item pool. this isnt present in the datapack and I wanted to ask if it was intentional or not
    1
    Kirbycope
    04/04/2024 9:07 pm
    Level 71 : Legendary Programmer
    history
    This is present and shown in the video demo, too.
    Here is the source code, github.com/kirbycope/secret-life-datapack/blob/main/datapacks/secret/data/secret/functions/reward.mcfunction
    1

    Welcome