Question Did not find a valid velocity-plugin.json

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

Zor1s

New member
Feb 16, 2022
2
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
21
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

Velocity Developer
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")
}