API
# API Purpose
We warmly welcome integrating with this plugin to develop more add-ons. If you need additional APIs, please contact me to add them.
3.0.0 provides cn.handyplus.companions.api.CompanionsPlusApi, which can give companions via giveCompanion(Player, String), or use giveCompanion(Player, String, boolean) to choose whether to enable immediately. It returns the new companion instance ID; it returns -1 when the config does not exist, the warehouse is full or adding fails, and it does not auto-enable by default.
# 1. Importing API Dependency Package
<repository>
<id>handyplus-maven</id>
<url>https://maven.cnb.cool/handyplus/maven/-/packages/</url>
</repository>
<dependency>
<groupId>cn.handyplus.companions</groupId>
<artifactId>CompanionsPlus</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>