- check_circle Functions
Published Sep 23rd, 2019, 9/23/19 11:51 am
- 11,143 views, 4 today
- 445 downloads, 0 today
11
The Enchanted Villagers helps to find a specified enchantment in a trading hall with a lot of librarians.
The player can obtain the enchanted villagers book by typing
into the chat. This book will list all enchantments with the cheapest price available.
By clicking on an enchantment, all villagers that trade this enchantment will be highlighted for a short period of time (this can be disabled by the player that adds the datapack).
There are two features for OP players:
When adding the datapack, edit line 5 of the file "data/enchanted_villagers/functions/enable_trigger.mcfunction" and change the 1 at the end to a 0:
You can also disable this setting for specific players:
and enable it only for specific players, too:
Just replace player_name with the in-game name of the player you want to target (or with any target selector to target multiple players).
The player can obtain the enchanted villagers book by typing
/trigger ev_giveBook
into the chat. This book will list all enchantments with the cheapest price available.
By clicking on an enchantment, all villagers that trade this enchantment will be highlighted for a short period of time (this can be disabled by the player that adds the datapack).
There are two features for OP players:
Disable highlighting villagers
When adding the datapack, edit line 5 of the file "data/enchanted_villagers/functions/enable_trigger.mcfunction" and change the 1 at the end to a 0:
execute at @a unless score @p ev_canSearch matches 0.. run scoreboard players set @p ev_canSearch 1
You can also disable this setting for specific players:
scoreboard players set *player_name* ev_canSearch 0
and enable it only for specific players, too:
scoreboard players set *player_name* ev_canSearch 1
Just replace player_name with the in-game name of the player you want to target (or with any target selector to target multiple players).
Statistics
The datapack comes with two statistics you can use for other datapacks or functions if you want to:
ev_tookBooks: This scoreboard counts how often a player used the "/trigger ev_giveBook" command.
ev_searched: This scoreboard counts how often a player clicked on an enchantment to view the villagers that have this trade. It won't test if the search was successful (if there were one or multiple villagers that trade this book).
ev_tookBooks: This scoreboard counts how often a player used the "/trigger ev_giveBook" command.
ev_searched: This scoreboard counts how often a player clicked on an enchantment to view the villagers that have this trade. It won't test if the search was successful (if there were one or multiple villagers that trade this book).
Compatibility | Minecraft 1.14 |
Tags |
tools/tracking
4407186
119
enchanted-villagers
Create an account or sign in to comment.