commit a4e2aa5770eb07ac60d41d921a58ca8a0680c2dc Author: newt Date: Sat Aug 31 21:19:11 2024 +0100 feat: publish pack diff --git a/bottle.webp b/bottle.webp new file mode 100644 index 0000000..1133e30 Binary files /dev/null and b/bottle.webp differ diff --git a/license.md b/license.md new file mode 100644 index 0000000..bb4df02 --- /dev/null +++ b/license.md @@ -0,0 +1,57 @@ +# 🏳️‍🌈 Opinionated Queer License v1.2 + +© Copyright [newt](https://newty.dev/) + +## Permissions + +The creators of this Work (“The Licensor”) grant permission +to any person, group or legal entity that doesn't violate the prohibitions below (“The User”), +to do everything with this Work that would otherwise infringe their copyright or any patent claims, +subject to the following conditions: + +## Obligations + +The User must give appropriate credit to the Licensor, +provide a copy of this license or a (clickable, if the medium allows) link to +[oql.avris.it/license/v1.2](https://oql.avris.it/license/v1.2), +and indicate whether and what kind of changes were made. +The User may do so in any reasonable manner, +but not in any way that suggests the Licensor endorses the User or their use. + +## Prohibitions + +No one may use this Work for prejudiced or bigoted purposes, including but not limited to: +racism, xenophobia, queerphobia, queer exclusionism, homophobia, transphobia, enbyphobia, misogyny. + +No one may use this Work to inflict or facilitate violence or abuse of human rights, +as defined in either of the following documents: +[Universal Declaration of Human Rights](https://www.un.org/en/about-us/universal-declaration-of-human-rights), +[European Convention on Human Rights](https://prd-echr.coe.int/web/echr/european-convention-on-human-rights) +along with the rulings of the [European Court of Human Rights](https://www.echr.coe.int/). + +No law enforcement, carceral institutions, immigration enforcement entities, military entities or military contractors +may use the Work for any reason. This also applies to any individuals employed by those entities. + +No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits) +between the highest and lowest individual in the entity is greater than 50 : 1 +may use the Work for any reason. + +No private business run for profit with more than a thousand employees +may use the Work for any reason. + +Unless the User has made substantial changes to the Work, +or uses it only as a part of a new work (eg. as a library, as a part of an anthology, etc.), +they are prohibited from selling the Work. +That prohibition includes processing the Work with machine learning models. + +## Sanctions + +If the Licensor notifies the User that they have not complied with the rules of the license, +they can keep their license by complying within 30 days after the notice. +If they do not do so, their license ends immediately. + +## Warranty + +This Work is provided “as is”, without warranty of any kind, express or implied. +The Licensor will not be liable to anyone for any damages related to the Work or this license, +under any kind of legal claim as far as the law allows. diff --git a/pack/data/drinkable_xp/function/bottle/detect_throw.mcfunction b/pack/data/drinkable_xp/function/bottle/detect_throw.mcfunction new file mode 100644 index 0000000..1e1d9b5 --- /dev/null +++ b/pack/data/drinkable_xp/function/bottle/detect_throw.mcfunction @@ -0,0 +1 @@ +execute as @a[scores={xpBottleThrow=1..}] run function drinkable_xp:bottle/thrown diff --git a/pack/data/drinkable_xp/function/bottle/thrown.mcfunction b/pack/data/drinkable_xp/function/bottle/thrown.mcfunction new file mode 100644 index 0000000..b183c4c --- /dev/null +++ b/pack/data/drinkable_xp/function/bottle/thrown.mcfunction @@ -0,0 +1,11 @@ +# stop the experience bottle from being thrown +execute as @e[type=experience_bottle] run kill @s +stopsound @s * entity.experience_bottle.throw + +# add xp and give a bottle +xp add @s 7 points +execute at @s run playsound minecraft:entity.experience_orb.pickup player @p ~ ~ ~ 0.25 +execute if score @s giveEmptyBottle matches 0 run give @s minecraft:glass_bottle + +# reset the xpBottleThrow score +scoreboard players set @s xpBottleThrow 0 diff --git a/pack/data/drinkable_xp/function/scoreboard/create.mcfunction b/pack/data/drinkable_xp/function/scoreboard/create.mcfunction new file mode 100644 index 0000000..e6b9da8 --- /dev/null +++ b/pack/data/drinkable_xp/function/scoreboard/create.mcfunction @@ -0,0 +1,7 @@ +# xp bottle throw counter +scoreboard objectives add xpBottleThrow minecraft.used:minecraft.experience_bottle + +# giveEmptyXpBottle trigger +scoreboard objectives add giveEmptyXpBottle trigger +scoreboard players enable @a giveEmptyXpBottle +execute as @a[scores={giveEmptyXpBottle=2..}] run scoreboard players set @s giveEmptyXpBottle 0 diff --git a/pack/data/minecraft/tags/function/tick.json b/pack/data/minecraft/tags/function/tick.json new file mode 100644 index 0000000..a73a43e --- /dev/null +++ b/pack/data/minecraft/tags/function/tick.json @@ -0,0 +1,6 @@ +{ + "values": [ + "drinkable_xp:scoreboard/create", + "drinkable_xp:bottle/detect_throw" + ] +} diff --git a/pack/pack.mcmeta b/pack/pack.mcmeta new file mode 100644 index 0000000..6ae2307 --- /dev/null +++ b/pack/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 48, + "description": "Drink XP bottles instead of throwing them!" + } +} diff --git a/pack/pack.png b/pack/pack.png new file mode 100644 index 0000000..b932e09 Binary files /dev/null and b/pack/pack.png differ diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..21568a4 --- /dev/null +++ b/readme.md @@ -0,0 +1,16 @@ +
+ +

DrinkableXP

+
+ +This datapack allows you to drink Bottle o' Enchanting to gain experience points instead of throwing them. + +Currently supported version: **Minecraft 1.21.1** (pack format 48) + +When you right-click with a Bottle o' Enchanting in hand, it consumes the bottle, grants 7 points of experience (the average that a Bottle o' Enchanting provides), and optionally replaces the bottle with an empty glass bottle. + +### Configuration + +By default, a Bottle o' Enchanting is replaced with an empty glass bottle upon consumption. This can be enabled or disabled on a per player basis by running the `/trigger giveEmptyXpBottle` command. + +This project is licensed with the Opinionated Queer License v1.2 - you can view it here.