-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b43504
commit 7dee988
Showing
34 changed files
with
360 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes.
21 changes: 21 additions & 0 deletions
21
...oleplay-data-v1.4/1_20_5/data/custom_roleplay_data/advancements/custom_roleplay_data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"display": { | ||
"icon": { | ||
"id": "minecraft:book" | ||
}, | ||
"title": "Custom Roleplay Data", | ||
"frame": "challenge", | ||
"description": ["",{"text":"Adds the ability to change the CustomModelData of items in order to change item textures via resource packs. ","color":"gold"},{"text":"Datapack by: ","color":"green"},{"text":"MukiTanuki\n","color":"aqua"},{"text":"Enter","color":"green"},{"text":" ","color":"gold"},{"text":"/trigger CustomModelData set #","color":"yellow"},{"text":" to set model data.\n","color":"gold"},{"text":"Enter","color":"green"},{"text":" ","color":"gold"},{"text":"/function custom_roleplay_data:admin","color":"yellow"},{"text":" and use auto-complete to set config options.","color":"gold"}], | ||
"background": "minecraft:textures/block/black_concrete.png", | ||
"show_toast": false, | ||
"announce_to_chat": false | ||
}, | ||
"criteria": { | ||
"tick": { | ||
"trigger": "minecraft:tick" | ||
} | ||
}, | ||
"rewards": { | ||
"functions": "custom_roleplay_data:enable" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
packs/custom-roleplay-data-v1.4/1_20_5/data/custom_roleplay_data/functions/second.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Description: Function that repeats every second | ||
# Called by: custom_roleplay_data:init | ||
# Entity @s: none | ||
# | ||
# reschedules | ||
schedule function custom_roleplay_data:second 1s | ||
# | ||
# trigger detection | ||
# | ||
execute as @a[scores={CustomModelData=0..}] if items entity @s weapon.mainhand * run function custom_roleplay_data:trigger | ||
# resets trigger | ||
execute as @a run function custom_roleplay_data:enable |
24 changes: 24 additions & 0 deletions
24
.../custom-roleplay-data-v1.4/1_20_5/data/custom_roleplay_data/functions/set_data.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Description: Sets the data for item in-hand | ||
# Called by: custom_roleplay_data:trigger | ||
# Entity @s: none | ||
# | ||
# Sets CustomModelData to item | ||
item modify entity @s weapon.mainhand custom_roleplay_data:copy_data | ||
title @s actionbar \ | ||
[\ | ||
{\ | ||
"text": "Set CustomModelData to ", "color": "green"\ | ||
}, \ | ||
{\ | ||
"score": {\ | ||
"name": "@s",\ | ||
"objective": "CustomModelData"\ | ||
},\ | ||
"color": "aqua"\ | ||
}\ | ||
] | ||
# removes required xp | ||
function custom_roleplay_data:subtract_levels with storage custom_roleplay_data:config {} | ||
# plays sound | ||
execute at @s run playsound minecraft:block.anvil.use player @s ~ ~ ~ 0.4 0.6 |
47 changes: 47 additions & 0 deletions
47
...s/custom-roleplay-data-v1.4/1_20_5/data/custom_roleplay_data/functions/trigger.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Description: trigger to set CustomModelData | ||
# Called by: custom_roleplay_data:second | ||
# Entity @s: none | ||
# | ||
# Sets a tag marker for items so they don't overwrite existing CustomModelData | ||
execute if items entity @s weapon.mainhand *\ | ||
[\ | ||
!minecraft:custom_model_data,\ | ||
!minecraft:custom_data~{CustomRoleplayData:1b}\ | ||
] run \ | ||
item modify entity @s weapon.mainhand custom_roleplay_data:marker_nbt | ||
execute if items entity @s weapon.mainhand *\ | ||
[\ | ||
minecraft:custom_model_data,\ | ||
!minecraft:custom_data={CustomRoleplayData:1b}\ | ||
] run \ | ||
title @s actionbar \ | ||
{\ | ||
"text": "Can't set CustomModelData for this item!", \ | ||
"color": "red"\ | ||
} | ||
# checks for xp | ||
execute if items entity @s weapon.mainhand *[minecraft:custom_data~{CustomRoleplayData:1b}] \ | ||
unless score @s crd_xp >= #min_level crd_xp_dummy run \ | ||
title @s actionbar \ | ||
[\ | ||
{\ | ||
"text": "Requires at least ",\ | ||
"color": "red"\ | ||
},\ | ||
{\ | ||
"score": { \ | ||
"name": "#min_level", \ | ||
"objective": "crd_xp_dummy" \ | ||
}, \ | ||
"color": "aqua"\ | ||
}, \ | ||
{\ | ||
"text": " level(s)!", \ | ||
"color": "red"\ | ||
}\ | ||
] | ||
# Sets the CustomModelData for the item | ||
execute if items entity @s weapon.mainhand *[minecraft:custom_data~{CustomRoleplayData:1b}] \ | ||
if score @s crd_xp >= #min_level crd_xp_dummy run \ | ||
function custom_roleplay_data:set_data |
13 changes: 13 additions & 0 deletions
13
.../custom-roleplay-data-v1.4/1_20_5/data/custom_roleplay_data/item_modifiers/copy_data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"function": "minecraft:set_custom_model_data", | ||
"value": { | ||
"type": "minecraft:score", | ||
"target": { | ||
"type": "context", | ||
"target": "this" | ||
}, | ||
"score": "CustomModelData" | ||
} | ||
} | ||
] |
6 changes: 6 additions & 0 deletions
6
...custom-roleplay-data-v1.4/1_20_5/data/custom_roleplay_data/item_modifiers/marker_nbt.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
{ | ||
"function": "minecraft:set_custom_data", | ||
"tag": "{CustomRoleplayData:1b}" | ||
} | ||
] |
21 changes: 21 additions & 0 deletions
21
...roleplay-data-v1.4/1_21_0/data/custom_roleplay_data/advancement/custom_roleplay_data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"display": { | ||
"icon": { | ||
"id": "minecraft:book" | ||
}, | ||
"title": "Custom Roleplay Data", | ||
"frame": "challenge", | ||
"description": ["",{"text":"Adds the ability to change the CustomModelData of items in order to change item textures via resource packs. ","color":"gold"},{"text":"Datapack by: ","color":"green"},{"text":"MukiTanuki\n","color":"aqua"},{"text":"Enter","color":"green"},{"text":" ","color":"gold"},{"text":"/trigger CustomModelData set #","color":"yellow"},{"text":" to set model data.\n","color":"gold"},{"text":"Enter","color":"green"},{"text":" ","color":"gold"},{"text":"/function custom_roleplay_data:admin","color":"yellow"},{"text":" and use auto-complete to set config options.","color":"gold"}], | ||
"background": "minecraft:textures/block/black_concrete.png", | ||
"show_toast": false, | ||
"announce_to_chat": false | ||
}, | ||
"criteria": { | ||
"tick": { | ||
"trigger": "minecraft:tick" | ||
} | ||
}, | ||
"rewards": { | ||
"functions": "custom_roleplay_data:enable" | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
packs/custom-roleplay-data-v1.4/1_21_0/data/custom_roleplay_data/function/admin.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# | ||
# Description: Display admin options in chat | ||
# Called by: Player | ||
# Entity @s: Player | ||
# | ||
tellraw @s \ | ||
[\ | ||
{\ | ||
"text":"Custom Roleplay Data - Admin Options",\ | ||
"color":"yellow",\ | ||
"bold":true\ | ||
}\ | ||
] | ||
tellraw @s \ | ||
[\ | ||
{\ | ||
"text":"Datapack by MukiTanuki", \ | ||
"color": "aqua", \ | ||
"clickEvent": {\ | ||
"action": "open_url", \ | ||
"value": "https://twitter.com/MukiTanuki"\ | ||
}\ | ||
}\ | ||
] | ||
tellraw @s \ | ||
[\ | ||
{\ | ||
"text":"Min required levels: ",\ | ||
"color":"aqua",\ | ||
"hoverEvent": {\ | ||
"action":"show_text",\ | ||
"contents": [\ | ||
{\ | ||
"text":"Sets the number of minimum levels required to set CustomModelData.\nSet to 0 to disable level requirement.",\ | ||
"color":"yellow"\ | ||
}\ | ||
]\ | ||
},\ | ||
"clickEvent":{\ | ||
"action":"suggest_command",\ | ||
"value":"/function custom_roleplay_data:set_required_level { level: <REPLACE WITH MIN REQUIRED LEVEL> }"\ | ||
}\ | ||
},\ | ||
{\ | ||
"score":{\ | ||
"name":"#min_level",\ | ||
"objective":"crd_xp_dummy"\ | ||
},\ | ||
"color":"green"\ | ||
}\ | ||
] |
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
packs/custom-roleplay-data-v1.4/1_21_0/data/custom_roleplay_data/function/second.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Description: Function that repeats every second | ||
# Called by: custom_roleplay_data:init | ||
# Entity @s: none | ||
# | ||
# reschedules | ||
schedule function custom_roleplay_data:second 1s | ||
# | ||
# trigger detection | ||
# | ||
execute as @a[scores={CustomModelData=0..}] if items entity @s weapon.mainhand * run function custom_roleplay_data:trigger | ||
# resets trigger | ||
execute as @a run function custom_roleplay_data:enable |
24 changes: 24 additions & 0 deletions
24
...s/custom-roleplay-data-v1.4/1_21_0/data/custom_roleplay_data/function/set_data.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Description: Sets the data for item in-hand | ||
# Called by: custom_roleplay_data:trigger | ||
# Entity @s: none | ||
# | ||
# Sets CustomModelData to item | ||
item modify entity @s weapon.mainhand custom_roleplay_data:copy_data | ||
title @s actionbar \ | ||
[\ | ||
{\ | ||
"text": "Set CustomModelData to ", "color": "green"\ | ||
}, \ | ||
{\ | ||
"score": {\ | ||
"name": "@s",\ | ||
"objective": "CustomModelData"\ | ||
},\ | ||
"color": "aqua"\ | ||
}\ | ||
] | ||
# removes required xp | ||
function custom_roleplay_data:subtract_levels with storage custom_roleplay_data:config {} | ||
# plays sound | ||
execute at @s run playsound minecraft:block.anvil.use player @s ~ ~ ~ 0.4 0.6 |
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
...m-roleplay-data-v1.4/1_21_0/data/custom_roleplay_data/function/subtract_levels.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# | ||
# Description: Subtracts levels from scoreboard | ||
# Called by: custom_roleplay_data:set_data | ||
# Entity @s: player | ||
# Parameters: | ||
# level (int): level to subtract from the player | ||
# | ||
$xp add @s -$(level) levels |
47 changes: 47 additions & 0 deletions
47
packs/custom-roleplay-data-v1.4/1_21_0/data/custom_roleplay_data/function/trigger.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Description: trigger to set CustomModelData | ||
# Called by: custom_roleplay_data:second | ||
# Entity @s: none | ||
# | ||
# Sets a tag marker for items so they don't overwrite existing CustomModelData | ||
execute if items entity @s weapon.mainhand *\ | ||
[\ | ||
!minecraft:custom_model_data,\ | ||
!minecraft:custom_data~{CustomRoleplayData:1b}\ | ||
] run \ | ||
item modify entity @s weapon.mainhand custom_roleplay_data:marker_nbt | ||
execute if items entity @s weapon.mainhand *\ | ||
[\ | ||
minecraft:custom_model_data,\ | ||
!minecraft:custom_data={CustomRoleplayData:1b}\ | ||
] run \ | ||
title @s actionbar \ | ||
{\ | ||
"text": "Can't set CustomModelData for this item!", \ | ||
"color": "red"\ | ||
} | ||
# checks for xp | ||
execute if items entity @s weapon.mainhand *[minecraft:custom_data~{CustomRoleplayData:1b}] \ | ||
unless score @s crd_xp >= #min_level crd_xp_dummy run \ | ||
title @s actionbar \ | ||
[\ | ||
{\ | ||
"text": "Requires at least ",\ | ||
"color": "red"\ | ||
},\ | ||
{\ | ||
"score": { \ | ||
"name": "#min_level", \ | ||
"objective": "crd_xp_dummy" \ | ||
}, \ | ||
"color": "aqua"\ | ||
}, \ | ||
{\ | ||
"text": " level(s)!", \ | ||
"color": "red"\ | ||
}\ | ||
] | ||
# Sets the CustomModelData for the item | ||
execute if items entity @s weapon.mainhand *[minecraft:custom_data~{CustomRoleplayData:1b}] \ | ||
if score @s crd_xp >= #min_level crd_xp_dummy run \ | ||
function custom_roleplay_data:set_data |
13 changes: 13 additions & 0 deletions
13
...s/custom-roleplay-data-v1.4/1_21_0/data/custom_roleplay_data/item_modifier/copy_data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"function": "minecraft:set_custom_model_data", | ||
"value": { | ||
"type": "minecraft:score", | ||
"target": { | ||
"type": "context", | ||
"target": "this" | ||
}, | ||
"score": "CustomModelData" | ||
} | ||
} | ||
] |
6 changes: 6 additions & 0 deletions
6
.../custom-roleplay-data-v1.4/1_21_0/data/custom_roleplay_data/item_modifier/marker_nbt.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
{ | ||
"function": "minecraft:set_custom_data", | ||
"tag": "{CustomRoleplayData:1b}" | ||
} | ||
] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
packs/custom-roleplay-data-v1.4/data/custom_roleplay_data/functions/enable.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Description: Enables trigger | ||
# Called by: advancment custom_model_data:custom_model_data | ||
# Entity @s: none | ||
# | ||
scoreboard players set @s CustomModelData -2147483648 | ||
scoreboard players enable @s CustomModelData |
17 changes: 17 additions & 0 deletions
17
packs/custom-roleplay-data-v1.4/data/custom_roleplay_data/functions/init.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Description: Sets up datapack | ||
# Called by: #minecraft:load | ||
# Entity @s: none | ||
# | ||
# adds trigger scoreboard | ||
scoreboard objectives add CustomModelData trigger | ||
scoreboard players set @a CustomModelData -2147483648 | ||
scoreboard players enable @a CustomModelData | ||
# xp level | ||
scoreboard objectives add crd_xp level | ||
scoreboard objectives add crd_xp_dummy dummy | ||
# min xp required | ||
execute unless score #min_level crd_xp_dummy matches 0.. run scoreboard players set #min_level crd_xp_dummy 1 | ||
execute store result storage custom_roleplay_data:config level int 1 run scoreboard players get #min_level crd_xp_dummy | ||
# initializes second function | ||
function custom_roleplay_data:second |
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions
9
...stom-roleplay-data-v1.4/data/custom_roleplay_data/functions/set_required_level.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Description: Sets the required level | ||
# Called by: disenchantment:disenchant_item and disenchant_book | ||
# Entity @s: player | ||
# Parameters: | ||
# level (int): min level required for custom_roleplay_data | ||
# | ||
$scoreboard players set #min_level crd_xp_dummy $(level) | ||
$data merge storage custom_roleplay_data:config { level: $(level)} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
packs/custom-roleplay-data-v1.4/data/minecraft/tags/functions/load.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
"custom_roleplay_data:init" | ||
] | ||
} |
Oops, something went wrong.