8000 GitHub - budak7273/HastePotion
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

budak7273/HastePotion

Repository files navigation

Haste Potion

Survival-friendly datapack for Minecraft that adds an craftable Potion of Caffeination that you can drink to receive Haste VIII. The potion allows you to instant-mine blocks you normally couldn't (namely cobblestone and logs) with Diamond Efficiency V tools, notably allowing instant-mining Deepslate with a Netherite Efficiency V pickaxe.

After the potion runs out, you will suffer from 8 minutes of Mining Fatigue II, as you have overexerted yourself.

Drinking another potion will return you to a state of Haste, but you'll need to keep drinking them to stave off the eventual Mining Fatigue affliction.

Download here, put zip in your save's datapacks folder, then run /reload to install

Haste Potion item tooltip

Players will receive a message in the chat upon unlocking the recipe (obtaining a bottle of honey) informing them of its existence.

Datapacks do not yet support custom brewing recipes, so the potions are made in a crafting table.

Recipe Screenshot

You can craft a Potion of Caffeination with a Icon Redstone Torch, Icon Glowstone Dust, Icon Blaze Powder, Icon Honey Bottle, Icon Glass Bottle, Icon Cocoa Beans, and an Icon Emerald in a shapeless recipe. The glass bottle is included in the recipe to avoid duplicating glass bottles via the Honey Bottle's returned glass bottle.

Features

  • Survival friendly
    • Custom crafting recipe provides a method of obtaining potions in a survival playthrough
    • Crafter (block) compatible
  • Works on Fabric/Paper/etc. servers
  • Advancement/Recipe Book integration
    • Shows up in your crafting book once you have found a Honey Bottle.
  • Addiction tracking
    • Optional scoreboard for how many potions each player has consumed

Commands (operators only)

  • /function hastepotion:give_potion
    • Gives yourself the potion's crafting ingredients for testing.
  • /function hastepotion:reinstall
    • Convenience command. Reinstalls the pack from scratch and reloads all datapacks. Has the potential to fix bugs you encounter with the datapack.
  • /function hastepotion:uninstall
    • Run this before uninstalling the pack - cleans up all scoreboard values and such. Does not delete, nor affect the functionality of, existing potions.
  • /function hastepotion:advancement_trigger
    • Display the informational message players see when they unlock the recipe.
  • /scoreboard objectives setdisplay sidebar hp_potions_drank
    • Display the potion drinking stats scoreboard in the sidebar
  • /scoreboard players set hp_player_interval hp_options <value>
    • Set the update interval to a number of ticks. Default is 20. You shouldn't have to change this.

Further Details

  • The potion is not made in a Brewing Stand because datapacks can not currently add brewing stand recipes.
  • I tried to document exactly how everything works via comments in the function files. Feel free to contact me with any questions. (Discord robb4)

How it Works

  • In order to achieve the '8 minutes of haste, then 8 minutes of mining fatigue' effect, the potion gives you all of its listed effects at once.
    • The Haste given for the initial 8 minutes counteracts the 16 minutes of Mining Fatigue
    • Mining Fatigue is actually markedly more potent than Haste, so the player actually needs to be given Haste 94 (amp 93) to reach Haste 4 levels of potency, or Haste 138 (amp 137) to reach Haste 8 levels of potency, while afflicted with Mining Fatigue 2.
    • Bad Luck amp 42 is also given to the player, which a background loop detects on 1 second intervals to trigger some fun sounds and particle effects. You can edit the scoreboard to slow this down or speed it up.
  • Custom NBT data and NBT-hiding flags are used to hide the potion's true effects and replace them with the descriptive tooltip.

Credit

  • Before Pack Format 34 allowed for custom recipes with custom data on the output items, I based my custom crafting system off of the one that SethBling uses in his Water Mill datapack.
  • I used an online tellraw generator to produce tellraw commands - those are a pain.
  • Multiple stackoverflow, reddit, and minecraft forums posts explaining command behavior and nitpicky syntax were read in the process of squashing bugs.

Planned features

  • Nothing for right now. Contact me on Discord (Robb#6731) if you have ideas!
  • If they add brewing stand support to datapacks, I might rewrite this to use that instead.

About

No description, website, or topics provided.

Resources

< 4BD0 a class="Link--muted" data-analytics-event="{"category":"Repository Overview","action":"click","label":"location:sidebar;file:readme"}" href="#readme-ov-file"> Readme

Stars

Watchers

Forks

Packages

No packages published
0