Repository navigation
Mimic v0.9.0
Paper-first
Keeping the plugin compatible both with Paper and Spigot consumes a lot of time.
Now, Mimic is Paper-first as it is the most popular platform.
This means that compatibility with Spigot is not guaranteed.
To reduce the maintenance burden, support for versions older than 1.20.6 has been dropped.
Java 21 is required.
BlockRegistry API
This version introduces new experimental BlockRegistry API.
It can be used to get IDs of placed blocks and block items, get items placing blocks, set blocks, and break blocks passing drops to a custom consumer.
Block IDs from all registries are available via Mimic.getBlockRegistry(), namespaced with the registry ID.
Block IDs are resource locations: minecraft:stone, craftengine:default/palm_log.
ID without namespace or with the reserved mimic namespace is searched over all registries in order of priority.
// Register a block registry
Mimic.getInstance().registerBlockRegistry(new MyBlockRegistry(), MimicApiLevel.CURRENT, plugin, ServicePriority.Normal);
// Set a block
BukkitBlockRegistry blockRegistry = Mimic.getInstance().getBlockRegistry();
blockRegistry.setBlock(location.getBlock(), "minecraft:stone_stairs", "[facing=north]");
// Break a block with a pickaxe, collecting drops into a chest inventory
blockRegistry.breakBlock(block, pickaxe, drops -> chestInventory.addItem(drops.toArray(new ItemStack[0])).values());Added commands to debug block registries:
/mimic blocks info- show information about block registries/mimic blocks give [target] [block] (amount)- give the item placing the given block/mimic blocks set [location] [block] (payload)- set block at the given location, replacing the existing one/mimic blocks break (location)- break block at the given location, or the targeted block, with the item in hand/mimic blocks compare (block)- compare targeted block with the given block, or with the block placed by item in hand/mimic blocks find [block]- check that block with the given ID exists
Improved commands
Now it is possible to change Mimic config using commands in two ways:
- Using interactive config
/mimic config.
Every option in the output is interactive, so you can change it just by mouse click. - Change options by commands:
/mimic config level-system [value]- set the specified level system as preferred for Mimic/mimic config class-system [value]- set the specified class system as preferred for Mimic/mimic config inventory-provider [value]- set the specified inventory provider as preferred for Mimic/mimic config disabled-items-registries add [item-registry]- disable the specified item registry for Mimic/mimic config disabled-items-registries remove [item-registry]- enable the specified item registry for Mimic/mimic config disabled-block-registries add [block-registry]- disable the specified block registry for Mimic/mimic config disabled-block-registries remove [block-registry]- enable the specified block registry for Mimic/mimic config reset [option]- reset the specified option to its default value
Commands are now easier to use in general:
/mimic inforeplaced with/mimic/mimic class hasreplaced with/mimic class checkwith simpler syntax/mimic xp info [player]and/mimic class check [player]send the result to the command sender instead of the target player./mimic items givehas the same arguments order as vanilla/give:/mimic items give [target] [item] (amount) (payload)./mimic xp set|give|takereplaced with a single value:/mimic xp [value] (player)
Value is[+|-]<amount>[L|P|T]:+gives,-takes, no sign sets;Lis levels,Pis points (default),Tis total exp.
For example,/mimic xp +5Lgives five levels and/mimic xp 100sets 100 exp points./mimic xp hasremoved, use/mimic xp infoinstead/mimic items idremoved,/mimic itemsshows ID of the item in hand.- Aliases
/mimic experienceand/mimic invremoved, use/mimic xpand/mimic inventoryinstead. - Subcommand
infois optional:/mimic items,/mimic blocks,/mimic xp,/mimic inventoryand/mimic classshow info.
Info output lists available subcommands, click to use them, hover to see usage. - Clearer command output: colored answers, errors for failed actions, click-to-copy IDs.
- Item and block IDs are completed step by step: namespace first (
craftengine:), then folder (craftengine:default/), then ID.
Item and block IDs format
Item and block IDs now share one format (#66): a resource location with the registry ID as namespace,
like minecraft:acacia_boat or craftengine:default/palm_log.
- Invalid IDs are rejected without querying registries.
Invalid IDs returned by registries are ignored with a warning, for example IDs with uppercase letters, including the registry ID. - Items: the
mimicnamespace searches over all registries, like IDs without namespace. - Registries map plugin IDs to Mimic IDs themselves:
itemsadder:ruby_sword→itemsadder/ruby_sword. - Deprecated: item IDs with uppercase letters (
minecraft:DIAMOND_SWORD) are lowercased,
and IDs with more than one:(ia:itemsadder:ruby_sword) are passed as is. Both log a warning.
API changes
- Added tag
@since 0.8.0to all APIs added in 0.8.0 - Make
BukkitPlayerInventory.collectEquippedItemsprotected. It was public by an accident. - Fixed
BukkitPlayerInventory.collectStoredItemsexcluding the first stack equal to the item in the main hand instead of the held slot itself. - Default implementation of
ClassSystem.hasAnyClass()changed.
Now it checks ifgetClasses()returns a non-empty list instead of checkinggetPrimaryClass() != null.
Plugin changes
-
Added CraftEngine integration: items registry and block registry (#52).
CraftEngine IDsnamespace:pathbecomecraftengine:namespace/path, for examplecraftengine:default/palm_log. -
minecraftitems registry accepts item components as a payload in the format of the/givecommand:
/mimic items give Steve minecraft:diamond_sword 1 [damage=10,unbreakable={}].
The HOCON payload (ItemMetaPayload) is still supported as an alternative, with MiniMessage formatting for name and lore. -
MMOCore integration requires MMOCore 1.13 or newer
-
Class system
permissionstakes into account only explicitly setmimic.class.*permissions.
Previously, operators had all classes. -
Implementations are stored in Mimic instead of Bukkit's
ServicesManager(#70).
Each ID now belongs to a single implementation:- An implementation registered by another plugin replaces the Mimic built-in integration with the same ID.
- If two plugins register the same ID, the one with higher priority is used.
On equal priorities, the first registered is used. - If a plugin registers the same ID again, the new implementation replaces the previous one.
- IDs of default implementations (
mimic,minecraft,permissions) are reserved. - Default implementations are always used last, regardless of priority.
So a custom block registry registered withLowestpriority still recognizes its blocks before the vanilla registry.
Implementations with different IDs and equal priority are ordered by registration: the first registered is used by default.
Previously, the implementation with the lowest priority was selected by ID, and the order of equal priorities was undefined. -
mimicis not listed inMimic.getAllItemsRegistries()andMimic.getAllBlockRegistries()anymore,
and is not an option ofdisabled-items-registriesanddisabled-block-registriesin config. -
Breaking change! Implementations can't be loaded from
ServicesManageranymore, useMimic.getInstance()instead.
Implementations registered directly inServicesManagerare still moved to Mimic. -
Breaking change!
MimicItemsRegistryconstructor is internal now, useMimic.getItemsRegistry()instead.
Housekeeping
- Update required Java 1.8 → 21
- Update Kotlin 1.6.20 → 2.4.21, preserving API and Language level 2.2
- Replace ACF with Paper's Brigadier command API
- Update Gradle 7.4.2 → 9.8.2
- Update dependencies
- Migrate to version catalogs
- Publish to Maven Central via Central Portal