EdLib API

EdLib API is designed to handle complex entity management, custom models, packet operations, and advanced server features that require NMS (Net Minecraft Server) access. It provides a clean, version-i

Singleton Access

The EdLib API uses a singleton pattern for easy access:

// Get the API instance
EdLibAPI api = EdLibAPI.getInstance();

// Use API methods
EdEntity entity = api.createEntity(EntityType.ZOMBIE, location);

Main Interface Methods

Model Management

EdModel getModel(String id)

  • Description: Retrieves a registered custom model by its identifier

  • Parameters: id - The unique identifier of the model

  • Returns: EdModel instance or null if not found

  • Usage: Access to custom 3D models for entities

Entity Creation

EdEntity createEntity(EntityType type, Location location)

  • Description: Creates a new fake entity of the specified type at the given location

  • Parameters:

    • type - Minecraft entity type (ZOMBIE, CHICKEN, etc.)

    • location - World location where the entity should spawn

  • Returns: EdEntity instance for manipulation

  • Usage: Create fake mobs

EdEntity createInteractionEntity(Location location, float height, float width)

  • Description: Creates an invisible interaction entity for click detection

  • Parameters:

    • location - Spawn location

    • height - Interaction box height

    • width - Interaction box width

  • Returns: EdEntity for interaction handling

  • Usage: Invisible click zones, button areas, interaction triggers

EdEntity createBlockDisplay(Location location, Matrix4f matrix, Material material)

  • Description: Creates a block display entity with transformation matrix

  • Parameters:

    • location - Display location

    • matrix - 4x4 transformation matrix for positioning/scaling/rotation

    • material - Block material to display

  • Returns: EdEntity representing the block display

  • Usage: Floating blocks, decorative elements, custom structures

EdEntity createItemDisplay(Location location, Matrix4f matrix, String texture, int[] uuidArray, String name)

  • Description: Creates an item display entity with custom texture

  • Parameters:

    • location - Display location

    • matrix - Transformation matrix

    • texture - Base64 texture string or player skin texture

    • uuidArray - UUID components for texture association

    • name - Display name for the item

  • Returns: EdEntity for the item display

  • Usage: Custom items, floating textures, UI elements

Player Interface Elements

void sendActionbar(Player player, String message)

  • Description: Sends a message to the player's action bar

  • Parameters:

    • player - Target player

    • message - Text to display (supports color codes)

  • Usage: Status updates, temporary notifications

void sendXPBar(Player player, float progress, int level)

  • Description: Updates the player's experience bar display

  • Parameters:

    • player - Target player

    • progress - Bar fill percentage (0.0 to 1.0)

    • level - Level number to display

  • Usage: Custom progression bars, mini-game progress

Player Visibility Management

void hidePlayer(Player viewer, Player target)

  • Description: Hides a player from another player's view

  • Parameters:

    • viewer - Player who will not see the target

    • target - Player to be hidden

  • Usage: Invisibility effects, phase modes, separate instances

void showPlayer(Player viewer, Player target)

  • Description: Makes a hidden player visible again

  • Parameters:

    • viewer - Player who will see the target

    • target - Player to be shown

  • Usage: Revealing hidden players, ending invisibility

Block Manipulation

void sendBlocks(Player player, Map<Vector, Material> blocks)

  • Description: Sends fake block changes to a specific player

  • Parameters:

    • player - Player who will see the block changes

    • blocks - Map of positions to materials

  • Usage: Player-specific terrain, temporary structures, visual effects

Boss Bar Management

void sendBossBar(Player player, UUID uuid, String title, float progress, String color)

  • Description: Creates a boss bar for the player

  • Parameters:

    • player - Target player

    • uuid - Unique identifier for the boss bar

    • title - Text displayed on the boss bar

    • progress - Bar fill amount (0.0 to 1.0)

    • color - Bar color (blue, red, green, yellow, purple, white)

  • Usage: Progress indicators, health bars, timers

void updateBossBarTitle(Player player, UUID uuid, String title)

  • Description: Updates the title of an existing boss bar

  • Parameters:

    • player - Target player

    • uuid - Boss bar identifier

    • title - New title text

  • Usage: Dynamic text updates, status changes

void updateBossBarProgress(Player player, UUID uuid, float progress)

  • Description: Updates the progress of an existing boss bar

  • Parameters:

    • player - Target player

    • uuid - Boss bar identifier

    • progress - New progress value (0.0 to 1.0)

  • Usage: Progress updates, health changes

void removeBossBar(Player player, UUID uuid)

  • Description: Removes a boss bar from the player's screen

  • Parameters:

    • player - Target player

    • uuid - Boss bar identifier to remove

  • Usage: Cleanup, temporary bars, completion indicators


Usage Examples

Creating a Simple NPC

EdLibAPI api = EdLibAPI.getInstance();
EdEntity npc = api.createEntity(EntityType.VILLAGER, player.getLocation());
npc.setDisplayName("§6Quest Giver");
npc.addWatcher(player);
npc.spawn();

Custom Progress Bar

UUID barId = UUID.randomUUID();
api.sendBossBar(player, barId, "§aLoading...", 0.0f, "green");

// Update progress
for (int i = 0; i <= 100; i += 10) {
    api.updateBossBarProgress(player, barId, i / 100.0f);
    Thread.sleep(500);
}

api.removeBossBar(player, barId);

Fake Block Structure

Map<Vector, Material> blocks = new HashMap<>();
blocks.put(new Vector(0, 0, 0), Material.DIAMOND_BLOCK);
blocks.put(new Vector(1, 0, 0), Material.GOLD_BLOCK);
blocks.put(new Vector(0, 1, 0), Material.EMERALD_BLOCK);

api.sendBlocks(player, blocks);

Interaction Zone

EdEntity interaction = api.createInteractionEntity(location, 2.0f, 2.0f);
interaction.addWatcher(player);
interaction.spawn();

// Handle interaction in your click listener

Last updated

Was this helpful?