Fake Inventory UI by tedo0627 ported to PowerNukkitX. A port of InventoryUI by tedo0627, enabling blockless custom inventory UIs backed by a virtual entity.
- No world blocks placed — Uses a virtual, non-persistent custom entity (
inventoryui:inventoryui) instead of placing fake chest blocks in the world. - Movement-resilient — Links the virtual container entity to the player (
ActorLinkType.RIDING) so the inventory does not automatically close if the player falls or is moved by water. - Arbitrary slot counts — Specify any positive number of slots (
> 0), including layouts larger than 54 slots with automatic scroll support. - Configurable vertical length — Control the visible number of rows (
0–6, ornullfor automatic sizing). - Callback & subclass friendly — Handle
open,close,click, andtickvia lambdas/method references or by extendingCustomInventory.
- PowerNukkitX API
3.0.0+ - Java 25 (JDK 25 required to compile/run)
- InventoryUIResourcePack — Download
InventoryUIResourcePack.mcpackand install it in your PowerNukkitXresource_packsfolder with forced resource packs enabled on the server so clients render the custom inventory UI layout.
- Build the plugin JAR (see Building from Source) or download
FakeInvUI.jarfrom Releases. - Place
FakeInvUI.jarinto your server'splugins/folder. - Add
FakeInvUIas a dependency in your plugin's@PluginMeta(orpowernukkitx.yml):
import org.powernukkitx.plugin.PluginBase;
import org.powernukkitx.plugin.annotation.PluginMeta;
@PluginMeta(
name = "MyPlugin",
version = "1.0.0",
authors = {"YourName"},
api = {"3.0.0"},
depend = {"FakeInvUI"}
)
public class MyPlugin extends PluginBase {
}When loaded as a standalone plugin, FakeInvUI automatically calls InventoryUI.setup(this) during onEnable().
If you embed/shade FakeInvUI directly inside your own plugin, call InventoryUI.setup(this) once in your plugin's onEnable():
import ReinfyTeam.FakeInvUI.InventoryUI;
import org.powernukkitx.plugin.PluginBase;
import org.powernukkitx.plugin.annotation.PluginMeta;
@PluginMeta(
name = "MyPlugin",
version = "1.0.0",
authors = {"YourName"},
api = {"3.0.0"}
)
public class MyPlugin extends PluginBase {
@Override
public void onEnable() {
InventoryUI.setup(this);
}
}InventoryUI.setup(Plugin) is idempotent; calling it multiple times safely returns after the first initialization.
<dependency>
<groupId>io.github.reinfyteam</groupId>
<artifactId>FakeInvUI</artifactId>
<version>1.0.0</version>
</dependency>import ReinfyTeam.FakeInvUI.CustomInventory;
import org.powernukkitx.Player;
import org.powernukkitx.item.Item;
public void openShop(Player player) {
CustomInventory inventory = new CustomInventory(27, "Item Shop");
inventory.setItem(13, Item.get("minecraft:diamond").setCustomName("§bBuy Diamond"));
inventory.setOnOpen(p -> p.sendMessage("§aOpened the shop!"));
inventory.setOnClose(p -> p.sendMessage("§eClosed the shop!"));
inventory.setOnClick((p, slot, sourceItem, targetItem) -> {
if (slot == 13) {
p.sendMessage("§bYou clicked the diamond!");
}
return true; // Return true to cancel moving the item
});
player.addWindow(inventory);
}import ReinfyTeam.FakeInvUI.CustomInventory;
import org.powernukkitx.Player;
import org.powernukkitx.item.Item;
public class SampleInventory extends CustomInventory {
public SampleInventory() {
super(54, "Sample Inventory");
this.setItem(0, Item.get("minecraft:emerald").setCustomName("§aConfirm"));
}
@Override
protected void handleOpen(Player player) {
player.sendMessage("Inventory opened.");
}
@Override
public void tick(int tick) {
// Called once per server tick while at least one player has this inventory open
}
@Override
public boolean click(Player player, int slot, Item sourceItem, Item targetItem) {
// Return true to cancel the interaction
return true;
}
@Override
protected void handleClose(Player player) {
player.sendMessage("Inventory closed.");
}
}For full class and method documentation, see API.md.
Requires JDK 25 and Maven:
mvn -B packageThe compiled plugin JAR will be output to target/FakeInvUI.jar.
- Original PocketMine-MP virion:
tedo0627/InventoryUI(MIT License) - Resource Pack:
tedo0627/InventoryUIResourcePack(with contributions from @yuyaprgrm)
Made with ❤️ by ReinfyTeam