Many Useful Things Library

Many Useful Things Library 1.3.0

New update, new commands, new procs!

Commands​

denchant​

An enchantment command that's a little easier to use, and more importantly, autofill's in Denizen registered enchantments. The regular vanilla enchant command doesn't autofill, so it's hard to know if the enchantment was registered correctly and you're typing it wrong, or if the enchant never registered in the first place. Also has clever warning messages to let you know whether the enchants you are using are within vanilla range, whether the enchant will work on the item, or if the enchant will conflict with another enchant. A lot of the heavy lifting is due to the new enchantment tags monkey added.

Procedures​

ordinal​

Input a number and get the relevant ordinal attached to it. Ex. 1 -> 1st, 15 -> 15th, 23 -> 23rd.

one_in_x​

A procedure that just returns true or false based off the number you put in, with a chance of 1/x. So if you put in 2, that's a 1/2 chance, or 50% chance you'd get a true or false.

mix_dyes​

Takes a list of Minecraft dyes and returns a ColorTag based on mixing those dyes together. The list can be of any length, and must be ItemTags. NOTE: While most of the dyes are an accurate representation of the color of the dye, passing in a white dye or a black dye will return pure white or pure black, unlike vanilla Minecraft where the white and black dyes are not pure colors. To tweak that, simply go in the core/data.dsc, and change the white and black hex values. In another update I will add in a config option that makes it easier to change this.

formatted_date​

A no-context procedure that just returns a nicely formatted date in the form of "3:16 PM, July 31st, 2021"

Tweaks/Fixes/Changes​

  • Tweaked random_placement, notable_tool usages to look a bit nicer.
  • Added on item enchanted event and on prepares anvil craft to make sure enchants registered through Denizen have the lore attached to them. It's not perfect if the lore already happens to contain text identical to what the enchantment is trying to do but it's serviceable, and necessary if you want Denizen registered enchants to function like vanilla ones, in regards to enchanting tables and anvils. NOTE: You can't make the enchantment name pop up in the enchanting table; when you hover over a button, it'll be blank if it's a custom enchant. That's just a quirk of vanilla Minecraft and isn't fixable right now.
  • Fixed weighted random to get epsilon from data script.

Bug Fixes​

Turned off debug on all commands
Round lib_between since it throws an error if the number isn't an int.

Added:​

lib_grow_mushroom and lib_grow_fungus​

They check if a mushroom or fungus can be grown before trying to grow it, which prevents the "could not generate tree at location" error the generate_tree mech loves to throw.

lib_is_material​

Checks if a location in a direction is a material. instead of needing to do <[loc].up.material.name> == my_material all over the place, you can do <[loc].proc[lib_is_material].context[up|dirt]> or whatever. Good for, for example, checking if a fungus is on the block it's supposed to be on, or something like that. Might remove it because it might be a bit situational but seems useful.

lib_is_air​

Checks if a location is an air block. I do this so often, so I figured it'd be useful.

lib_full_volume​

Gets the full volume of a cuboid, including submembers. I'll probably end up making it handle all the polygons, but right now it only handles cuboids.

face_to_vector​

The opposite of vector_to_face. Takes something like "up" and turns into into a 1 length vector (0,1,0) which can be used in relative or whatever you want it for.

Removed:​

lib_is_player​

The check was so simple, it wasn't worth having an entire proc for.
Added:

lib_simulate_item_breaking​

Fakes a player breaking an held item. The item is not taken, but the sound plays, and the appropriate particles are generated.

lib_animated_actionbar​

Pass in a list, and a wait, and the actionbar will display one value from the list at a time, with the specified wait between each displaying. Basically wraps a for loop, but is used commonly enough in conjunction with animated_rainbow_text it's worth having it as a run for easy access.

lib_romanize​

Creates a roman numeral from a decimal number that you pass. I'm not sure how well it works past about 3 or 4 thousand due to roman numerals only really going up to M (1000), and technically a roman numeral isn't supposed to have more than three of the same numeral in a row. Useful for enchanting values, so you can have Unbreaking MMXIV instead of value.2014 or whatever it normally does.

lib_between​

Helper procedure for getting a random number between 1 and x. With the .proc[] way of doing procedures it can be a lot cleaner, because instead of needing to do <util.random.int[1].to[<[value]>]> you can just do <[value].proc[lib_between]>.

Also updated some core procs to allow for using the command usage system I have setup. It's still a core proc so it's messy and not very user friendly, but it's there.