Java API

An extensive API is available, exposing all the big, and little details of models and mechanics.

Currently, AdvancedModels must be added as a .jar file to dependencies, we are working on gradle and maven integrations.

To access the API

API can be found using net.advancedplugins.models.Core.getAPI() method.

From there, you will get access to the AdvancedModelsAPI class.

AdvancedModelsAPI class
public interface AdvancedModelsAPI {
    boolean isModel(String model);
    String getModelFromItem(ItemStack item);
    SpawnedModel getModelFromBlock(Block block);
    SpawnedModel getModelFromLocation(Location loc);
    ]

You are able to do way more from SpawnedModel class:

SpawnedModel class
public interface SpawnedModel {
    Model getModel();
    
    SpawnedModel matchFromLocation(Location location);
    SpawnedModel matchFromHitbox(Interaction hitbox);

    void despawn();
    void rightClick(Player player);
}

And with Model class:

public interface Model {
    public String getId();
    public String getName();
    public String getAuthor();
    public String getVersion();
    public String getDescription();
    public ModelProperties getProperties(); // entity collision, block collision and model placeable item material
    public ModelPartProperties getPartProperties(); // get part material, interaction, value & more
    public ModelParameters getParameters(); // get args for colors 
    public SpawnedModel spawn(Location location, BlockFace rotation, PassedParameters params);
    public SpawnedModel spawn(Location location, BlockFace rotation);
    public SpawnedModel spawn(Location location, PassedParameters params);
    public SpawnedModel spawn(Location location);
    public String getGroup();
}

Last updated