From e9e4c2d520b78403eb94a3fb60bd058eb6764257 Mon Sep 17 00:00:00 2001 From: UndeadMaelys Date: Sun, 21 Feb 2021 12:49:32 +0100 Subject: [PATCH] + Added TODO.md + Created some potions + Created a system for custom thrown potions & drinkable potions ! Bugged throwable potions + Created give for potions ? Tested stuff with item modifiers, will be useful for custom weapons --- TODO.md | 22 ++++++ custom_mode_data_guide.md | 67 +++++++++++++++++ .../addtocount_custom_potions.mcfunction | 7 ++ .../functions/assigners.mcfunction | 1 + data/undeadm-core/functions/init.mcfunction | 8 +-- .../functions/scoreboards.mcfunction | 3 +- .../tags/entity_types/potion_unaffected.json | 40 +++++++++++ .../give/gender_change_potion.mcfunction | 1 + .../give/gravitation_potion.mcfunction | 1 + .../functions/give/inferno_potion.mcfunction | 1 + .../functions/give/ironskin_potion.mcfunction | 1 + .../give/lifeforce_potion.mcfunction | 1 + .../functions/give/love_potion.mcfunction | 1 + .../functions/give/recall_potion.mcfunction | 1 + .../potion/_clear_effects.mcfunction | 5 ++ .../potion/_count_custom_potions.mcfunction | 4 ++ .../potion/assign_potion_love.mcfunction | 12 ++++ .../effect_clear_gravitation.mcfunction | 1 + .../potion/effect_clear_inferno.mcfunction | 1 + .../potion/effect_clear_love.mcfunction | 1 + .../potion/effect_do_gravitation.mcfunction | 17 +++++ .../potion/effect_do_inferno.mcfunction | 1 + .../potion/effect_do_love.mcfunction | 1 + .../effect_switch_gravitation.mcfunction | 3 + .../potion/use_potion_gravitation.mcfunction | 1 + .../potion/use_potion_inferno.mcfunction | 1 + .../potion/use_potion_love.mcfunction | 2 + data/undeadm-m1/functions/potions.mcfunction | 71 +++++++++++++++++++ data/undeadm-m1/functions/tick.mcfunction | 3 + data/undeadm-m1/item_modifiers/example.json | 6 ++ 30 files changed, 279 insertions(+), 6 deletions(-) create mode 100644 TODO.md create mode 100644 custom_mode_data_guide.md create mode 100644 data/undeadm-core/functions/assigner/addtocount_custom_potions.mcfunction create mode 100644 data/undeadm-core/tags/entity_types/potion_unaffected.json create mode 100644 data/undeadm-m1/functions/give/gender_change_potion.mcfunction create mode 100644 data/undeadm-m1/functions/give/gravitation_potion.mcfunction create mode 100644 data/undeadm-m1/functions/give/inferno_potion.mcfunction create mode 100644 data/undeadm-m1/functions/give/ironskin_potion.mcfunction create mode 100644 data/undeadm-m1/functions/give/lifeforce_potion.mcfunction create mode 100644 data/undeadm-m1/functions/give/love_potion.mcfunction create mode 100644 data/undeadm-m1/functions/give/recall_potion.mcfunction create mode 100644 data/undeadm-m1/functions/potion/_clear_effects.mcfunction create mode 100644 data/undeadm-m1/functions/potion/_count_custom_potions.mcfunction create mode 100644 data/undeadm-m1/functions/potion/assign_potion_love.mcfunction create mode 100644 data/undeadm-m1/functions/potion/effect_clear_gravitation.mcfunction create mode 100644 data/undeadm-m1/functions/potion/effect_clear_inferno.mcfunction create mode 100644 data/undeadm-m1/functions/potion/effect_clear_love.mcfunction create mode 100644 data/undeadm-m1/functions/potion/effect_do_gravitation.mcfunction create mode 100644 data/undeadm-m1/functions/potion/effect_do_inferno.mcfunction create mode 100644 data/undeadm-m1/functions/potion/effect_do_love.mcfunction create mode 100644 data/undeadm-m1/functions/potion/effect_switch_gravitation.mcfunction create mode 100644 data/undeadm-m1/functions/potion/use_potion_gravitation.mcfunction create mode 100644 data/undeadm-m1/functions/potion/use_potion_inferno.mcfunction create mode 100644 data/undeadm-m1/functions/potion/use_potion_love.mcfunction create mode 100644 data/undeadm-m1/functions/potions.mcfunction create mode 100644 data/undeadm-m1/item_modifiers/example.json diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..460f4e8 --- /dev/null +++ b/TODO.md @@ -0,0 +1,22 @@ + +Potion effects + x only done love potion & gravitation + ! fix bug with throwable custom potions + x only planned so far + + Do wands + x only magic misile & fire Blast + ! make sure to check fire blast + + Give for all melee weapon + x only netherite dagger done & vanilla sword + + Give for wands + x only for magic misile + + Give for trinkets + x none done + +Create durability system using item modifiers +Create custom craftings using custom hidden advancements +Create vanilla weapon stats replacements via custom hidden achievements diff --git a/custom_mode_data_guide.md b/custom_mode_data_guide.md new file mode 100644 index 0000000..7b17616 --- /dev/null +++ b/custom_mode_data_guide.md @@ -0,0 +1,67 @@ +CUSTOM MODEL DATA NUMBERING FORMAT + + "UMMXXYY" + +Where: + U = Unique Project Num (For minecraft expanded, 1) + MM = Module Num (01,02,03,etc) + XX = Item Category (Melee weapon, Magic Weapon, Potion, Ranged Weapon, etc) + YY = Item Identifier (Each unique item model) + + This allows for up to 100 unique items per up to 100 item categories per up to 100 modules. cool! + + Each entry here will be structured as: + UMMXXYY, base_model, -> Custom Item + +PROJECT EXPANDED (23) + + MODULE 0 Core (00) + + + + MODULE 1 Combat (01) + + > (00) MELEE WEAPONS + 1010000, sword -> Scimitar + 1010001, sword -> Dagger + 1010002, axe -> Great Axe + 1010003, sword -> Great Scimitar + 1010004, shovel -> Great Hammer + 1010005, sword -> Great Sword + 1010006, shovel -> Halberd (Side A) + 1010007, axe -> Halberd (Side B) + 1010008, sword -> Katana + 1010009, axe -> Pike + 1010010, axe -> Pike (Forward) + 1010011, shovel -> Staff + 1010012, shovel -> Warhammer (Side A) + 1010013, axe -> Warhammer (Side B) + + > (01) RANGED WEAPONS + + + + > (02) MAGIC WEAPONS + 1010200, carrot_on_a_stick -> Magic Missile Staff + 1010201, carrot_on_a_stick -> Fire Blast Staff + 1010202, carrot_on_a_stick -> Ice Shard Staff + 1010203, carrot_on_a_stick -> Living Earth Staff + 1010204, carrot_on_a_stick -> Bone Dancer Staff + + > (03) POTIONS + 1010300, potion -> Potion of Gender Change + 1010301, potion -> Potion of Gravitation + 1010302, potion -> Potion of Inferno + 1010303, potion -> Potion of Ironskin + 1010304, potion -> Potion of Lifeforce + 1010305, splash_potion -> Potion of Love + 1010306, potion -> Potion of Recall + 1010307, potion -> Potion of Return + 1010308, splash_potion -> Potion of Stink + 1010309, potion -> Potion of Teleport + 1010310, potion -> Potion of Waterwalking + + > (04) TRINKETS + 1010400, clock -> Zephyrian Shell + 1010401, clock -> Olidia's Blessing + 1010402, clock -> Bloodthirsty Amulet diff --git a/data/undeadm-core/functions/assigner/addtocount_custom_potions.mcfunction b/data/undeadm-core/functions/assigner/addtocount_custom_potions.mcfunction new file mode 100644 index 0000000..9e4db64 --- /dev/null +++ b/data/undeadm-core/functions/assigner/addtocount_custom_potions.mcfunction @@ -0,0 +1,7 @@ +tellraw @a[scores={me-debugging=1..}] "undeadmaelys-core:assigner/count_custom_potions" + +scoreboard players set $count me-core_uid 0 +execute as @e[tag=Potion,tag=PotionAssigned] run scoreboard players add $count me-core_uid 1 +scoreboard players operation @s me-core_uid = $count me-core_uid +data merge entity @s {Item:{tag:{Assigned:1b}}} +execute as @e[tag=Init,tag=Potion,tag=LovePotion] run scoreboard players operation @s me-core_uid = $count me-core_uid diff --git a/data/undeadm-core/functions/assigners.mcfunction b/data/undeadm-core/functions/assigners.mcfunction index 35ea7c4..6c7e547 100644 --- a/data/undeadm-core/functions/assigners.mcfunction +++ b/data/undeadm-core/functions/assigners.mcfunction @@ -2,3 +2,4 @@ tellraw @a[scores={me-debugging=1..}] "undeadmaelys-core:assigners" scoreboard players set $count me-core_uid 0 execute as @a run function undeadmaelys-core:assigner/player + diff --git a/data/undeadm-core/functions/init.mcfunction b/data/undeadm-core/functions/init.mcfunction index a3a448c..8702bad 100644 --- a/data/undeadm-core/functions/init.mcfunction +++ b/data/undeadm-core/functions/init.mcfunction @@ -27,11 +27,10 @@ function undeadm-m1:init scoreboard players set $count me-core_uid 0 ## player input checkers - -# check for right click + + scoreboard objectives add me-core_drinkP minecraft.used:minecraft.potion + scoreboard objectives add me-core_drinkM minecraft.used:minecraft.milk_bucket scoreboard objectives add me-core_rc minecraft.used:minecraft.carrot_on_a_stick - -# check for shifting scoreboard objectives add me-core_shift minecraft.custom:minecraft.sneak_time ## custom entity trackers @@ -44,4 +43,3 @@ function undeadm-m1:init # to keep custom entities in check for a specific amount of time: control1 scoreboard objectives add me-core_entityC1 dummy - diff --git a/data/undeadm-core/functions/scoreboards.mcfunction b/data/undeadm-core/functions/scoreboards.mcfunction index 37e5ea0..aed6695 100644 --- a/data/undeadm-core/functions/scoreboards.mcfunction +++ b/data/undeadm-core/functions/scoreboards.mcfunction @@ -15,4 +15,5 @@ execute as @e[tag=EntityTimer] if score @s me-core_entityT >= @s me-core_entityM ## clean scoreboards (these represent bool checks) scoreboard players reset @a me-core_rc scoreboard players reset @a me-core_shift - +scoreboard players reset @a me-core_drinkP +scoreboard players reset @a me-core_drinkM diff --git a/data/undeadm-core/tags/entity_types/potion_unaffected.json b/data/undeadm-core/tags/entity_types/potion_unaffected.json new file mode 100644 index 0000000..b90c88a --- /dev/null +++ b/data/undeadm-core/tags/entity_types/potion_unaffected.json @@ -0,0 +1,40 @@ +{ + "replace": false, + "values": [ + "#minecraft:arrows", + "#minecraft:impact_projectiles", + "minecraft:area_effect_cloud", + "minecraft:boat", + "minecraft:chest_minecart", + "minecraft:command_block_minecart", + "minecraft:dragon_fireball", + "minecraft:egg", + "minecraft:end_crystal", + "minecraft:ender_pearl", + "minecraft:evoker_fangs", + "minecraft:experience_bottle", + "minecraft:experience_orb", + "minecraft:eye_of_ender", + "minecraft:falling_block", + "minecraft:firework_rocket", + "minecraft:fishing_bobber", + "minecraft:furnace_minecart", + "minecraft:hopper_minecart", + "minecraft:item", + "minecraft:item_frame", + "minecraft:leash_knot", + "minecraft:lightning_bolt", + "minecraft:llama_spit", + "minecraft:minecart", + "minecraft:painting", + "minecraft:player", + "minecraft:potion", + "minecraft:shulker_bullet", + "minecraft:small_fireball", + "minecraft:snowball", + "minecraft:spawner_minecart", + "minecraft:tnt", + "minecraft:tnt_minecart", + "minecraft:trident" + ] +} diff --git a/data/undeadm-m1/functions/give/gender_change_potion.mcfunction b/data/undeadm-m1/functions/give/gender_change_potion.mcfunction new file mode 100644 index 0000000..4a3c947 --- /dev/null +++ b/data/undeadm-m1/functions/give/gender_change_potion.mcfunction @@ -0,0 +1 @@ +give @s minecraft:potion{CustomPotionColor:-1,CustomModelData:2101,HideFlags:127,display:{Name:'{"text":"Potion of Gender Change","italic":"false"}'}} 1 diff --git a/data/undeadm-m1/functions/give/gravitation_potion.mcfunction b/data/undeadm-m1/functions/give/gravitation_potion.mcfunction new file mode 100644 index 0000000..2831c1f --- /dev/null +++ b/data/undeadm-m1/functions/give/gravitation_potion.mcfunction @@ -0,0 +1 @@ +give @s minecraft:potion{CustomPotionColor:-1,CustomModelData:2102,HideFlags:127,display:{Name:'{"text":"Potion of Gravitation","italic":"false"}',Lore:['{"text":"Gravity Control (4:00)","italic":"false","color":"blue"}','{"text":""}','{"text":"Press SHIFT to reverse gravity","italic":"false","color":"gray"}']}} 1 diff --git a/data/undeadm-m1/functions/give/inferno_potion.mcfunction b/data/undeadm-m1/functions/give/inferno_potion.mcfunction new file mode 100644 index 0000000..29596cd --- /dev/null +++ b/data/undeadm-m1/functions/give/inferno_potion.mcfunction @@ -0,0 +1 @@ +give @s minecraft:potion{CustomPotionColor:-1,CustomModelData:2103,HideFlags:127,display:{Name:'{"text":"Potion of Inferno","italic":"false"}',Lore:['{"text":"Circle of Fire (4:00)","italic":"false","color":"blue"}','{"text":""}','{"text":"Nearby enemies are ignited","italic":"false","color":"gray"}']}} 1 diff --git a/data/undeadm-m1/functions/give/ironskin_potion.mcfunction b/data/undeadm-m1/functions/give/ironskin_potion.mcfunction new file mode 100644 index 0000000..41719d9 --- /dev/null +++ b/data/undeadm-m1/functions/give/ironskin_potion.mcfunction @@ -0,0 +1 @@ +give @s minecraft:potion{CustomPotionColor:-1,CustomModelData:2104,HideFlags:127,display:{Name:'{"text":"Potion of Ironskin","italic":"false"}',Lore:['{"text":"Ironskin (4:00)","italic":"false","color":"blue"}','{"text":""}','{"text":"When Applied:","italic":"false"}','{"text":"+4 Armor","italic":"false","color":"blue"}']}} 1 diff --git a/data/undeadm-m1/functions/give/lifeforce_potion.mcfunction b/data/undeadm-m1/functions/give/lifeforce_potion.mcfunction new file mode 100644 index 0000000..5b8e122 --- /dev/null +++ b/data/undeadm-m1/functions/give/lifeforce_potion.mcfunction @@ -0,0 +1 @@ +give @s minecraft:potion{CustomPotionColor:-1,CustomModelData:2105,HideFlags:127,display:{Name:'{"text":"Potion of Lifeforce","italic":"false"}',Lore:['{"text":"Health Boost (4:00)","italic":"false","color":"blue"}','{"text":""}','{"text":"When Applied:","italic":"false"}','{"text":"+20% Hearts","italic":"false","color":"blue"}']}} 1 diff --git a/data/undeadm-m1/functions/give/love_potion.mcfunction b/data/undeadm-m1/functions/give/love_potion.mcfunction new file mode 100644 index 0000000..0b3626a --- /dev/null +++ b/data/undeadm-m1/functions/give/love_potion.mcfunction @@ -0,0 +1 @@ +give @s minecraft:splash_potion{CustomPotionColor:313600000000,CustomModelData:2106,HideFlags:127,display:{Name:'{"text":"Potion of Love","italic":"false"}',Lore:['{"text":"Throw this to make someone fall in love","italic":"false","color":"gray"}']}} 1 diff --git a/data/undeadm-m1/functions/give/recall_potion.mcfunction b/data/undeadm-m1/functions/give/recall_potion.mcfunction new file mode 100644 index 0000000..0de2016 --- /dev/null +++ b/data/undeadm-m1/functions/give/recall_potion.mcfunction @@ -0,0 +1 @@ +give @s minecraft:potion{CustomPotionColor:-1,CustomModelData:2107,HideFlags:127,display:{Name:'{"text":"Potion of Recall","italic":"false"}',Lore:['{"text":"Teleports you home","italic":"false","color":"gray"}']}} 1 diff --git a/data/undeadm-m1/functions/potion/_clear_effects.mcfunction b/data/undeadm-m1/functions/potion/_clear_effects.mcfunction new file mode 100644 index 0000000..d334563 --- /dev/null +++ b/data/undeadm-m1/functions/potion/_clear_effects.mcfunction @@ -0,0 +1,5 @@ +tellraw @a[scores={me-debugging=1..}] "undeadmaelys-m1:potion/_clear_effects" + +function undeadm-m1:potion/effect_clear_gravitation +function undeadm-m1:potion/effect_clear_inferno +function undeadm-m1:potion/effect_clear_love diff --git a/data/undeadm-m1/functions/potion/_count_custom_potions.mcfunction b/data/undeadm-m1/functions/potion/_count_custom_potions.mcfunction new file mode 100644 index 0000000..19688fa --- /dev/null +++ b/data/undeadm-m1/functions/potion/_count_custom_potions.mcfunction @@ -0,0 +1,4 @@ +tellraw @a[scores={me-debugging=1..}] "undeadmaelys-m1:potion/_count_custom_potions" + +scoreboard players set $potion_count me-core_uid 0 +execute as @e[nbt={Item:{tag:{Assigned:1b}}}] run scoreboard players add $potion_count me-core_uid 1 diff --git a/data/undeadm-m1/functions/potion/assign_potion_love.mcfunction b/data/undeadm-m1/functions/potion/assign_potion_love.mcfunction new file mode 100644 index 0000000..fb2bb20 --- /dev/null +++ b/data/undeadm-m1/functions/potion/assign_potion_love.mcfunction @@ -0,0 +1,12 @@ +# summon armor stand fake potion +execute at @s run summon minecraft:armor_stand ~ ~1 ~ {Invisible:1b,OnGround:0b,Tags:["Potion","LovePotion","Init"]} + +# add one more potion to the potion counter +scoreboard players add $potion_count me-core_uid 1 + +scoreboard players operation @s me-core_uid = $potion_count me-core_uid +execute as @e[tag=Init,tag=Potion] run scoreboard players operation @s me-core_uid = $potion_count me-core_uid + +# tell self that has an id so it can be tracked +data merge entity @s {Item:{tag:{Assigned:1b}}} +execute as @e[tag=Init,tag=Potion,tag=LovePotion] run tag @s remove Init diff --git a/data/undeadm-m1/functions/potion/effect_clear_gravitation.mcfunction b/data/undeadm-m1/functions/potion/effect_clear_gravitation.mcfunction new file mode 100644 index 0000000..d46371f --- /dev/null +++ b/data/undeadm-m1/functions/potion/effect_clear_gravitation.mcfunction @@ -0,0 +1 @@ +tag @s remove InfernoPotionEffect diff --git a/data/undeadm-m1/functions/potion/effect_clear_inferno.mcfunction b/data/undeadm-m1/functions/potion/effect_clear_inferno.mcfunction new file mode 100644 index 0000000..12ec207 --- /dev/null +++ b/data/undeadm-m1/functions/potion/effect_clear_inferno.mcfunction @@ -0,0 +1 @@ +tag @s remove GravitationPotionEffect diff --git a/data/undeadm-m1/functions/potion/effect_clear_love.mcfunction b/data/undeadm-m1/functions/potion/effect_clear_love.mcfunction new file mode 100644 index 0000000..45cb601 --- /dev/null +++ b/data/undeadm-m1/functions/potion/effect_clear_love.mcfunction @@ -0,0 +1 @@ +tag @s remove LovePotionEffect diff --git a/data/undeadm-m1/functions/potion/effect_do_gravitation.mcfunction b/data/undeadm-m1/functions/potion/effect_do_gravitation.mcfunction new file mode 100644 index 0000000..4c60257 --- /dev/null +++ b/data/undeadm-m1/functions/potion/effect_do_gravitation.mcfunction @@ -0,0 +1,17 @@ +tellraw @a[scores={me-debugging=1..}] "undeadmaelys-m1:potion/effect_do_gravitation" + + +particle minecraft:dust 0.47058823 0.18433137 0.78039215 1 ~ ~1 ~ 0.30 0.5 0.30 0.5 1 force + +execute unless score @s me-core_shift matches 1.. run tag @s remove GravitySwitched +execute if score @s me-core_shift matches 1.. run scoreboard players add @s me-m1_stimer 1 +execute if score @s me-m1_stimer matches 1.. unless score @s me-core_shift matches 1.. run scoreboard players remove @s me-m1_stimer 1 +execute if score @s me-m1_stimer matches 5.. run tag @s[tag=!GravitySwitched] add GravitySwitch +execute if score @s me-m1_stimer matches 5.. run scoreboard players set @s me-m1_stimer 0 +execute if score @s me-m1_stimer matches 5.. run tag @s add GravitySwitched +execute if entity @s[tag=GravityReversed,tag=GravitySwitch] run function undeadm-m1:potion/effect_switch_gravitation +execute if entity @s[tag=GravitySwitch] run tag @s add GravityReversed +tag @s remove GravitySwitch + +execute as @s[tag=GravityReversed] run effect give @s[nbt={ActiveEffects:[{Id:28b}]}] minecraft:levitation 1 4 true +execute as @s[tag=GravityReversed] unless entity @s[nbt={ActiveEffects:[{Id:28b}]}] run effect give @s minecraft:levitation 1 12 true diff --git a/data/undeadm-m1/functions/potion/effect_do_inferno.mcfunction b/data/undeadm-m1/functions/potion/effect_do_inferno.mcfunction new file mode 100644 index 0000000..11261fd --- /dev/null +++ b/data/undeadm-m1/functions/potion/effect_do_inferno.mcfunction @@ -0,0 +1 @@ +particle minecraft:dust 1 0.43529411 0 1 ~ ~1 ~ 0.30 0.5 0.30 0.5 1 force diff --git a/data/undeadm-m1/functions/potion/effect_do_love.mcfunction b/data/undeadm-m1/functions/potion/effect_do_love.mcfunction new file mode 100644 index 0000000..0e57f06 --- /dev/null +++ b/data/undeadm-m1/functions/potion/effect_do_love.mcfunction @@ -0,0 +1 @@ +particle minecraft:heart ~ ~2 ~ 0.3 0 0.3 0 1 diff --git a/data/undeadm-m1/functions/potion/effect_switch_gravitation.mcfunction b/data/undeadm-m1/functions/potion/effect_switch_gravitation.mcfunction new file mode 100644 index 0000000..3f85ed9 --- /dev/null +++ b/data/undeadm-m1/functions/potion/effect_switch_gravitation.mcfunction @@ -0,0 +1,3 @@ +tag @s remove GravityReversed +effect clear @s minecraft:levitation +tag @s remove GravitySwitch diff --git a/data/undeadm-m1/functions/potion/use_potion_gravitation.mcfunction b/data/undeadm-m1/functions/potion/use_potion_gravitation.mcfunction new file mode 100644 index 0000000..e107ec8 --- /dev/null +++ b/data/undeadm-m1/functions/potion/use_potion_gravitation.mcfunction @@ -0,0 +1 @@ +tag @s add GravitationPotionEffect diff --git a/data/undeadm-m1/functions/potion/use_potion_inferno.mcfunction b/data/undeadm-m1/functions/potion/use_potion_inferno.mcfunction new file mode 100644 index 0000000..ea82ee3 --- /dev/null +++ b/data/undeadm-m1/functions/potion/use_potion_inferno.mcfunction @@ -0,0 +1 @@ +tag @s add InfernoPotionEffect diff --git a/data/undeadm-m1/functions/potion/use_potion_love.mcfunction b/data/undeadm-m1/functions/potion/use_potion_love.mcfunction new file mode 100644 index 0000000..570e98f --- /dev/null +++ b/data/undeadm-m1/functions/potion/use_potion_love.mcfunction @@ -0,0 +1,2 @@ +tag @e[distance=..3,type=!#undeadm-core:potion_unaffected,tag=!Potion] add LovePotionEffect +tag @a[distance=..3,gamemode=!spectator] add LovePotionEffect diff --git a/data/undeadm-m1/functions/potions.mcfunction b/data/undeadm-m1/functions/potions.mcfunction new file mode 100644 index 0000000..cb3ca77 --- /dev/null +++ b/data/undeadm-m1/functions/potions.mcfunction @@ -0,0 +1,71 @@ +tellraw @a[scores={me-debugging=1..}] "undeadmaelys-m1:potions" + +## KNOWN BUGS: +# fake thrown potions (love, stink) assignation fails if assignation has dead assigners (i.e. it start at 1 instead of 0, -- cos potion 0 already died but potion 1 didnt, so summoning another will cause the new potion to also share id 1 with the already existing potion D:) maybe change the count custom to make it get the highest id? + +# count potions to manage new! +function undeadm-m1:potion/_count_custom_potions +# 1 Gender Change Potion 2101 +execute as @a if score @s me-core_drinkM matches 1 at @s run function undeadm-m1:potion/_clear_effects +# 2 Gravitation Potion 2102 +# "Press SHIFT to reverse gravity" + +# who drinks potion receives effect +execute as @e[nbt={SelectedItem:{tag:{CustomModelData:2102}}}] if score @s me-core_drinkP matches 1 run function undeadm-m1:potion/use_potion_gravitation + +# do the effect for the effect carriers +execute as @e[tag=GravitationPotionEffect] at @s run function undeadm-m1:potion/effect_do_gravitation + +# 3 Inferno Potion 2103 +# "Nearby enemies are ignited" + +# who drinks potion receives effect +execute as @e[nbt={SelectedItem:{tag:{CustomModelData:2103}}}] if score @s me-core_drinkP matches 1 run function undeadm-m1:potion/use_potion_inferno + +# do the effect for the effect carriers +execute as @e[tag=InfernoPotionEffect] at @s run function undeadm-m1:potion/effect_do_inferno + + +# 4 Ironskin Potion 2104 +# "Increase defense by 2" + + +# 5 Lifeforce Potion 2105 +# "20% increased maximum health" + + +# 6 Love Potion 2106 +# "Throw this to make someone fall in love" + +# if a potion is thrown, create and assign a scoreboard that will propagate the custom effect +#data merge entity @s {Item:{tag:{Assigned:1b}}} +execute as @e[type=minecraft:potion,nbt={Item:{tag:{CustomModelData:2106}}}] unless entity @s[nbt={Item:{tag:{Assigned:1b}}}] run function undeadm-m1:potion/assign_potion_love +# tp potion armor stand to its vanilla potion +execute as @e[tag=Potion,tag=LovePotion] at @s as @e[type=potion] if score @s me-core_uid = @e[limit=1,sort=nearest,type=minecraft:armor_stand,tag=LovePotion] me-core_uid run tp @e[limit=1,sort=nearest,type=minecraft:armor_stand,tag=LovePotion] @s +#if potion crashes on ground, grant potion effect @e[distance=..2] +execute as @e[tag=LovePotion,type=minecraft:armor_stand] unless entity @s[nbt={OnGround:1b}] at @s run function undeadm-m1:potion/use_potion_love +#kill armor stand as potion crashed +execute as @e[tag=Potion,type=minecraft:armor_stand,nbt={OnGround:0b}] unless entity @s[nbt={OnGround:1b}] run kill @s +# do the effect for the effect carriers +execute as @e[tag=LovePotionEffect] at @s run function undeadm-m1:potion/effect_do_love + + +# 7 Recall Potion 2107 +# "Teleports you home" + + +# 8 Return Potion 2108 +# "This teleports you home and creates a portal" +# "Use portal to return when you are done" +# "'Good for one round trip!'" + + +# 9 Stink Potion 2109 +# "Throw this to make someone smell terrible" + +#10 Teleport Potion 2110 +# "Teleports you to a random location" + + +#11 Water Walking Potion 2111 +# "Press SHIFT to enter water" diff --git a/data/undeadm-m1/functions/tick.mcfunction b/data/undeadm-m1/functions/tick.mcfunction index ba10b45..566d87d 100644 --- a/data/undeadm-m1/functions/tick.mcfunction +++ b/data/undeadm-m1/functions/tick.mcfunction @@ -17,3 +17,6 @@ execute as @e[tag=FireBlast] at @s run function undeadm-m1:entity/tick/fire_blas # draw badass fire around the fire blast mager execute as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{CustomModelData:2202}}}] if entity @s[nbt={OnGround:1b}] at @s run function undeadm-m1:fire_blast_figure + +# do potions +function undeadm-m1:potions diff --git a/data/undeadm-m1/item_modifiers/example.json b/data/undeadm-m1/item_modifiers/example.json new file mode 100644 index 0000000..f9e8c0c --- /dev/null +++ b/data/undeadm-m1/item_modifiers/example.json @@ -0,0 +1,6 @@ +[ + { + "function": "minecraft:set_nbt", + "tag": "{uwu:1}" + } +]