Skip to content

Commit

Permalink
v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
legopitstop committed Dec 10, 2024
1 parent 593f7e1 commit 55ce118
Show file tree
Hide file tree
Showing 114 changed files with 5,131 additions and 728 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [datapack-1.6.0] - 12/10/2024

### General

- Updated for 1.21.4
- Items now use the updated item model system.
- Added "Bandage" lore to all items added by this datapack.

## [datapack-1.5.0] - 7/17/2024

### General

- Updated for 1.21
- Uninstall function now removes "bandage.Length" scoreboard

## [datapack-1.4.0] - 4/12/2024

### General

- Updated for 1.20.5 item format.
- Added custom data to make your own custom bandages.

## [datapack-1.3.0] - 6/26/2023

### General

- Updated for 1.20

## [datapack-1.2.1] - 12/22/2022

### General

- Fixed in-game reload message (Uses new system)
- Fixed an issue with textures not loading when using forge

## [datapack-1.2.0] - 12/19/2022

### General

- Updated for 1.19.3
- The Minecraft bow should now properly render when in 3rd person.

## [datapack-1.1.0] - 11/25/2021

### General

- Updated for 1.17.1
- Addded #give:bangages command to get all items

## [datapack-1.0.0] - 5/8/2021

Inital release
7 changes: 7 additions & 0 deletions datapack/datapack/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bandage (c) 2024 by Legopitstop

Bandage is licensed under a
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

You should have received a copy of the license along with this
work. If not, see <https://creativecommons.org/licenses/by-nc-nd/4.0/>.
10 changes: 10 additions & 0 deletions datapack/datapack/data/bandage/function/load.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Made by: @Legopitstop
# Desc: Setup for the datapack
#
# Called by: #minecraft:load

# add scores
scoreboard objectives add bandage.UsedBow minecraft.used:minecraft.bow
scoreboard players add @a bandage.UsedBow 0

scoreboard objectives add bandage.Length dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Made by: @Legopitstop
# Desc: Bandage tick
#
# Called By: bandage:main_tick

# Stop the arrow sound
stopsound @s player minecraft:entity.arrow.shoot

# give player arrow in the offhand if they don't have one
execute unless entity @s[nbt={Inventory:[{id: "minecraft:arrow"}]}] unless entity @s[nbt={Inventory:[{Slot:-106b}]}] run item replace entity @s weapon.offhand with arrow[item_model="bandage:invisible",hide_tooltip={},custom_data={"invisible":true}]

# error is player has item in offhand
execute unless entity @s[nbt={Inventory:[{Slot:-106b,components:{"minecraft:custom_data":{invisible:true}}}]}] run title @p actionbar [{"translate":"bandage.offhand_item","color":"red"}]

# bandage
execute as @a[scores={bandage.UsedBow=1..}] at @s if entity @e[type=arrow,sort=nearest,nbt={crit:1b}] run function bandage:private/used
execute as @a[scores={bandage.UsedBow=1..}] at @s run function bandage:private/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Made by: @Legopitstop
# Desc: Give the target the effect
#
# Called By: bandage:private/loop

$effect give @s $(effect) $(duration) $(amplifier)
12 changes: 12 additions & 0 deletions datapack/datapack/data/bandage/function/private/loop.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Made by: @Legopitstop
# Desc: Loop through all effects and give them to the player
#
# Called By: bandage:private/used

data modify storage bandage:temp effects append from storage bandage:temp effects[0]
data remove storage bandage:temp effects[0]

function bandage:private/effect_callback with storage bandage:temp effects[0]

scoreboard players remove #length bandage.Length 1
execute if score #length bandage.Length matches 1.. run function bandage:private/loop
13 changes: 13 additions & 0 deletions datapack/datapack/data/bandage/function/private/reset.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Made by: @Legopitstop
# Desc: The clean up after using the bandage
#
# Called By: bandage:main_tick

# remove bandage
execute if entity @e[type=arrow,sort=nearest,nbt={crit:1b}] run item replace entity @s[gamemode=!creative] weapon.mainhand with air

# kill arrow
kill @e[type=arrow,distance=..3,sort=nearest]

# reset score
scoreboard players set @s bandage.UsedBow 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Made by: @Legopitstop
# Desc: The clean up after using the bandage
#
# Called By: bandage:main_tick

playsound bandage:item.bandage.use player @s
data modify storage bandage:temp effects set from entity @s SelectedItem.components."minecraft:custom_data".bandage
execute store result score #length bandage.Length run data get storage bandage:temp effects
execute if score #length bandage.Length matches 1.. run function bandage:private/loop
12 changes: 12 additions & 0 deletions datapack/datapack/data/bandage/function/tick.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Made by: @Legopitstop
# Desc: runs all files (looping)
#
# Called by: #minecraft:tick

execute as @a if data entity @s SelectedItem.components."minecraft:custom_data".bandage run function bandage:private/bandage_tick

# remove arrow when player is not holding a valid bandage item.
execute as @a unless data entity @s SelectedItem.components."minecraft:custom_data".bandage run clear @s arrow[minecraft:custom_data={invisable:true}]

# Reset bow score
execute as @a[scores={bandage.UsedBow=1..}] run scoreboard players set @s bandage.UsedBow 0
16 changes: 16 additions & 0 deletions datapack/datapack/data/bandage/function/uninstall.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Made by: @Legopitstop
# Desc: Uninstalls this datapack
#
# Called By: Player

# Disable the datapack from the world
datapack disable "file/Bandage [datapack] v1.5.0"
datapack disable "file/Bandage [datapack] v1.5.0.zip"

# Scoreboard(s)
scoreboard objectives remove bandage.UsedBow
scoreboard objectives remove bandage.Length

# Storage(s)

# Tag(s)
31 changes: 31 additions & 0 deletions datapack/datapack/data/bandage/loot_table/items/bandage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:bow",
"functions": [
{
"function": "minecraft:set_custom_data",
"tag": "{id:\"bandage:bandage\", bandage:[{\"effect\":\"saturation\",\"duration\":2,\"amplifier\":1}, {\"effect\":\"regeneration\",\"duration\":2,\"amplifier\":1}]}"
},
{
"function": "minecraft:set_components",
"components": {
"item_name": "{\"translate\":\"item.bandage.bandage\"}",
"item_model": "bandage:bandage",
"lore": [
"{\"translate\":\"item.bandage.bandage.desc\",\"color\":\"gray\",\"italic\":false}",
"{\"translate\":\"item.bandage\",\"color\":\"blue\"}"
],
"unbreakable": {"show_in_tooltip": false}
}
}
]
}
]
}
]
}
31 changes: 31 additions & 0 deletions datapack/datapack/data/bandage/loot_table/items/end_bandage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:bow",
"functions": [
{
"function": "minecraft:set_custom_data",
"tag": "{id:\"bandage:end_bandage\", bandage:[{\"effect\":\"saturation\",\"duration\":2,\"amplifier\":1}, {\"effect\":\"regeneration\",\"duration\":2,\"amplifier\":1}, {\"effect\":\"slow_falling\",\"duration\":60,\"amplifier\":1}]}"
},
{
"function": "minecraft:set_components",
"components": {
"item_name": "{\"translate\":\"item.bandage.end_bandage\"}",
"item_model": "bandage:end_bandage",
"lore": [
"{\"translate\":\"item.bandage.end_bandage.desc\",\"color\":\"gray\",\"italic\":false}",
"{\"translate\":\"item.bandage\",\"color\":\"blue\"}"
],
"unbreakable": { "show_in_tooltip": false }
}
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:bow",
"functions": [
{
"function": "minecraft:set_custom_data",
"tag": "{id:\"bandage:nether_bandage\", bandage:[{\"effect\":\"saturation\",\"duration\":2,\"amplifier\":1}, {\"effect\":\"regeneration\",\"duration\":2,\"amplifier\":1}, {\"effect\":\"fire_resistance\",\"duration\":60,\"amplifier\":1}]}"
},
{
"function": "minecraft:set_components",
"components": {
"item_name": "{\"translate\":\"item.bandage.nether_bandage\"}",
"item_model": "bandage:nether_bandage",
"lore": [
"{\"translate\":\"item.bandage.nether_bandage.desc\",\"color\":\"gray\",\"italic\":false}",
"{\"translate\":\"item.bandage\",\"color\":\"blue\"}"
],
"unbreakable": { "show_in_tooltip": false }
}
}
]
}
]
}
]
}
31 changes: 31 additions & 0 deletions datapack/datapack/data/bandage/loot_table/items/water_bandage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "minecraft:bow",
"functions": [
{
"function": "minecraft:set_custom_data",
"tag": "{id:\"bandage:water_bandage\", bandage:[{\"effect\":\"saturation\",\"duration\":2,\"amplifier\":1}, {\"effect\":\"regeneration\",\"duration\":2,\"amplifier\":1}, {\"effect\":\"water_breathing\",\"duration\":60,\"amplifier\":1}]}"
},
{
"function": "minecraft:set_components",
"components": {
"item_name": "{\"translate\":\"item.bandage.water_bandage\"}",
"item_model": "bandage:water_bandage",
"lore": [
"{\"translate\":\"item.bandage.water_bandage.desc\",\"color\":\"gray\",\"italic\":false}",
"{\"translate\":\"item.bandage\",\"color\":\"blue\"}"
],
"unbreakable": { "show_in_tooltip": false }
}
}
]
}
]
}
]
}
10 changes: 0 additions & 10 deletions datapack/datapack/data/examplemod/advancements/install.json

This file was deleted.

4 changes: 0 additions & 4 deletions datapack/datapack/data/examplemod/banner_pattern/custom.json

This file was deleted.

6 changes: 0 additions & 6 deletions datapack/datapack/data/examplemod/functions/config.mcfunction

This file was deleted.

11 changes: 0 additions & 11 deletions datapack/datapack/data/examplemod/functions/install.mcfunction

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions datapack/datapack/data/examplemod/functions/uninstall.mcfunction

This file was deleted.

5 changes: 5 additions & 0 deletions datapack/datapack/data/give/function/bandage.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Desc: gives the player the bandage item
#
# Called By: Player

loot give @s loot bandage:items/bandage
5 changes: 5 additions & 0 deletions datapack/datapack/data/give/function/end_bandage.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Desc: gives the player the bandage item
#
# Called By: Player

loot give @s loot bandage:items/end_bandage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Desc: gives the player the bandage item
#
# Called By: Player

loot give @s loot bandage:items/nether_bandage
5 changes: 5 additions & 0 deletions datapack/datapack/data/give/function/water_bandage.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Desc: gives the player the bandage item
#
# Called By: Player

loot give @s loot bandage:items/water_bandage
6 changes: 0 additions & 6 deletions datapack/datapack/data/give/functions/customitem.mcfunction

This file was deleted.

Loading

0 comments on commit 55ce118

Please sign in to comment.