pub struct Extension { /* private fields */ }Expand description
Extension Script of MeguScript
Extension will follow /loot command’s path convention.
To refer to creeper loot table use minecraft:entities/creeper
§Examples
ⓘ
let creeper_extend = Extension::get_extension("minecraft:entities/creeper", "resource").unwrap();If the input string is not a vanilla’s path it will panic
ⓘ
let should_panic = Extension::get_extension("this/path/does/not/exists", "resource").unwrap();Implementations§
Source§impl Extension
impl Extension
pub fn new(location: impl Into<PathBuf>) -> Extension
Sourcepub fn get_extension(
value: impl Into<String>,
base_path: impl Into<PathBuf>,
) -> Result<Extension, ExtensionError>
pub fn get_extension( value: impl Into<String>, base_path: impl Into<PathBuf>, ) -> Result<Extension, ExtensionError>
Get extension from given Namespace
§Setting up
You need to include the source files for the loot table database yourself.
Which you need to place the file in this order: {base_path}/{prefix}/{suffix}.ult where prefix and suffix refer to Namespace
Trait Implementations§
Source§impl PartialOrd for Extension
impl PartialOrd for Extension
impl Eq for Extension
impl StructuralPartialEq for Extension
Auto Trait Implementations§
impl Freeze for Extension
impl RefUnwindSafe for Extension
impl Send for Extension
impl Sync for Extension
impl Unpin for Extension
impl UnwindSafe for Extension
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more