Merged project "Townplan" to Minecraft Expanded as the 2nd Module of the pack!

Current features: Randomized villager names, Armorer trade phrases, 
translation-friendly (check the lang files on the resourcepakc!)

Planned features: Town names, town title upon village entry, all trade 
phrases.

Mayhappen features: Friendship system, compatibility with m1

Language support planned to EN_us, ES_es & CA_es
This commit is contained in:
Undeadmaelys 2021-02-28 09:47:34 +01:00
parent 4c63e1c6a0
commit e1cadf3f2e
40 changed files with 530 additions and 1 deletions

View File

@ -6,9 +6,15 @@ data modify storage undeadm-core:init status set value 1
# try to init other modules # try to init other modules
# random lib calls
function undeadm-random:init
#weapons mod #weapons mod
function undeadm-m1:init function undeadm-m1:init
#villager mod
function undeadm-m2:init
### core module ### core module
## core system ## core system
@ -32,6 +38,7 @@ function undeadm-m1:init
scoreboard objectives add me-core_drinkM minecraft.used:minecraft.milk_bucket scoreboard objectives add me-core_drinkM minecraft.used:minecraft.milk_bucket
scoreboard objectives add me-core_rc minecraft.used:minecraft.carrot_on_a_stick scoreboard objectives add me-core_rc minecraft.used:minecraft.carrot_on_a_stick
scoreboard objectives add me-core_shift minecraft.custom:minecraft.sneak_time scoreboard objectives add me-core_shift minecraft.custom:minecraft.sneak_time
scoreboard objectives add me-core_talk minecraft.custom:minecraft.talked_to_villager
## custom entity trackers ## custom entity trackers

View File

@ -5,11 +5,14 @@ execute unless data storage undeadm-core:init {status:1} run function undeadm-co
## call other modules & optimization tick distribution ## call other modules & optimization tick distribution
# call weapon hsec every half a sec and for tick every tick # combat module calls
execute if score $current me-core_tickC matches 1 run function undeadm-m1:hsec execute if score $current me-core_tickC matches 1 run function undeadm-m1:hsec
execute if score $current me-core_tickC matches 11 run function undeadm-m1:hsec execute if score $current me-core_tickC matches 11 run function undeadm-m1:hsec
function undeadm-m1:tick function undeadm-m1:tick
# villager module calls
function undeadm-m2:tick
# manage assigners # manage assigners
execute if score $current me-core_tickC matches 10 run function undeadm-core:assigners execute if score $current me-core_tickC matches 10 run function undeadm-core:assigners

View File

@ -0,0 +1,22 @@
# generatecustom name
function undeadm-m2:villager_data/names
# assign city
execute at @s run function undeadm-m2:villager_data/get_city
# generating favourite mineral
function random:rand10
scoreboard players operation @s Vfav_mineral = $value rnd_random
# 1 coal
# 2 diamond
# 3 iron
# 4 copper
# 5 gold
# 6 netherite
# 7 amethyst
# 8 emerald
# 9 quartz
# 10 ruby
scoreboard players reset $value rnd_random
tag @s add generated

View File

@ -0,0 +1,6 @@
# generate custom name
function undeadm-m2:wandering_trader_data/names
# generating favourite mineral
scoreboard players reset $value rnd_random
tag @s add generated

View File

@ -0,0 +1,5 @@
# verbs
scoreboard objectives add me-m2_talkCD dummy
# keep time in check
scoreboard objectives add Vtime dummy

View File

@ -0,0 +1,15 @@
scoreboard players set @s me-core_talk 0
#
# select closest villager a block forward in the direction the player is lookin
## i might fight this later -- not now
execute positioned ^ ^ ^2.5 as @e[type=#undeadm-m2:talkable,limit=1,sort=nearest] unless score @s me-m2_talkCD matches 1.. run tag @s add talking
execute as @e[tag=talking] run scoreboard players set @s me-m2_talkCD 100
#execute as @e[tag=talking] run tellraw @a [{"text":"<"},{"selector":"@s"},{"text":"> Hello there"}]
# if havent talked in a while, salute!
execute as @e[tag=talking,type=minecraft:villager] run function undeadm-m2:villager_talk/salutation
execute as @e[tag=talking,type=minecraft:villager] run function undeadm-m2:villager_talk/interaction
execute as @e[tag=talking,type=minecraft:wandering_trader] run function undeadm-m2:wandering_trader_talk/salutation
execute as @e[tag=talking] run tag @s remove talking

View File

@ -0,0 +1,21 @@
#take over the game?
#recipe take @a *
#gamemode adventure @a
#get day time
execute store result score $time Vtime run time query daytime
scoreboard players operation $hour Vtime = $time Vtime
scoreboard players operation $hour Vtime /= $Dhour Vtime
scoreboard players add $hour Vtime 7
execute if score $hour Vtime matches 24.. run scoreboard players remove $hour Vtime 24
# try to generate new data if missing on new villager
execute as @e[type=minecraft:villager] unless entity @s[tag=generated] run function undeadm-m2:generate_villager
# try to generate ned data if missing on wandering trader
execute as @e[type=minecraft:wandering_trader] unless entity @s[tag=generated] run function undeadm-m2:generate_wandering_trader
# lower by tick villager's talk CD
execute as @e[type=#undeadm-m2:talkable,scores={me-m2_talkCD=1..}] run scoreboard players remove @s me-m2_talkCD 1
# verb: talk
execute as @a if score @s me-core_talk matches 1.. at @s anchored eyes run function undeadm-m2:talk

View File

@ -0,0 +1,7 @@
summon minecraft:armor_stand ~ ~ ~ {Marker:1b,Invisible:0,NoGravity:1,Tags:["CityChecker"]}
execute store result entity @e[tag=CityChecker,limit=1] Pos[0] double 1 run data get entity @s Brain.memories."minecraft:meeting_point".value.pos[0]
execute store result entity @e[tag=CityChecker,limit=1] Pos[1] double 1 run data get entity @s Brain.memories."minecraft:meeting_point".value.pos[1]
execute store result entity @e[tag=CityChecker,limit=1] Pos[2] double 1 run data get entity @s Brain.memories."minecraft:meeting_point".value.pos[2]
execute as @e[tag=CityChecker] at @s if entity @s[tag=CityCenter,distance=..10] run kill @s
execute as @e[tag=CityChecker] at @s run summon minecraft:armor_stand ~ ~ ~ {Marker:1b,Invisible:0,NoGravity:1,Tags:["CityCenter"]}
execute as @e[tag=CityChecker] run kill @s

View File

@ -0,0 +1,106 @@
# make name visible
data merge entity @s {CustomNameVisible:1}
# names :D
function undeadm-random:rand100
execute if score $value rnd_random matches 0 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.0"}'}
execute if score $value rnd_random matches 1 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.1"}'}
execute if score $value rnd_random matches 2 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.2"}'}
execute if score $value rnd_random matches 3 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.3"}'}
execute if score $value rnd_random matches 4 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.4"}'}
execute if score $value rnd_random matches 5 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.5"}'}
execute if score $value rnd_random matches 6 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.6"}'}
execute if score $value rnd_random matches 7 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.7"}'}
execute if score $value rnd_random matches 8 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.8"}'}
execute if score $value rnd_random matches 9 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.9"}'}
execute if score $value rnd_random matches 10 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.10"}'}
execute if score $value rnd_random matches 11 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.11"}'}
execute if score $value rnd_random matches 12 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.12"}'}
execute if score $value rnd_random matches 13 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.13"}'}
execute if score $value rnd_random matches 14 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.14"}'}
execute if score $value rnd_random matches 15 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.15"}'}
execute if score $value rnd_random matches 16 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.16"}'}
execute if score $value rnd_random matches 17 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.17"}'}
execute if score $value rnd_random matches 18 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.18"}'}
execute if score $value rnd_random matches 19 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.19"}'}
execute if score $value rnd_random matches 20 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.20"}'}
execute if score $value rnd_random matches 21 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.21"}'}
execute if score $value rnd_random matches 22 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.22"}'}
execute if score $value rnd_random matches 23 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.23"}'}
execute if score $value rnd_random matches 24 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.24"}'}
execute if score $value rnd_random matches 25 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.25"}'}
execute if score $value rnd_random matches 26 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.26"}'}
execute if score $value rnd_random matches 27 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.27"}'}
execute if score $value rnd_random matches 28 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.28"}'}
execute if score $value rnd_random matches 29 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.29"}'}
execute if score $value rnd_random matches 30 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.30"}'}
execute if score $value rnd_random matches 31 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.31"}'}
execute if score $value rnd_random matches 32 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.32"}'}
execute if score $value rnd_random matches 33 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.33"}'}
execute if score $value rnd_random matches 34 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.34"}'}
execute if score $value rnd_random matches 35 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.35"}'}
execute if score $value rnd_random matches 36 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.36"}'}
execute if score $value rnd_random matches 37 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.37"}'}
execute if score $value rnd_random matches 38 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.38"}'}
execute if score $value rnd_random matches 39 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.39"}'}
execute if score $value rnd_random matches 40 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.40"}'}
execute if score $value rnd_random matches 41 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.41"}'}
execute if score $value rnd_random matches 42 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.42"}'}
execute if score $value rnd_random matches 43 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.43"}'}
execute if score $value rnd_random matches 44 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.44"}'}
execute if score $value rnd_random matches 45 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.45"}'}
execute if score $value rnd_random matches 46 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.46"}'}
execute if score $value rnd_random matches 47 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.47"}'}
execute if score $value rnd_random matches 48 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.48"}'}
execute if score $value rnd_random matches 49 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.49"}'}
execute if score $value rnd_random matches 50 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.50"}'}
execute if score $value rnd_random matches 51 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.51"}'}
execute if score $value rnd_random matches 52 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.52"}'}
execute if score $value rnd_random matches 53 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.53"}'}
execute if score $value rnd_random matches 54 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.54"}'}
execute if score $value rnd_random matches 55 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.55"}'}
execute if score $value rnd_random matches 56 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.56"}'}
execute if score $value rnd_random matches 57 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.57"}'}
execute if score $value rnd_random matches 58 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.58"}'}
execute if score $value rnd_random matches 59 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.59"}'}
execute if score $value rnd_random matches 60 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.60"}'}
execute if score $value rnd_random matches 61 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.61"}'}
execute if score $value rnd_random matches 62 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.62"}'}
execute if score $value rnd_random matches 63 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.63"}'}
execute if score $value rnd_random matches 64 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.64"}'}
execute if score $value rnd_random matches 65 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.65"}'}
execute if score $value rnd_random matches 66 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.66"}'}
execute if score $value rnd_random matches 67 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.67"}'}
execute if score $value rnd_random matches 68 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.68"}'}
execute if score $value rnd_random matches 69 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.69"}'}
execute if score $value rnd_random matches 70 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.70"}'}
execute if score $value rnd_random matches 71 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.71"}'}
execute if score $value rnd_random matches 72 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.72"}'}
execute if score $value rnd_random matches 73 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.73"}'}
execute if score $value rnd_random matches 74 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.74"}'}
execute if score $value rnd_random matches 75 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.75"}'}
execute if score $value rnd_random matches 76 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.76"}'}
execute if score $value rnd_random matches 77 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.77"}'}
execute if score $value rnd_random matches 78 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.78"}'}
execute if score $value rnd_random matches 79 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.79"}'}
execute if score $value rnd_random matches 80 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.80"}'}
execute if score $value rnd_random matches 81 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.81"}'}
execute if score $value rnd_random matches 82 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.82"}'}
execute if score $value rnd_random matches 83 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.83"}'}
execute if score $value rnd_random matches 84 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.84"}'}
execute if score $value rnd_random matches 85 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.85"}'}
execute if score $value rnd_random matches 86 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.86"}'}
execute if score $value rnd_random matches 87 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.87"}'}
execute if score $value rnd_random matches 88 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.88"}'}
execute if score $value rnd_random matches 89 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.89"}'}
execute if score $value rnd_random matches 90 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.90"}'}
execute if score $value rnd_random matches 91 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.91"}'}
execute if score $value rnd_random matches 92 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.92"}'}
execute if score $value rnd_random matches 93 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.93"}'}
execute if score $value rnd_random matches 94 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.94"}'}
execute if score $value rnd_random matches 95 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.95"}'}
execute if score $value rnd_random matches 96 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.96"}'}
execute if score $value rnd_random matches 97 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.97"}'}
execute if score $value rnd_random matches 98 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.98"}'}
execute if score $value rnd_random matches 99 run data merge entity @s {CustomName:'{"translate":"entity.villager.name.99"}'}
scoreboard players reset $value rnd_random

View File

@ -0,0 +1,45 @@
# PRE SNAPSHOT
function undeadm-m2:villager_talk/by_profession/interaction/armorer_trades
# 0 - buy coal
execute if score $value rnd_random matches 0 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.0"}]
# 1 - buy iron ingot
execute if score $value rnd_random matches 1 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.1"}]
# 2 BUY DIAMOND
# BEFORE selling diamond armor
execute if score $value rnd_random matches 2 if entity @s[nbt={VillagerData:{level:3}}] run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.2a"}]
# AFTER selling some diamond armor
execute if score $value rnd_random matches 2 if entity @s[nbt={VillagerData:{level:4}}] run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.2b"}]
# AFTER selling all diamond armor
execute if score $value rnd_random matches 2 if entity @s[nbt={VillagerData:{level:5}}] run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.2c"}]
# 3 - buy lava bucket
execute if score $value rnd_random matches 3 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.3"}]
# 4 - sell bell
execute if score $value rnd_random matches 4 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.4"}]
# 5 - sell shield
execute if score $value rnd_random matches 5 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.5"}]
# 6 - sell iron helmet
execute if score $value rnd_random matches 6 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.6"}]
# 7 - sell iron chestplate
execute if score $value rnd_random matches 7 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.7"}]
# 8 - sell iron leggings
execute if score $value rnd_random matches 8 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.8"}]
# 9 - sell iron boots
execute if score $value rnd_random matches 9 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.9"}]
# 10 - sell chainmail helmet
execute if score $value rnd_random matches 10 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.10"}]
# 11 - sell chainmail chestplate
execute if score $value rnd_random matches 11 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.11"}]
# 12 - sell chainmail leggings
execute if score $value rnd_random matches 12 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.12"}]
# 13 - sell chainmail boots
execute if score $value rnd_random matches 13 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.13"}]
# 14 - sell diamond helmet
execute if score $value rnd_random matches 14 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.14"}]
# 15 - sell diamond chestplate
execute if score $value rnd_random matches 15 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.15"}]
# 16 - sell diamond leggings
execute if score $value rnd_random matches 16 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> "},{"translate":"entity.villager.talk.armorer.16"}]
# 17 - sell diamond boots
execute if score $value rnd_random matches 17 run tellraw @a[distance=..16] [{"text":"<"},{"selector":"@s"},{"text":"> ."},{"translate":"entity.villager.talk.armorer.17"}]

View File

@ -0,0 +1,63 @@
# ARMORER TRADES
scoreboard players set $value rnd_random 0
# PRE SNAPSHOT
# 0 - buy coal
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:coal"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["RandomTrade"]}
# 1 - but iron ingot
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:iron_ingot"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["RandomTrade"]}
# 2 - buy diamond
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:diamond"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["RandomTrade"]}
# 3 - buy lava bucket
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:lava_bucket"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["RandomTrade"]}
# 4 - sell bell
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:bell"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["RandomTrade"]}
# 5 - sell shield
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:shield"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:5,Tags:["RandomTrade"]}
# 6 - sell iron helmet
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:iron_helmet"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:6,Tags:["RandomTrade"]}
# 7 - sell iron chestplate
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:iron_chestplate"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:7,Tags:["RandomTrade"]}
# 8 - sell iron leggings
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:iron_leggings"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:8,Tags:["RandomTrade"]}
# 9 - sell iron boots
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:iron_boots"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:9,Tags:["RandomTrade"]}
# 10 - sell chainmail helmet
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:chainmail_helmet"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:10,Tags:["RandomTrade"]}
# 11 - sell chainmail chestplate
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:chainmail_chestplate"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:11,Tags:["RandomTrade"]}
# 12 - sell chainmail leggings
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:chainmail_leggings"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:12,Tags:["RandomTrade"]}
# 13 - sell chainmail boots
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:chainmail_boots"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:13,Tags:["RandomTrade"]}
# 14 - sell diamond helmet
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:diamond_helmet"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:14,Tags:["RandomTrade"]}
# 15 - sell diamond chestplate
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:diamond_chestplate"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:15,Tags:["RandomTrade"]}
# 16 - sell diamond leggings
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:diamond_leggings"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:16,Tags:["RandomTrade"]}
# 17 - sell diamond boots
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:diamond_boots"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:17,Tags:["RandomTrade"]}
# pick random trade
execute store result score $value rnd_random as @e[tag=RandomTrade,limit=1,sort=random] run data get entity @s DisabledSlots
# kill trades
kill @e[tag=RandomTrade]

View File

@ -0,0 +1,11 @@
# 0 - buy raw chicken
# 1 - buy raw porkchop
# 2 - buy raw rabbit
# 3 - buy coal
# 4 - buy raw mutton
# 5 - buy raw beef
# 6 - buy dried kelp block
# 7 - buy sweet berries
# 8 - sell rabbit stew
# 9 - sell cooked porkchop
# 10 - sell cooked chicken

View File

@ -0,0 +1,42 @@
# ARMORER TRADES
scoreboard players set $value rnd_random 0
# PRE SNAPSHOT
# 0 - buy raw chicken
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:raw_chicken"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["RandomTrade"]}
# 1 - buy raw porkchop
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:raw_porkchop"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["RandomTrade"]}
# 2 - buy raw rabbit
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:raw_rabbit"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["RandomTrade"]}
# 3 - buy coal
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:coal"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["RandomTrade"]}
# 4 - buy raw mutton
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:raw_mutton"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["RandomTrade"]}
# 5 - buy raw beef
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:raw_beef"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:5,Tags:["RandomTrade"]}
# 6 - buy dried kelp block
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:dried_kelp_block"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:6,Tags:["RandomTrade"]}
# 7 - buy sweet berries
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:sweet_berries"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:7,Tags:["RandomTrade"]}
# 8 - sell rabbit stew
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:rabbit_stew"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:8,Tags:["RandomTrade"]}
# 9 - sell cooked porkchop
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:cooked_porkchop"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:9,Tags:["RandomTrade"]}
# 10 - sell cooked chicken
execute if data entity @s Offers.Recipes[{sell:{id:"minecraft:cooked_chicken"}}] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:10,Tags:["RandomTrade"]}
# pick random trade
execute store result score $value rnd_random as @e[tag=RandomTrade,limit=1,sort=random] run data get entity @s DisabledSlots
# kill trades
kill @e[tag=RandomTrade]

View File

@ -0,0 +1 @@
execute if data entity @s Offers.Recipes[{buy:{id:"minecraft:rotten_flesh"}}] run tellraw @a[distance=..16] [{"text":" <"},{"selector":"@s"},{"text":"> Can you slay a few zombies for me? I'll pay you."}]

View File

@ -0,0 +1,15 @@
execute as @s[nbt={VillagerData:{profession:"minecraft:armorer"}}] run function undeadm-m2:villager_talk/by_profession/interaction/armorer
execute as @s[nbt={VillagerData:{profession:"minecraft:butcher"}}] run function undeadm-m2:villager_talk/by_profession/interaction/butcher
execute as @s[nbt={VillagerData:{profession:"minecraft:cartographer"}}] run function undeadm-m2:villager_talk/by_profession/interaction/cartographer
execute as @s[nbt={VillagerData:{profession:"minecraft:cleric"}}] run function undeadm-m2:villager_talk/by_profession/interaction/cleric
execute as @s[nbt={VillagerData:{profession:"minecraft:farmer"}}] run function undeadm-m2:villager_talk/by_profession/interaction/farmer
execute as @s[nbt={VillagerData:{profession:"minecraft:fisherman"}}] run function undeadm-m2:villager_talk/by_profession/interaction/fisherman
execute as @s[nbt={VillagerData:{profession:"minecraft:fletcher"}}] run function undeadm-m2:villager_talk/by_profession/interaction/fletcher
execute as @s[nbt={VillagerData:{profession:"minecraft:leatherworker"}}] run function undeadm-m2:villager_talk/by_profession/interaction/leatherworker
execute as @s[nbt={VillagerData:{profession:"minecraft:librarian"}}] run function undeadm-m2:villager_talk/by_profession/interaction/librarian
execute as @s[nbt={VillagerData:{profession:"minecraft:none"}}] run function undeadm-m2:villager_talk/by_profession/interaction/none
execute as @s[nbt={VillagerData:{profession:"minecraft:nitwit"}}] run function undeadm-m2:villager_talk/by_profession/interaction/nitwit
execute as @s[nbt={VillagerData:{profession:"minecraft:mason"}}] run function undeadm-m2:villager_talk/by_profession/interaction/mason
execute as @s[nbt={VillagerData:{profession:"minecraft:shepherd"}}] run function undeadm-m2:villager_talk/by_profession/interaction/shepherd
execute as @s[nbt={VillagerData:{profession:"minecraft:toolsmith"}}] run function undeadm-m2:villager_talk/by_profession/interaction/toolsmith
execute as @s[nbt={VillagerData:{profession:"minecraft:weaponsmith"}}] run function undeadm-m2:villager_talk/by_profession/interaction/weaponsmith

View File

@ -0,0 +1,15 @@
execute as @s[nbt={VillagerData:{profession:"minecraft:armorer"}}] run function undeadm-m2:villager_talk/by_profession/salutation/armorer
execute as @s[nbt={VillagerData:{profession:"minecraft:butcher"}}] run function undeadm-m2:villager_talk/by_profession/salutation/butcher
execute as @s[nbt={VillagerData:{profession:"minecraft:cartographer"}}] run function undeadm-m2:villager_talk/by_profession/salutation/cartographer
execute as @s[nbt={VillagerData:{profession:"minecraft:cleric"}}] run function undeadm-m2:villager_talk/by_profession/salutation/cleric
execute as @s[nbt={VillagerData:{profession:"minecraft:farmer"}}] run function undeadm-m2:villager_talk/by_profession/salutation/farmer
execute as @s[nbt={VillagerData:{profession:"minecraft:fisherman"}}] run function undeadm-m2:villager_talk/by_profession/salutation/fisherman
execute as @s[nbt={VillagerData:{profession:"minecraft:fletcher"}}] run function undeadm-m2:villager_talk/by_profession/salutation/fletcher
execute as @s[nbt={VillagerData:{profession:"minecraft:leatherworker"}}] run function undeadm-m2:villager_talk/by_profession/salutation/leatherworker
execute as @s[nbt={VillagerData:{profession:"minecraft:librarian"}}] run function undeadm-m2:villager_talk/by_profession/salutation/librarian
execute as @s[nbt={VillagerData:{profession:"minecraft:none"}}] run function undeadm-m2:villager_talk/by_profession/salutation/none
execute as @s[nbt={VillagerData:{profession:"minecraft:nitwit"}}] run function undeadm-m2:villager_talk/by_profession/salutation/nitwit
execute as @s[nbt={VillagerData:{profession:"minecraft:mason"}}] run function undeadm-m2:villager_talk/by_profession/salutation/mason
execute as @s[nbt={VillagerData:{profession:"minecraft:shepherd"}}] run function undeadm-m2:villager_talk/by_profession/salutation/shepherd
execute as @s[nbt={VillagerData:{profession:"minecraft:toolsmith"}}] run function undeadm-m2:villager_talk/by_profession/salutation/toolsmith
execute as @s[nbt={VillagerData:{profession:"minecraft:weaponsmith"}}] run function undeadm-m2:villager_talk/by_profession/salutation/weaponsmith

View File

@ -0,0 +1,16 @@
# make name visible
data merge entity @s {CustomNameVisible:1}
# names :D
function undeadm-random:rand10
execute if score $value rnd_random matches 1 run data merge entity @s {CustomName:'{"text":"Maelys"}'}
execute if score $value rnd_random matches 2 run data merge entity @s {CustomName:'{"text":"Ariel"}'}
execute if score $value rnd_random matches 3 run data merge entity @s {CustomName:'{"text":"Veronica"}'}
execute if score $value rnd_random matches 4 run data merge entity @s {CustomName:'{"text":"Carl"}'}
execute if score $value rnd_random matches 5 run data merge entity @s {CustomName:'{"text":"Emp"}'}
execute if score $value rnd_random matches 6 run data merge entity @s {CustomName:'{"text":"Timoteus"}'}
execute if score $value rnd_random matches 7 run data merge entity @s {CustomName:'{"text":"Breeze"}'}
execute if score $value rnd_random matches 8 run data merge entity @s {CustomName:'{"text":"Kelsier"}'}
execute if score $value rnd_random matches 9 run data merge entity @s {CustomName:'{"text":"Eri"}'}
execute if score $value rnd_random matches 10 run data merge entity @s {CustomName:'{"text":"Alie"}'}
scoreboard players reset $value rnd_random

View File

@ -0,0 +1 @@
say hey, im trading stuff

View File

@ -0,0 +1,6 @@
[
{
"function": "minecraft:set_nbt",
"tag": "{uwu:1}"
}
]

View File

@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"minecraft:villager",
"minecraft:wandering_trader"
]
}

View File

@ -0,0 +1,2 @@
scoreboard objectives add rnd_random dummy
scoreboard objectives add rnd_gen dummy

View File

@ -0,0 +1,17 @@
scoreboard players set $value rnd_random 0
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:5,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:6,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:7,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:8,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:9,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]
scoreboard players add $value rnd_random 1

View File

@ -0,0 +1,29 @@
scoreboard players set $value rnd_random 0
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:5,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:6,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:7,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:8,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:9,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:5,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:6,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:7,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:8,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:9,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots 10
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]

View File

@ -0,0 +1,24 @@
scoreboard players set $value rnd_random 0
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:5,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:6,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:7,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:8,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:9,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots 10
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]
scoreboard players add $value rnd_random 1

View File

@ -0,0 +1,26 @@
scoreboard players set $value rnd_random 0
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:5,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:6,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:7,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:8,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:9,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:0,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:1,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:2,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:3,Tags:["Random"]}
summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,NoGravity:1b,DisabledSlots:4,Tags:["Random"]}
execute store result score $value rnd_gen as @e[tag=Random,limit=1,sort=random] run data get entity @s DisabledSlots 10
scoreboard players operation $value rnd_random += $value rnd_gen
kill @e[tag=Random]
scoreboard players add $value rnd_random 1

View File

@ -0,0 +1,16 @@
## LITERALLY A RANDOM NUMBER GENERATOR :D
# CALL FOR RANDOM
function undeadm-random:rand10
# RANDOM SHENANIGANS
if score $value rnd_random matches 0 run say "Primero, caganero"
if score $value rnd_random matches 1 run say "Segundo, rey del mundo"
if score $value rnd_random matches 2 run say "Tercero, pistolero"
if score $value rnd_random matches 3 run say "Cuarto, lagarto"
if score $value rnd_random matches 4 run say "Quinto, laberinto"
if score $value rnd_random matches 5 run say "Sexto, baloncesto"
if score $value rnd_random matches 6 run say "Séptimo, sin rima"
if score $value rnd_random matches 7 run say "Octavo, lavabo"
if score $value rnd_random matches 8 run say "Noveno, moreno"
if score $value rnd_random matches 9 run say "Décimo, tampoco rima"
# LAST CLEAR
scoreboard players reset $value rnd_random