-
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.
new version, using consumable component
- Loading branch information
Showing
32 changed files
with
292 additions
and
173 deletions.
There are no files selected for viewing
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
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,19 @@ | ||
{ | ||
"criteria": { | ||
"requirement": { | ||
"trigger": "minecraft:consume_item", | ||
"conditions": { | ||
"item": { | ||
"components": { | ||
"minecraft:custom_data": { | ||
"experience_bottle.empty": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"rewards": { | ||
"function": "experience_bottle:empty/consume" | ||
} | ||
} |
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,19 @@ | ||
{ | ||
"criteria": { | ||
"requirement": { | ||
"trigger": "minecraft:consume_item", | ||
"conditions": { | ||
"item": { | ||
"components": { | ||
"minecraft:custom_data": { | ||
"experience_bottle.filled": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"rewards": { | ||
"function": "experience_bottle:filled/consume" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
advancement revoke @s only experience_bottle:consume/empty | ||
|
||
xp add @s -1395 points | ||
|
||
execute if predicate experience_bottle:empty/mainhand run return run loot replace entity @s weapon.mainhand loot experience_bottle:filled | ||
execute if predicate experience_bottle:empty/offhand run return run loot replace entity @s weapon.offhand loot experience_bottle:filled |
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 @@ | ||
execute store result score @s experience_bottle.player.xp run xp query @s levels | ||
|
||
$execute if score @s experience_bottle.player.xp matches ..29 run return run item modify entity @s weapon.$(hand)hand experience_bottle:non_consumable | ||
|
||
$item modify entity @s weapon.$(hand)hand experience_bottle:consumable/empty |
3 changes: 0 additions & 3 deletions
3
data/experience_bottle/function/empty/insufficient_xp/check_hand.mcfunction
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
data/experience_bottle/function/empty/insufficient_xp/left.mcfunction
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
data/experience_bottle/function/empty/insufficient_xp/right.mcfunction
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
advancement revoke @s only experience_bottle:consume/filled | ||
|
||
xp add @s 1395 points | ||
|
||
execute if predicate experience_bottle:filled/mainhand run return run loot replace entity @s weapon.mainhand loot experience_bottle:empty | ||
execute if predicate experience_bottle:filled/offhand run return run loot replace entity @s weapon.offhand loot experience_bottle:empty | ||
|
||
# execute if items entity @s weapon.mainhand minecraft:glass_bottle run return run loot replace entity @s weapon.mainhand loot experience_bottle:empty | ||
# execute if items entity @s weapon.offhand minecraft:glass_bottle run return run loot replace entity @s weapon.offhand loot experience_bottle:empty |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
scoreboard objectives add experience_bottle.potion_use minecraft.used:minecraft.potion | ||
scoreboard objectives add experience_bottle.player_xp dummy | ||
scoreboard objectives add experience_bottle.player.xp dummy | ||
|
||
advancement revoke @a only experience_bottle:consume/empty | ||
advancement revoke @a only experience_bottle:consume/filled |
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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
execute as @a[nbt={active_effects:[{id:"minecraft:mining_fatigue",amplifier:19b}]}] if score @s experience_bottle.potion_use matches 1.. run function experience_bottle:empty/check_xp | ||
execute as @a[nbt={active_effects:[{id:"minecraft:mining_fatigue",amplifier:20b}]}] if score @s experience_bottle.potion_use matches 1.. at @s run function experience_bottle:filled/check_hand | ||
|
||
execute as @a if score @s experience_bottle.potion_use matches 1.. run scoreboard players reset @s experience_bottle.potion_use | ||
execute as @a if predicate experience_bottle:empty/mainhand run function experience_bottle:empty/holding {"hand":"main"} | ||
execute as @a if predicate experience_bottle:empty/offhand run function experience_bottle:empty/holding {"hand":"off"} |
11 changes: 11 additions & 0 deletions
11
data/experience_bottle/item_modifier/consumable/empty.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,11 @@ | ||
{ | ||
"function": "minecraft:set_components", | ||
"components": { | ||
"minecraft:consumable": { | ||
"consume_seconds": 0.05, | ||
"animation": "none", | ||
"sound": "minecraft:block.trial_spawner.spawn_mob", | ||
"has_consume_particles": false | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
data/experience_bottle/item_modifier/consumable/filled.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,17 @@ | ||
{ | ||
"function": "minecraft:set_components", | ||
"components": { | ||
"minecraft:consumable": { | ||
"consume_seconds": 2, | ||
"animation": "drink", | ||
"sound": "minecraft:entity.generic.drink", | ||
"has_consume_particles": false, | ||
"on_consume_effects": [ | ||
{ | ||
"type": "minecraft:play_sound", | ||
"sound": "entity.player.levelup" | ||
} | ||
] | ||
} | ||
} | ||
} |
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_components", | ||
"components": { | ||
"!minecraft:consumable": {} | ||
} | ||
} |
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,43 @@ | ||
{ | ||
"pools": [ | ||
{ | ||
"rolls": 1, | ||
"entries": [ | ||
{ | ||
"type": "item", | ||
"weight": 1, | ||
"name": "minecraft:command_block", | ||
"functions": [ | ||
{ | ||
"function": "set_count", | ||
"count": 1 | ||
}, | ||
{ | ||
"function": "set_components", | ||
"components": { | ||
"minecraft:rarity": "epic", | ||
"minecraft:enchantment_glint_override": true, | ||
"minecraft:max_stack_size": 1, | ||
"minecraft:custom_data": { | ||
"experience_bottle.empty": true | ||
}, | ||
"minecraft:consumable": { | ||
"consume_seconds": 0.05, | ||
"animation": "none", | ||
"sound": "minecraft:block.trial_spawner.spawn_mob", | ||
"has_consume_particles": false | ||
}, | ||
"minecraft:use_cooldown": { | ||
"seconds": 2, | ||
"cooldown_group": "experience_bottle:cooldown" | ||
}, | ||
"minecraft:item_model": "minecraft:glass_bottle", | ||
"minecraft:custom_name": "{\"text\":\"Experience Bottle\",\"italic\": false}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
49 changes: 0 additions & 49 deletions
49
data/experience_bottle/loot_table/empty_experience_bottle.json
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
{ | ||
"pools": [ | ||
{ | ||
"rolls": 1, | ||
"entries": [ | ||
{ | ||
"type": "item", | ||
"weight": 1, | ||
"name": "minecraft:potion", | ||
"functions": [ | ||
{ | ||
"function": "set_count", | ||
"count": 1 | ||
}, | ||
{ | ||
"function": "set_components", | ||
"components": { | ||
"minecraft:rarity": "epic", | ||
"minecraft:enchantment_glint_override": true, | ||
"minecraft:custom_data": { | ||
"experience_bottle.filled": true | ||
}, | ||
"minecraft:potion_contents": { | ||
"custom_color": 2276636 | ||
}, | ||
"minecraft:hide_additional_tooltip": {}, | ||
"minecraft:consumable": { | ||
"consume_seconds": 2, | ||
"animation": "drink", | ||
"sound": "minecraft:entity.generic.drink", | ||
"has_consume_particles": false, | ||
"on_consume_effects": [ | ||
{ | ||
"type": "minecraft:play_sound", | ||
"sound": "entity.player.levelup" | ||
} | ||
] | ||
}, | ||
"minecraft:use_cooldown": { | ||
"seconds": 2, | ||
"cooldown_group": "experience_bottle:cooldown" | ||
}, | ||
"minecraft:custom_name": "{\"text\":\"Experience Bottle\",\"italic\": false}", | ||
"!minecraft:use_remainder": {} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
49 changes: 0 additions & 49 deletions
49
data/experience_bottle/loot_table/filled_experience_bottle.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.