Question Did not find a valid velocity-plugin.json

Zor1s

New member
Feb 16, 2022
1
0
1
Plugin class:
Code:
@Plugin(
    id = "hub-plugin",
    name = "Hub Plugin",
    version = "0.1",
)
class VelocityTest @Inject constructor(logger: Logger) {
    init {
        logger.info("Hub plugin started!")
    }
}

Build file:

Code:
plugins {
    kotlin("jvm") version "1.7.20"
}

group = "its.meee"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
}

dependencies {
    compileOnly("com.velocitypowered:velocity-api:3.1.1")
    annotationProcessor("com.velocitypowered:velocity-api:3.1.1")
}
 
Logs
https://paste.gg/p/anonymous/dad6664832f6403e882217ea6458ef15
Version Output
Velocity 3.1.2-SNAPSHOT (git-2d072151-b185)

Smudge

New member
Jul 5, 2022
20
2
3
Could try adding author and description.
Code:
@Plugin(
        id = "hub-plugin",
        name = "Hub Plugin",
        version = "0.1",
        description = "A velocity plugin",
        authors = {"You"}
)

WAIT it may be because you have a comma!

Code:
@Plugin(
    id = "hub-plugin",
    name = "Hub Plugin",
    version = "0.1",
)
Change this to this
Code:
@Plugin(
    id = "hub-plugin",
    name = "Hub Plugin",
    version = "0.1"
)
 

4drian3d

Member
Jan 5, 2022
60
4
8
Perú
Plugin class:
Code:
@Plugin(
    id = "hub-plugin",
    name = "Hub Plugin",
    version = "0.1",
)
class VelocityTest @Inject constructor(logger: Logger) {
    init {
        logger.info("Hub plugin started!")
    }
}

Build file:

Code:
plugins {
    kotlin("jvm") version "1.7.20"
}

group = "its.meee"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven("https://repo.papermc.io/repository/maven-public/")
}

dependencies {
    compileOnly("com.velocitypowered:velocity-api:3.1.1")
    annotationProcessor("com.velocitypowered:velocity-api:3.1.1")
}
If you use kotlin to develop Velocity plugins, you must use kapt as the annotation processor.

Code:
plugins {
  ...
  kotlin("kapt")
}

dependencies {
  ...
  kapt("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
}