Skip to content
This repository has been archived by the owner on Aug 28, 2022. It is now read-only.

Commit

Permalink
Update v1.3.0
Browse files Browse the repository at this point in the history
Added:
- Easy setting of the probability of transforming
- Datapack icon
- Debug mode

Changed:
- Performance improvements
- Better compatibility with other datapacks
- Other version numbers system
- Completely new and Better code

Removed:
- Compatibility with older minecraft versions
  • Loading branch information
2mal3 committed Jan 24, 2021
1 parent c9ee580 commit b6d5627
Show file tree
Hide file tree
Showing 61 changed files with 349 additions and 520 deletions.
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Advanced Monsters Datapack v1.6.10
Compatibility: Multiplayer 1.14+
# Advanced Monsters Datapack v1.3.0
Compatibility: Multiplayer 1.16+

With the Advanced Monsters Datapack v1.6.10 by 2mal3 there is a chance (usually 10%) that a monster will become an Advanced Monster. This monster has 50% more life, does 50% more damage, is 10% faster and sees players 10% longer.
This datapack adds the chance for normal monsters to become advanced monsters. These monsters are faster, stronger and have more lives, so the game becomes a bit more difficult.
That is all.

The chance can be changed under data > amd > loot_tables > random.json by changing the second number. The probability then results from 1 / The specified number.
### Settings:
The command: `scoreboard players set $admo.transform_chance admo.data <number>` can be used to set the probability of spawning the advanced monsters.
The probability is calculated with **1 / the set number**. Example: If you set as the number 20 the probability is 5% (1/20=0.05=5%).
If the number is 1, every monster is advanced.
If the number is 0, no monster is advanced.

***

### Installation:
- Download the file.
- Move the folder in the file to a datapack folder in a world of your choice.
### Exact information about advanced monsters:
- 70% more damage
- 50% more life
- 20% faster attacks
- 30% larger range
- 20% faster

### Uninstall:
- Enter `/function #amd:uninstall`
- Confirm that you want to uninstall
- Optional: Delete the datapack from the folder
***
104 changes: 104 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

Update v1.3.0 (24.1.2021)

Added:
- Easy setting of the probability of transforming
- Datapack icon
- Debug mode

Changed:
- Performance improvements
- Better compatibility with other datapacks
- Other version numbers system
- Completely new and Better code

Removed:
- Compatibility with older minecraft versions

----------------------------------------------------------------

Update v1.2.1 (28.8.2020)

Changed:
- Small code optimizations
- Better compatibility with other datapacks

----------------------------------------------------------------

Update v1.2.0 (24.7.2020)

Added:
- Support for the minecraft versions 1.14.X, 1.15.X, 1.16.1, 1.16.2

Changed:
- Better compatibility with other datapacks

Removed:
- Name tag visibility of Advanced Monsters
- Translation with my Language Pack

----------------------------------------------------------------

Update v1.1.6 (21.6.2020)

Changed:
- Better performance
- Better reload message

----------------------------------------------------------------

Update v1.1.5 (18.6.2020)

Changed:
- Install and uninstall translation
- Better uninstall

----------------------------------------------------------------

Update v1.1.4 (15.5.2020)

Changed:
- Better info system
- Better uninstall

----------------------------------------------------------------

Update v1.1.3 (17.4.2020)

Changed:
- Better code
- More language support

Bug fixes:
- I do not know

----------------------------------------------------------------

Update v1.1.2 (10.4.2020)

Changed:
- More language support
- Revision of the entire information system

----------------------------------------------------------------

Update v1.1.1 (9.4.2020)

Changed:
- More language support

----------------------------------------------------------------

Update v1.1.0 (5.4.2020)

Added:
- Language support for Spanish, German and French with my Language Pack

----------------------------------------------------------------

Update v1.0.1 (5.4.2020)

Bug fixes:
- I do not know

----------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"display": {
"title": "Advanced Monsters v1.6.10",
"description": "With the Advanced Monsters Datapack v1.6.10 by 2mal3 there is a chance that a monster will become an Advanced Monster. This monster is much stronger and harder to defeat.",
"title": "Advanced Monsters v1.3.0",
"description": "Adds advanced monsters that spawn with a certain probability.",
"icon": {
"item": "minecraft:zombie_head"
},
Expand All @@ -14,4 +14,4 @@
"trigger": "minecraft:tick"
}
}
}
}
15 changes: 15 additions & 0 deletions data/2mal3/functions/admo/core/first_run.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Description: One-time commands at the first start of the datapack
# Called from function: 2mal3:admo/core/reload
# Datapack by 2mal3

# Output debug message in chat, if enabled (INFO)
tellraw @a[scores={admo.debug_mode=3..}] [{"text":"[","color":"gray"},{"text":"AdvancedMonsters","color":"green"},{"text":"/","color":"gray"},{"text":"INFO","color":"green"},{"text":"]: ","color":"gray"},{"text":"Datapack installed!","color":"green"}]

# Start config
scoreboard players set $admo.transform_chance admo.data 10

# Remembers that the Datapack was installed
scoreboard players set $admo.first_run admo.data 1

# Sends installation message
tellraw @a [{"text":"Advanced Monsters Datapack v1.3.0 by 2mal3 was installed!","color":"blue"}]
20 changes: 20 additions & 0 deletions data/2mal3/functions/admo/core/reload.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Description: Commands when reloading the datapack
# Called from tag: minecraft:reaload
# Datapack by 2mal3

# Output debug message in chat, if enabled (INFO)
tellraw @a[scores={admo.debug_mode=3..}] [{"text":"[","color":"gray"},{"text":"AdvancedMonsters","color":"green"},{"text":"/","color":"gray"},{"text":"INFO","color":"green"},{"text":"]: ","color":"gray"},{"text":"Datapack reloaded!","color":"green"}]


# Adds scoreboards
scoreboard objectives add admo.data dummy
scoreboard objectives add admo.debug_mode dummy

# Set the version in format: xx.xx.xx
scoreboard players set $admo.version admo.data 010300

# Executes the installation when the datapack is started for the first time
execute unless score $admo.first_run admo.data matches 1 run schedule function 2mal3:admo/core/first_run 4s

# Starts the loops
function 2mal3:admo/core/second
9 changes: 9 additions & 0 deletions data/2mal3/functions/admo/core/second.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Description: Main loop every second
# Called from functions: 2mal3:admo/core/reload, 2mal3:admo/core/second
# Datapack by 2mal3

# Try to transform all new monsters
execute as @e[type=#2mal3:admo/monsters,tag=!admo.processed,tag=!global.ignore] at @s run function 2mal3:admo/tray_transforming

# Calls the function in the next second
schedule function 2mal3:admo/core/second 1s
24 changes: 24 additions & 0 deletions data/2mal3/functions/admo/core/uninstall/uninstall.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Description: Uninstalls the Datapack
# Called from function: core/uninstall/uninstall_ask
# Datapack by 2mal3

# Output debug message in chat, if enabled (INFO)
tellraw @a[scores={admo.debug_mode=3..}] [{"text":"[","color":"gray"},{"text":"AdvancedMonsters","color":"green"},{"text":"/","color":"gray"},{"text":"INFO","color":"green"},{"text":"]: ","color":"gray"},{"text":"Datapack uninstalled!","color":"green"}]


# Stops the loops
schedule clear 2mal3:admo/core/second

# Deletes the scoreboards
scoreboard objectives remove admo.data
scoreboard objectives remove admo.debug_mode

# Uninstall librarys
function 2mal3:random/uninstall

# Sends an uninstallation message to all players
tellraw @a [{"text":"Advanced Monsters Datapack v1.3.0 by 2mal3 was successfully uninstalled."}]

# Disables the datapack
datapack disable "file/Advanced-Monsters-Datapack-v1.3.0"
datapack disable "file/Advanced-Monsters-Datapack-v1.3.0.zip"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Description: Ask the player if he really wants to uninstall the datapack
# Called from tag: 2mal3:admo/uninstall
# Datapack by 2mal3

tellraw @s [{"text":"Do you really want to deinstall the <name> Datapack by 2mal3?","color":"red"},{"text":"\n"},{"text":"[No]","color":"dark_green","hoverEvent":{"action":"show_text","value":"*click*"}},{"text":"\u0020"},{"text":"[Yes]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function 2mal3:admo/core/uninstall/uninstall"},"hoverEvent":{"action":"show_text","value":"*click*"}}]
34 changes: 34 additions & 0 deletions data/2mal3/functions/admo/transform.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Description: Transforms a monster
# Called from functions: 2mal3:admo/tray_transforming
# Datapack by 2mal3

# Output debug message in chat, if enabled (DEBUG)
tellraw @a[scores={admo.debug_mode=4..}] [{"text":"[","color":"gray"},{"text":"AdvancedMonsters","color":"aqua"},{"text":"/","color":"gray"},{"text":"DEBUG","color":"aqua"},{"text":"]: ","color":"gray"},{"text":"Transformed ","color":"aqua"},{"selector":"@s","color":"aqua"},{"text":"!","color":"aqua"}]


# Sets the name of the monster
tag @s add admo.this
setblock ~ ~ ~ oak_sign{Text1:'[{"text":"Advanced: ","color":"red"},{"selector":"@e[tag=admo.this,sort=nearest,limit=1]","color":"white"}]'}
data modify entity @s CustomName set from block ~ ~ ~ Text1

setblock ~ ~ ~ minecraft:air
tag @s remove admo.this


# Make the monster stronger
attribute @s generic.attack_damage modifier add f50dfa13-c51b-414e-b068-36437a86b406 "admo.attack_damage" 0.7 multiply
attribute @s generic.max_health modifier add 5312c08e-69d3-4798-90b5-d008f9d8b4b3 "admo.max_health" 0.5 multiply

attribute @s generic.attack_speed modifier add 6219720a-e6fd-421c-b988-5000816e9109 "admo.attack_speed" 0.2 multiply
attribute @s generic.follow_range modifier add addb878b-b2dc-4307-b04e-f6838ecfb44f "admo.follow_range" 0.3 multiply
attribute @s generic.movement_speed modifier add 9e42d73c-9479-47a6-85a6-e3ac6a42b450 "admo.movement_speed" 0.2 multiply


# Heal the monster
effect give @s[type=#2mal3:admo/undead] minecraft:instant_damage 1 100 true
effect give @s[type=!#2mal3:admo/undead] minecraft:instant_health 1 100 true


# Improves special abilities of the monster
execute if entity @s[type=minecraft:creeper] run data modify entity @s ExplosionRadius set value 6b
execute if entity @s[type=#2mal3:admo/bow] run enchant @s minecraft:power 2
18 changes: 18 additions & 0 deletions data/2mal3/functions/admo/tray_transforming.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Description: Transforms with a certain chance the monster
# Called from functions: 2mal3:admo/core/second
# Datapack by 2mal3

# Output debug message in chat, if enabled (DEBUG)
tellraw @a[scores={admo.debug_mode=4..}] [{"text":"[","color":"gray"},{"text":"AdvancedMonsters","color":"aqua"},{"text":"/","color":"gray"},{"text":"DEBUG","color":"aqua"},{"text":"]: ","color":"gray"},{"text":"Try to transform ","color":"aqua"},{"selector":"@s","color":"aqua"},{"text":" ...","color":"aqua"}]


# Transforms with a certain chance the monster
scoreboard players set $2mal3.random.in_0 2mal3.random 0
scoreboard players operation $2mal3.random.in_1 2mal3.random = $admo.transform_chance admo.data
function 2mal3:random/random

execute if score $2mal3.random.out_0 2mal3.random matches 0 run function 2mal3:admo/transform


# Notes that this monster was processed
tag @s add admo.processed
24 changes: 24 additions & 0 deletions data/2mal3/functions/random/random.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Description: Generates a random number
# Called by: ...
# Datapack library by 2mal3

# prepare
forceload add 0 0
summon area_effect_cloud 0 0 0 {Tags:["2mal3.random"]}


# generate
execute store result score $2mal3.random.temp_0 2mal3.random run data get entity @e[type=minecraft:area_effect_cloud,tag=2mal3.random,limit=1] UUID[0]

scoreboard players operation $2mal3.random.temp_1 2mal3.random = $2mal3.random.in_1 2mal3.random
scoreboard players operation $2mal3.random.temp_1 2mal3.random -= $2mal3.random.in_0 2mal3.random

scoreboard players operation $2mal3.random.temp_0 2mal3.random %= $2mal3.random.temp_1 2mal3.random
scoreboard players operation $2mal3.random.temp_0 2mal3.random += $2mal3.random.in_0 2mal3.random

scoreboard players operation $2mal3.random.out_0 2mal3.random = $2mal3.random.temp_0 2mal3.random


# remve
kill @e[type=minecraft:area_effect_cloud,tag=2mal3.random]
forceload remove 0 0
15 changes: 15 additions & 0 deletions data/2mal3/functions/random/reload.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Description: Init the datapack library
# Called by: ...
# Datapack library by 2mal3

# add scoreboards
scoreboard objectives add 2mal3.random dummy

# set variables
scoreboard players set $2mal3.random.in_0 2mal3.random 0
scoreboard players set $2mal3.random.in_1 2mal3.random 0

scoreboard players set $2mal3.random.temp_0 2mal3.random 0
scoreboard players set $2mal3.random.temp_1 2mal3.random 0

scoreboard players set $2mal3.random.out_0 2mal3.random 0
6 changes: 6 additions & 0 deletions data/2mal3/functions/random/uninstall.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Description: Uninstall the datapack library
# Called by: ...
# Datapack library by 2mal3

# remove scoreboards
scoreboard objectives remove 2mal3.random
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"replace": false,
"values": [
"minecraft:skeleton",
"minecraft:stray",
"minecraft:pillager"
]
}
{
"replace": false,
"values": [
"minecraft:skeleton",
"minecraft:stray"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"replace": false,
"values": [
"#2mal3:admo/bow",

"minecraft:blaze",
"minecraft:cave_spider",
"minecraft:creeper",
Expand All @@ -17,10 +19,8 @@
"minecraft:ravager",
"minecraft:shulker",
"minecraft:silverfish",
"minecraft:skeleton",
"minecraft:slime",
"minecraft:spider",
"minecraft:stray",
"minecraft:vex",
"minecraft:vindicator",
"minecraft:wither_skeleton",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"replace": false,
"values": [
"#2mal3:admo/bow",

"minecraft:drowned",
"minecraft:husk",
"minecraft:phantom",
"minecraft:skeleton",
"minecraft:stray",
"minecraft:wither_skeleton",
"minecraft:zombie",
"minecraft:zombie_villager",
Expand Down
5 changes: 5 additions & 0 deletions data/2mal3/tags/functions/admo/uninstall.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"2mal3:admo/core/uninstall/uninstall_ask"
]
}
Loading

0 comments on commit b6d5627

Please sign in to comment.