#help-development
1 messages ยท Page 614 of 1
you can check if a string equalsIgnoreCase another string but you cannot do getCommand with equalsIgnoreCase
ohhhhhhhhhhhhhh
tl;dr just use the same CaSe for plugin.yml and getCommand
ok
still error
[19:37:29 ERROR]: Error occurred while enabling VoidTimerPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.thehole.voidtimerplugin.VoidTimerPlugin.getCommand(String)" is null
at org.thehole.voidtimerplugin.VoidTimerPlugin.onEnable(VoidTimerPlugin.java:35) ~[VoidTimerPlugin.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-68]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-68]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
show your plugin.yml and your code
?aste
?paste
?paste
plugin.yml:
name: VoidTimerPlugin
version: '${project.version}'
main: org.thehole.voidtimerplugin.VoidTimerPlugin
api-version: '1.20'
commands:
timer:
description: abc123
usage: /timer {seconds}
ItemTimer:
description: nbc123
usage: /itemtimer [material] [seconds]
createhole:
description: abc123
usage: /createhole
can u see it
You didn't do what we told you to
i did
Not in the code you sent or that plugin.yml
i changed timer, itemtimer and createhole to lowercase
the code doesn't match your stacktrace. the error is in line 35. this would be line 37 in your paste, as you added two lines to the paste, which means it cannot find the "timer" command.
this doesnt look lowercase
why don't you just make all commands lowercase?
timer, itemtimer and createhole
in plugin.yml and in your code
is there likie a shortcut
to do that
i changed itemtimer to lowercase
ok
so i just replace
itemTimer with itemtimer
Timer with timer
and createHole with createhole
how come you now are talking about "Timer" when in the code you sent, it was "timer" already
bro i replaced all uppercase with lowercase
incase i missed it
now it should be fine
bro
[19:45:38 ERROR]: Error occurred while enabling VoidTimerPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.thehole.voidtimerplugin.VoidTimerPlugin.getCommand(String)" is null
at org.thehole.voidtimerplugin.VoidTimerPlugin.onEnable(VoidTimerPlugin.java:35) ~[VoidTimerPlugin.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-68]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-68]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
WHERE IN THE HELL
what's line 35
WHAT IN THE FUCK DO I DO
run a clean build
getCommand("timer").setExecutor(this);
I DIDNT
DO
UPPERCASE
Show your plugin.yml
are you using the new .jar?
command is still not in your plugin.yml
YES
bro
name: VoidTimerPlugin
version: '${project.version}'
main: org.thehole.voidtimerplugin.VoidTimerPlugin
api-version: '1.20'
commands:
timer:
description: abc123
usage: /timer {seconds}
ItemTimer:
description: nbc123
usage: /itemtimer [material] [seconds]
createhole:
description: abc123
usage: /createhole
WHAT DO I CHANGE HERE
like dude, read my lips man, bro
dude can you stop writing in this annoying way pls
ok sorry was getting heated
open your .jar with winrar, check your plugin.yml there
what was the issue?
so line 35 was itemtimer instead of timer?
nah it was line 36
itemtimer was in line 36
but the stacktrace mentions line 35
i guess something with the spacing messed it up
idk
Hi after few tries and error with redis i got it some kind working ..
We did mention that multiple times though
but still struggling to get it working bungee wide
[19:50:21 ERROR]: Error occurred while enabling VoidTimerPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.thehole.voidtimerplugin.VoidTimerPlugin.getCommand(String)" is null
at org.thehole.voidtimerplugin.VoidTimerPlugin.onEnable(VoidTimerPlugin.java:35) ~[VoidTimerPlugin.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-68]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-68]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
im dead bro
it just load the data not the new one ..
โฐ๏ธ
i bet you arent updating your jar
im deleting the out folder
and then im rebuilding it
do you use maven
yes
yes
i set the output destination to out
where
?paste your full pom
Run maven clean package to clear any old stuff
don;t set the output destination of the jar
you probably fucked up changing the output directory and are hence constantly using an old version
you haven't changed the output directory at all
your jar is in target/
it's target/VoidTimerPlugin-1.0.jar
Hope this isn't a case of them using Artifacts for building ๐
probably it is. How do you compile @quaint mantle ?
uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
not sure if iam doing anything wrong ..
he's using artifacts as he's set to java 1.8 but compiling against 1.20
That's possible if you just compile against the API
It should still be Java 8
wdym?
i go to project structure to artifacts and i add a new artifact with the main class
and as a jar
and then
wrong
doesn;t 1.20 require 17?
maven -> lifecycle -> package
oh
server yes, api no.
but you can still use JDK 17 while compiling for java 8 with maven
ah ok
i always use jdk 17 (and access java 17 dependencies like spigot or worldguard) but still compile for 1.8
so the compile button?
API is Java 8
NMS and implementation is Java 17
iirc
under validate?
Right side of IDE see the maven tab
Open it and find package
yeah its open
^
https://blog.jeff-media.com/how-to-create-your-first-minecraft-plugin-using-the-spigot-api-and-maven/ near the end of this post
oh package
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: io.papermc.paper:paper-api:jar -> duplicate declaration of version 1.20.1-R0.1-SNAPSHOT @ line 85, column 21
[ERROR] 'repositories.repository.id' must be unique: papermc-repo -> https://repo.papermc.io/repository/maven-public/ vs https://repo.papermc.io/repository/maven-public/ @ line 65, column 17
[ERROR] 'repositories.repository.id' must be unique: sonatype -> https://oss.sonatype.org/content/groups/public/ vs https://oss.sonatype.org/content/groups/public/ @ line 69, column 17
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.thehole:VoidTimerPlugin:1.0 (C:\Users\goofy\IdeaProjects\VoidTimerPlugin\pom.xml) has 2 errors
[ERROR] 'repositories.repository.id' must be unique: papermc-repo -> https://repo.papermc.io/repository/maven-public/ vs https://repo.papermc.io/repository/maven-public/ @ line 65, column 17
[ERROR] 'repositories.repository.id' must be unique: sonatype -> https://oss.sonatype.org/content/groups/public/ vs https://oss.sonatype.org/content/groups/public/ @ line 69, column 17
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
Process finished with exit code 1
you declared paper-api twice
error
why? don't do that
oh shit
same for the repository
i think i copy pasted it two times
you also got the papermc-repo there twice
both should only be there once
delete these
now compile it again
bro
[19:59:01 ERROR]: Error occurred while enabling VoidTimerPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.thehole.voidtimerplugin.VoidTimerPlugin.getCommand(String)" is null
at org.thehole.voidtimerplugin.VoidTimerPlugin.onEnable(VoidTimerPlugin.java:35) ~[VoidTimerPlugin.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-68]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-68]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
YES
which jar?
get the jar from your target folder
there are two jars
which did you copy
how is it called exactly
delete all teh jars on your server. Then copy one
Original-Void_Timer_Plugin_1.0.jar
Void_Timer_Plugin_1.0.jar
i did the second one
i double clicked package
there's no way any of those is the correct one
the correct one is exactly called "VoidTimerPlugin-1.0.jar"
without any underscores or anything
original-VoidTimerPlugin-1.0.jar
no
VoidTimerPlugin-1.0.jar
the correct one is exactly called "VoidTimerPlugin-1.0.jar"
HI, it's me again,
I spawn a display entity with that : RA.spawn(pointer, BlockDisplay.class, en -> { en.setDisplayWidth(1); en.setDisplayHeight(1); BlockData block = en.getBlock(); BlockState state = block.createBlockState(); state.setType(Material.BLACK_CONCRETE); state.update(); en.setBlock(block); });
but I can't see my entity in the world. did somedy know how to set the block displayed in my entity ?
and it'll be in the target/ folder of your project
i did that only
and it shows the error
๐
DM me your .jar
That is not how you set the block type
Just do en.setBlock(Material.BLACK_CONCRETE.createBlockData())
OH SHIT
your plugin does not even contain a plugin.yml
@tender shard
and the paper-plugin.yml it contains still uses ItemTimer
U are my god love you (it work)
you don't need any paper-plugin.yml, all you need is a plugin.yml
it was feault
default
with intellij
when i opened the project it was like that only
there was an option called paper manifest or smth
also i just realized
i had both the jars
in the plugins folder
it was because you chose "paper plugin" and not "spigot plugin"
๐
yeah people mentioned that to you earlier
[20:05:34 ERROR]: Error occurred while enabling VoidTimerPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.thehole.voidtimerplugin.VoidTimerPlugin.getCommand(String)" is null
at org.thehole.voidtimerplugin.VoidTimerPlugin.onEnable(VoidTimerPlugin.java:35) ~[VoidTimerPlugin-1.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-68]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-68]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
stilil doesnt work
i fixed the itemtimer
and i put in the right jar
send me your .jar again
new jar is correct, except that you still use paper-plugin.yml
the .jar in your server's folder is not the one you DMed me
it is
then it wouldn't complain about line 35
stop the server
i stopped the server and restart it
Is there something similar to CompletableFuture but reusable? I need to arrange to receive Bungeecord messages
[20:09:03 ERROR]: Error occurred while enabling VoidTimerPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.thehole.voidtimerplugin.VoidTimerPlugin.getCommand(String)" is null
at org.thehole.voidtimerplugin.VoidTimerPlugin.onEnable(VoidTimerPlugin.java:35) ~[VoidTimerPlugin-1.0.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-68]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-68]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-68]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-68]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
which line 35 is this tlaking about bro
istg
this line 35
i ont see anything wrong
here how about i send you the code and you compile it
and then lets check
ok nvm
@tender shard what do i do ๐ญ
yes
after 2 day's of debugging , and using varius things to fix it ... i endded up at the start ..
using redis rn but it does not seem to fix it ..
NOW
COMMAND TEST
TO SEE
IF IT WORKS
YESSSSSSSSSSSSSSS
@tender shard have my future kids
i dont want em
thank you for your guidance sire ๐
ok
Hello Every one hope u have a nice day! I am wondering how can I redirect java server logging from txt file to C++ application and how can I send commands from C++ app to java server? thx!
connect to the server with ip and port in code
find a way to encode and decode your packets on both ends
mhmmm
If you have access to the server you can use JNI
do u mean adding -h in the server jar argument to "host to listen"?
Use JNI
I have never touched Java before XD!
well I think it's time to downgrade lol
from C++ -> Java XD
oh alright I really appreciate ur help thx!
hahaha
Or just send it over websocket or some kind of socket
what event i can use for check when player jump in horse
that may take time I'd rather try JNI
It can be fine for gamedev if done right
do you mean when a player mounts a horse? https://hub.spigotmc.org/javadocs/spigot/org/spigotmc/event/entity/EntityMountEvent.html
bruh i am trying to have render distance in minecraft to max and still the game lags lol
not
when he jump in horse
in horse?
yes
That's like blaming C++ for my PC not being able run a Cyberpunk smoothly
no idea what you mean
It's not Javas fault that MC runs poorly
at least Cyperpunk got cool graphicx ๐
when he click SPASE end jump when he seat in HORSE
jump statistic increase event
cyberpunk was one of the most boring games I ever played lol. and the dialogues were generic and boring
a
I know mojang didn't plan for making an robust game engine for minecraft from begining
they didn't think that the game would get popular
Is this supposed to be main hand or off hand?
read teh deprecation
I'll use PlayerInventory ๐ค
this event checks for a horse that the player is NOTsitting on?https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/HorseJumpEvent.html
declaration: package: org.bukkit.event.entity, class: HorseJumpEvent
funny how spigot got a horse jump event but not a player jump event lol
hi , i posted my issuse in spigotmc :
https://www.spigotmc.org/threads/race-condition-while-player-change-server.611475/
yea? Lol
Sorry, asking the wrong thing, getting too far ahead in one question
well theres no real packet sent for a player jumping p sure
u could try tracking their onGround state and motion but
can it serialize single structures, or does that also fail?
private static final TypeToken<HashSet<Structure>> STRUCTURE_HASHSET_TYPE_TOKEN = new TypeToken<HashSet<Structure>>() {};
private static HashSet<Structure> deserialize(String json) {
return GSON.fromJson(json, STRUCTURE_HASHSET_TYPE_TOKEN.getType());
}
[16:39:02 WARN]: at java.base/java.lang.Class.getMethod(Unknown Source)
[16:39:02 WARN]: at com.google.gson.internal.reflect.ReflectionHelper$RecordSupportedHelper.getAccessor(ReflectionHelper.java:235)
[16:39:02 WARN]: ... 41 more
Seems the actual cause of failure ends up being this
does it work if you create a TypeToken for a single structure?
e.g. like this
private static final TypeToken<Structure> STRUCTURE_TYPE_TOKEN = new TypeToken<Structure>() {};
private static Structure deserialize(String json) {
return GSON.fromJson(json, STRUCTURE_TYPE_TOKEN.getType());
}
private static String serialize(Structure structure) {
return GSON.toJson(structure, STRUCTURE_TYPE_TOKEN.getType());
}
(GSON is a normal gson instance)
Component name = event.getName();
- how get name in string format
Well it doesn't fail at least
[16:43:28 INFO]: {}
//TEST
Bukkit.getLogger().info("TypeToken test");
final TypeToken<Structure> STRUCTURE_TYPE_TOKEN = new TypeToken<Structure>() {};
Bukkit.getLogger().info(new GsonBuilder().create().toJson(Structure.MANSION, STRUCTURE_TYPE_TOKEN.getType()));
which structure class is that?
org.bukkit.generator.structure.Structure
My end goal is to save/load a list of them to use in world.locateStructure
oh well that class doesn't really have any fields, there's nothing to serialize
Like
"structures": ["WOODLAND_MANSION", "JUNGLE_TEMPLE"]```
wouldn't it be enough to simply get the namespacedkey?
Structure.MANSION.getKey().toString() ?
that should return "minecraft:woodland_mansion" etc
there's nothing else to serialize
Tbh I'd just use a yml file
i mean it could be C++'s fault that it compiled mediocre assembly code
just look at RollerCoaster tycoon
it was written in assembly
yet ran on any potato pc of that time
Now that I finally got gson using my type adapter, it's no longer reflecting and no longer causing an exception, so I am doing this now
How would I go about converting that back into a Structure?
tbh I still think you don't need to serialize anything. You can simply get the structure's name, and then later on get the structure back through the name. unfortunately Structure has no getByKey so I'd loop over the Structure class's fields or sth, idk
private static String getStructureName(org.bukkit.generator.structure.Structure structure) {
return structure.getKey().getKey().toUpperCase();
}
private static Structure getStructureByName(String name) {
try {
for(Field field : org.bukkit.generator.structure.Structure.class.getFields()) {
if(field.getName().equals(name)) {
return (Structure) field.get(null);
}
}
return null;
} catch (ReflectiveOperationException ex) {
throw new RuntimeException(ex);
}
}
Ofc itd be better to cache that
tbh I still think you don't need to serialize anything.
I'm serializing a data class which contains aHashSet<Structure>which is then iterated and passed intoworld.locateStructure, I'm just figuring out how to save/load it with it containing the hashset
I'll give this a go, ty!
Just turn your set<structure> into a set<string> with the names as above
Then use a typetoken for set<string>
This link is not working for me. I need it for maven compilation. (tag me if you have any ideas about this)
Its like not responding and compilation freezes
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>```
This are my dependencies
Hey, does anyone know how to remove a Item from the world? I spawned things in using the Item class and made it non-pickupable but can't work out how to remove it ๐
declaration: package: org.bukkit.entity, interface: Entity
so basically if you just wanna turn a Set<Structure> into a gson string and then back into a Set<Structure>, i'd do it like this
private static final Map<org.bukkit.generator.structure.Structure, String> STRUCTURE_NAMES = new HashMap<>();
private static final Map<String, org.bukkit.generator.structure.Structure> STRUCTURES_BY_NAME = new HashMap<>();
private static final TypeToken<Set<String>> STRING_SET_TYPE_TOKEN = new TypeToken<Set<String>>() {};
private static final Gson GSON = new GsonBuilder().create();
static {
try {
for (Field field : org.bukkit.generator.structure.Structure.class.getFields()) {
STRUCTURE_NAMES.put((org.bukkit.generator.structure.Structure) field.get(null), field.getName());
STRUCTURES_BY_NAME.put(field.getName(), (org.bukkit.generator.structure.Structure) field.get(null));
}
} catch (ReflectiveOperationException ex) {
throw new RuntimeException(ex);
}
}
private static String getStructureName(org.bukkit.generator.structure.Structure structure) {
return STRUCTURE_NAMES.get(structure);
}
private static org.bukkit.generator.structure.Structure getStructureByName(String name) {
return STRUCTURES_BY_NAME.get(name);
}
{
Set<org.bukkit.generator.structure.Structure> myStructures = new HashSet<>();
String json = GSON.toJson(myStructures.stream().map(structure -> getStructureName(structure)).collect(Collectors.toSet()));
// ...
Set<String> structureNames = GSON.fromJson(json, STRING_SET_TYPE_TOKEN.getType());
Set<org.bukkit.generator.structure.Structure> myStructures2 = structureNames.stream().map(name -> getStructureByName(name)).collect(Collectors.toSet());
}
My reasoning for doing it this way is it gets converted to/from string only when the plugin is loaded/unloaded (or a reload command is triggered), but then the resulting Structure is passed directly as a method parameter during certain events while the server runs.
Thank you, this fixed it I was just trying to remove it too quick. There goes 4 days of my life ๐คฆโโ๏ธ
I ended up with a type adapter which is doing the job
public class StructureSerializer implements JsonSerializer<Structure>, JsonDeserializer<Structure> {
@Override
public JsonElement serialize(Structure src, Type typeOfSrc, JsonSerializationContext context) {
return new JsonPrimitive(src.getKey().getKey().toUpperCase());
}
@Override
public Structure deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
for(Field field : org.bukkit.generator.structure.Structure.class.getFields()) {
if(field.getName().equals(json.getAsString())) {
try {
return (Structure) field.get(null);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
return null;
}
}
oh yeah that might work too. but I'd rather cache the structures by name as in my code above
using reflection is hella slow compared to a normal map
hi so i am making spigot plugin and i added my server .jar file as dependency so i can access imports from the server and it is uploaded properly i would say and it appears that i can import and everything registers perfectly but when i build plugin to .jar file it throws errors that package doesnt exist and that it couldnt find symbol but everything in IDE seems to be registered properly like it found everything
is it maybe because im using maven so it causes problems if i put dependencies like this
is your server jar 1.8
dude
...
๐
probably modified too
yeah still you're using some unofficial spigot .jar that might contain ANYTHING lol
yes it contains malware but i like to have malware on my pc
Doesnโt make it more justified
Illegal quite literally means illegal no matter how you advert your eyes from the meaning of the word
will i get in trouble for downloading it ?
Thats optics job
oh no i beg for mercy UWU
weee
Get the feet outta here
๐จ <-- ban hammer @mellow pebble don't make me do something for once
bruh
even 3 feet are < 1 meter
@mellow pebble mining bitcoin with your minecraft server rn
Everyone outside of America has big wooden sticks instead of feet
Itโs a bit weird
I use knots
Whats that in monkeys
About 3
how much is that in gunther's chains
Messages.Kits.COOLDOWN
.runReplacements(Replacement("cooldown", formattedCooldown))
.send(player)
What do you guys think about this for a message config system?
is that kotlin or what's Replacement(...) ?
so it is kotlin, yeah that's what I asked lol
because if it'd been java, it'd been weird
looks good, but hard to tell without seeing the code. right now it looks like COOLDOWN is an enum or sth, so I wonder what runReplacements() does
COOLDOWN is an enum
Lets say I want to import a dependency A in Gradle and that dependency has 2 compileOnly dependencies (C and D). If I add the A dependency as compileOnly, will I have the C and D dependencies, or do I need to include them?
and runReplacements then returns what?
fun MessagesSection.runReplacements(vararg replacements: Replacement): Component {
var message = getFromConfig()
for (replacement in replacements) {
message = message?.replace("<${replacement.key}>", replacement.value)
}
return MESSAGES_MINI_MESSAGE.deserialize(message ?: throw MissingMessageException("Your messages.yml file is missing a message. (${key})"))
}
oh damn I shouldn't have asked for code after knowing that it's kotlin lol
and the fact that types are on the wrong side
and that the method seems to be declared in a different class
its because MessageSection is an interface
enum class Chat(override val key: String) : MessagesSection {
NO_ITEM_IN_HAND("NO_ITEM_IN_HAND"),
NO_PERMISSION_LINKS("NO_PERMISSION_LINKS"),
ITEM_ONCE_PER_MESSAGE("ITEM_ONCE_PER_MESSAGE");
override fun getConfigPath(): String {
return "Chat"
}
}
}
interface MessagesSection {
val key: String
/**
* @return The path to the config section. Ex. Server
*/
fun getConfigPath(): String
}
i'll never understand why kotlin moved the types to the end of the declaration
yeah but it's weird and unnatural
the type is much more important than the name imho
Does anyone know how I can use target selectors like @a and @p in my custom plugin command?
there's a method in Bukkit for that
declaration: package: org.bukkit, class: Bukkit
Will try that out, thanks
Hello friends, is giving chickens the ability to attack players something that is possible using plugin?
Should be with PathfinderGoals
happened earlier already
Youโll also need to do some jank to give them the attack damage attribute
Otherwise they will break the universe when they attack something
ouch, is the Shart dying?
!!!!!!
Not the shart
Anyone know when an item is checked to break? Is it inside PlayerItemDamageEvent? Iโm manually damaging an item, but itโs causing it to go negative and not break.
I mean it makes sense when you implement/extend stuff in kotlin you use : so its somewhat similar
Does anyone know if it's possible to use Files.copy with a file that's already in use by the plugin? I've tried just doing that function but I'm getting this message. Am I doing something wrong? [23:57:06] [Server thread/ERROR]: Error occurred while enabling BugReport v0.6.0 (Is it up to date?) java.lang.RuntimeException: java.nio.file.FileSystemException: plugins\BugReport\bugreports.db: The process cannot access the file because it is being used by another process
Anyone know how to create a custom mob with NMS in 1.20?
depends on your code
No other code in the plugin uses the file. BugReportDatabase is just called from the main plugin file on load before everything else.```java
public class BugReportDatabase {
public Connection connection;
private final String databaseFilePath;
public BugReportDatabase(String databaseFilePath) {
this.databaseFilePath = databaseFilePath;
checkForOldDatabases();
}
private void checkForOldDatabases() {
String[] columns = {"id", "playerName", "player_id", "worldName", "header", "message", "hasBeenRead"};
try {
//
File databaseFile = new File(databaseFilePath);
File oldDatabaseFile = new File(databaseFilePath + ".old");
try {
Files.copy(databaseFile.toPath(), oldDatabaseFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
throw new RuntimeException(e);
}```
mans making his own database or something
.... How else am I supposed to store reports?
Maybe a json file but idk ๐คทโโ๏ธ
Any tutorials or soemthing as I can't seem to find anything that works for 1.20
mongo, sql A list of BugReport or smth represented as json
you have no shortage of options
Guys how am i supposted to get the enchantment level of an tool/armor
i think the whole discord just resets itself, it happened to some servers, not sure why
i think first you need to have the Player object then:
Player player;
PlayerInventory inv = player.getInventory();
ItemStack helmet = inv.getHelmet(); // for example helmet here
// then you have the Map<Enchantment, Integer> here, which defines enchantment as key and level as value
helmet.getEnchantments().forEach(((enchantment, level) -> {
System.out.println("enchant: " + enchantment + ", level: " + level);
}));
tools are also family of itemstacks, you have to do the same procedure as helmet
Any easy way to break an item?
What's y'all thoughts on CommandAPI? Or should I just make my own API to fit my personal preference
use acf
its unmatched
but yeah no point re inventing the wheel for command frameworks
nothing that hasnt been done
Yeah that's what I was thinking
Gotta set it to null and play the matching EntityEffect
Basic math question: How can I write a function to given a rank (integer) calculate the price of a rank, I want it to scale but not to an unreasonable amount
Set the item stack to null?
be more specific, how do you want the price to rise?
an exponential is probably the best option
Can I dynamically unload a plugin? But not clear them all, just a specific plugin.
"not an unreasonable amount" is very broad aswell
Yeah in not sure how to classify it, like make it still enjoyable for players but not too easy
Yes
Bukkit.getPluginManager.disablePlugin(plugin)
It's not
give us some example numbers to work with
again, "enjoyable" is extremely subjective
It only disables, but not get rid of PluginManager#getPlugins()
I'll just try trial and error
Or I misunderstood something?
Why do you need to fully unload it
Because it can lead to duplication
Since I can load them as many times as I want, and in the #getPlugins(), it rerurns all
But I couldn't find any article talking about that. I mean I don't know how.
Ahh, thank you.
Not entirely sure how you would get duplicates. You cant load the same main class more then once
But also not sure why you need a dynamic way to unload plugins either just restart the server
I see them inside PluginManager#getPlugins() array
Use a stream and filter the disabled plugins
Plugin#isDisabled
how can i add if someone has already a potion effect to add time, in "vanilla" seems to not be possible
you can try removing the potion effect and readding it @grizzled oasis
ok thanks i didn't thought about that
otherwise effects can only have time "added" to if the new effects time > remaining time
but idk if bukkit intervenes
its weird
When I load a new one, there will be 2 loaded plugins with the same name and Plugin#isEnabled()=false is also the same. So which one will be chosen by PluginManager#getPlugin(NAME)? Or how I know which one in PluginManager#getPlugins() is the new version of the-same-name plugin?
The second one doesn't load
there's no easy way via api to restore 100% of a player's inventory in one call right
you have to target all the different slots?
It's a bitch
u's a bitch
But you can just call setContents
hm
Is it possible to run an async task that copies a folder and deletes another? (using it to reload the map)
For now the entire server is lagging for several seconds when this process happens
not only is it possible but it's how you're supposed to be doing it in the first place
weird it doesn't seem to be doing anything
how to get horse hp at the moment. I want to get the horse's hp when it is hit, but on damage event I get the previous value from the current one
well you can count the hp by yourself, iirc you can get dealt damage from the event and calculate
do you mean the "forumla" of "current hp - event.getFinalDamage()" 
i am coding a minecraft plugin with custom blocks called gens, these gens spawn items on top of them but i haven't done that part yet. basically when a gen is placed it just looks like a regular block, how do i know which block is regular and which is a custom block (gen)
you could store a list or all gen locations and or apply a custom PDC tag marking it as a gen
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
?paste
I went into a stupor and do not understand how to get the distance from the old location of the horse and the new one in order to calculate how much the horse has traveled. https://paste.md-5.net/ukapupaqov.cs
horseData need for check horse
Put your oldLocation variable inside your runnable class
Here
Then to check distance
oldLocation.distance(newLocation)
i have no idea how to do that pdc stuff ima just store a list
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Illusion sent that earlier for u
They're serialized along the chunk data
how do i get the name of a placed block
like lets say i placed a dirt called "durt"
how do i check with blockplaceevent if itss named durt
getType().getName
there no method .getName()
If its a custom block would need to fetch its pdc or metadata
how do i get the metadata
Which ever method to get the material and then toString() i suppose lol
there is BlockMeta if i am not mistaken
?jd-s 4 me
yeah but i need the name of the placed block not the material
Material name for vanilla blocks
the name of the placed block with be the material
maybe BlockPlaceEvent#getItemInHand().getItemMeta().getDisplayName() ?
If its custom you will have to resort to pdc or metadata
its not custom its just named
wont dispaly anything if it doesnt have a custom name
true
you have to format material.toString
but im just saying thay its probably how u could get the name if its "Durt"
Oh its named in the inventory?
System.out.println("Placed custom block");
}
System.out.println("no ");```
thats my code
yessir
Lol
Frosty can you explain pdc to him
@remote swallow im stuck at another problem
Just fyi material names are in all caps
๐
I'm out to get breakfast
my debug sysouts normally follow this order
"fuck"
"gay"
"shit"
"a", "b", "c", etc
i dont need the material name... i need the display name of the block
Blocks dont have display names
or like, "got here", "got here 1", "got here 2", etc
so how do i know if the placed block is one of my custom blocks
So if you are talking about the item in the inventory that is different from a block in the world
As one is an itemstack the other is a block
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Yeah that is an itemstack while its in the inventory
so basicallyfrom my yesterdays code i installed the worldedit dependency on my project, and i did some worldedit imports, but now when i try and compile it, its giving me an error
can somebody help
ok so when its placed how do i know its custom
The moment you place it, none of that stuff transfers to the block
so how wouldi k now
So you will need to use pdc to input custom data using the above link
bro i dont like pdcs i know its possible without it
Then you will need blockmeta
how do i get it
@remote swallow u there
?jd-s
ye
declaration: package: org.bukkit.block, interface: BlockState
so basically
i tried importing worldedit
i have the dependency installed
but when i try and compile it
it gives me import errors
?paste ur pom and the log
e.getBlockPlaced().getBlockData().getMaterial().getData().getName().equals("durt") @wet breach
does that work
Learnjava moment
No because as i said the block will not retain what the itemstack has
[ERROR] /C:/Users/goofy/IdeaProjects/VoidTimerPlugin/src/main/java/org/thehole/voidtimerplugin/VoidTimerPlugin.java:[3,27] package com.sk89q.worldedit does not exist
[ERROR] /C:/Users/goofy/IdeaProjects/VoidTimerPlugin/src/main/java/org/thehole/voidtimerplugin/VoidTimerPlugin.java:[4,27] package com.sk89q.worldedit does not exist
[ERROR] /C:/Users/goofy/IdeaProjects/VoidTimerPlugin/src/main/java/org/thehole/voidtimerplugin/VoidTimerPlugin.java:[5,34] package com.sk89q.worldedit.bukkit does not exist
[ERROR] /C:/Users/goofy/IdeaProjects/VoidTimerPlugin/src/main/java/org/thehole/voidtimerplugin/VoidTimerPlugin.java:[6,34] package com.sk89q.worldedit.bukkit does not exist
[ERROR] /C:/Users/goofy/IdeaProjects/VoidTimerPlugin/src/main/java/org/thehole/voidtimerplugin/VoidTimerPlugin.java:[7,32] package com.sk89q.worldedit.math does not exist
[ERROR] /C:/Users/goofy/IdeaProjects/VoidTimerPlugin/src/main/java/org/thehole/voidtimerplugin/VoidTimerPlugin.java:[8,35] package com.sk89q.worldedit.regions does not exist
[ERROR] /C:/Users/goofy/IdeaProjects/VoidTimerPlugin/src/main/java/org/thehole/voidtimerplugin/VoidTimerPlugin.java:[9,39] package com.sk89q.worldedit.world.block does not exist
[ERROR] /C:/Users/goofy/IdeaProjects/VoidTimerPlugin/src/main/java/org/thehole/voidtimerplugin/VoidTimerPlugin.java:[34,13] cannot find symbol
Thanks
You are either going to need to put custom data into the block or track it some other way
?paste ur pom and the log
Not sure why this is so hard to understand
because you are being vague
basically, when you place a block in Minecraft
there is no NBT that gets transferred (unless theres like, an inventory? TileEntities are weird)
You're not depending on WorldEdit
Its not vague. Simply put the information does not transfer from itemstack to a block. These are two different objects. You will need to make code to transfer such and you either use pdc, blockdata or track the custom info yourself. Blocks do not have display names
ight
im not getting any errors while in intellij so i assumed it was depended
ur best bet will most likely be, check the ItemStack name with ItemMeta in BlockPlaceEvent, and if its custom, store PDC in the Chunk that tracks the placed blocks location
<repository>
<id>worldedit-repo</id>
<url>https://worldedit.enginehub.org/en/latest/api/index.html</url>
</repository>
@chrome beacon ^^
You know there is code blocks in discord lol
๐ฟ
Sounds like you use the project menu to add WorldEdit. Don't use that
just because you add the repo doesnt mean you depend on it
^^
yes i did that
i added external jar
thanks for a more straight forward approach
Yeah don't do that
i mean @wet breach was moreso trying to explain what u were doing wrong and why it was wrong
Add the dependency to the pom
i was just making a suggestion on what u can do, but i dont know ur end goal, so YMMV
h o w
?maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
u see the <dependency> part? thats how u would add WorldEdit to maven
Enter the depenency info simillar to how you depend on paper api
You can find the exact values on their wiki
okok
?jd-s for self
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.15</version>
<scope>provided</scope>
</dependency>
this
?
@chrome beacon so i just enter this in my pom.xml right
i added the dependency but now its showing error
dependency not found
whered everyone go
u have worldedits repository added as well right?
oh yeah, looks like u do at least
reload maven
ok
Could not find artifact com.sk89q.worldedit:worldedit-bukkit:pom:7.2.15 in papermc-repo (https://repo.papermc.io/repository/maven-public/)
Could not find artifact com.sk89q.worldedit:worldedit-bukkit:pom:7.2.15 in papermc-repo (https://repo.papermc.io/repository/maven-public/)
do you still have the repo
yes
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>worldedit-repo</id>
<url>https://worldedit.enginehub.org/en/latest/api/index.html</url>
</repository>
</repositories>
?paste ur new pom
oh you copied the wrong url
wat
wdym
this is a you url, you can browse html
maven cannot
use https://maven.enginehub.org/repo/ as the repo
dam didnt even notice, havent used WE as a plugin dep yet
138.2.98.119
no
2A01:598:C84B:EE1F:461:756E:2AE6:1146
oops
thats not my ip thats my server ip
still no
Say yes to my ipv6
no
no one cares
prove it
You didnt even manage to register a command, it cant be that great
it has no domain so no one even knows what server it is, no one is going to open minecraft, add ur ip to a server then figure out what server it is to just leave
im testing it
https://paste.md-5.net/yelopodeno.java - i created my placeholders but they are not used why??? I registered them in the main class
he not work
how are you registering it?
does it show up in /papi list ?
?paste
horse, spark
what placeholder are you using
oh what??
this is all join foul?
t
%horse_heath%
it's called health and not heath
yea
what you mean
you called your placeholder %horse_heath% instead of %horse_health%
health != heath
this work
then what's the issue?
well ofc not
you never replace the palceholder
then how use
wait this need? joinText = PlaceholderAPI.setPlaceholders(event.getPlayer(), joinText);
I was told that it is automatically filled
yes, but ofc only call that if PAPI is installed
no
it can't work automatically, it wouldn't even know which player to use
so I need to fill each Placeholder with data when entering a command?
wdym "when entering a command"?
all you have to do if you want placeholders to be parsed is PlaceholderAPI.setPlaceholders(Player, String)
you simply gotta call PlaceholderAPI.setPlaceholders(...) everywhere you want placeholders to be replaced
then why do you need to fill it in
if(identifier.equals("name")){
return horseData.getHorseName();
}
if(identifier.equals("jump")){
return String.valueOf(horseData.getJump());
}
if(identifier.equals("blocks")){
return String.valueOf(horseData.getTraveledBlocks());
}
that is correct
do this
this code fills and setPlaceholder method too yes? why are they both needed
you have to respond to the call
if you dont respond it cant parse the placeholder
why are you even using placeholder api if this is just in ur own code
because that's what tells PlaceholderAPI.setPLaceholders(...) what to do?
I don't think you've understood what PAPI is and what it does, at all
if you call setPlaceholders, it looks for %placeholders%. Then it sees %horse_health% and it calls your placehodler class and asks it what "health" is
then you return something and papi replaces %horse_health% with whatever you returned in your placeholder class
I mean doesn't this line of code fill it already, why fill it again in the setPlaceholder method
if(identifier.equals("blocks")){
return String.valueOf(horseData.getTraveledBlocks());
}
i don't get your question
that returns the value
placeholdker api then uses that return value where the placeholder is used
does this line of code not populate the Plaseholder ?
if you just do player.sendMessage("%horse_health%") then how is PAPI supposed to replace it?
you are supposed to do player.sendMessage(PlaceholderAPI.setPlaceholders(player, "%horse_health%"))
ok
Hello, how can I get the new line sended in the console ?
thanks ๐
looks like the guy who created this blog is a big chad
nah I'm a twink
it bothered me so much that everyone changed their entities after spawning them lol
somehow nobody knew about the consumer method
same for the scheduler
people do weird things like using AtomicInts to get the task id and stuff
consumer for scheduler ?
usually people do this:
scheduler.runTask(myPlugin, () -> {
...
});
but then they need the task ID
and then they do stuff like this
AtomicInteger taskId = new AtomicInteger();
taskId.set(scheduler.runTask(myPlugin, () -> {
if(whatever) scheduler.cancelTask(taskId.get());
});
instead of using the consumer:
scheduler.runTask(myPlugin, task -> {
if(whatever) task.cancel();
});
that's why I always use instance of BukkitRunnable 
if so how can i save it for use in another plugin?
in your config.yml? Or is there no place to save it?
setPlaceholder return string
so i need save this?
dude what the heck are you trying to do
other plugins just also call setPlaceholder
why would you save the result of setPlaceholders
oh so i no need
i still think you haven't understood the purpse of PAPI
if another plugin now calls setPlaceholders on %horse_health%, then papi will call your horse plugin's placeholder class, and that's the whole and only purpose of it
I want to use these placeholders for another plugin, roughly speaking, pull it out of this plugin and put it in another config of another plugin
wdym "put it in a config"
Hello, what is the version of log4j for spigot 1.18.2 ?
i have custom menu in peluxMenu so i need use this placeholders for menu
all text settings in config.yml
add "spigot" 1.18.2 to your pom.xml, then Ctrl+B it and you'll see spigot's pom
okay thanks
and what's the issue? the other plugin will simply call setPlaceholders on your configured messages etc
how do this?
I'm giving up
just write %horse_heath% in config.yml ?
^
ok
there is nothing...
well, looking the jar is working
Why do you need to access log4j directly?

Just use slf4j?
it's cross-compatible ?
See that log4j slf4j jar :p
?
slf4j is an api
log4j-core 2.17.0 is what you need
then I'll use it
my plugin is only for 1.18.2
so?
i don't see how adding slf4j would provide any log4j AbstractFilter class
they want to do this @chrome beacon https://blog.jeff-media.com/how-to-read-or-block-spigots-console-output/
I have no idea what they want to do which is why I asked
?paste
https://paste.md-5.net/onepebiqel.cs - this true?
no
did you read the PlaceholderAPI page at all?
it doesn;t look like it
i see tutorial in yyoutube
You keep misspelling your health placeholder btw
I already registered the required classes
ah hahaha yea))
They have that in another plugin
you only need one class to implement your own placeholders
Looks correct
?
ofc you need setPlaceholder... whereever you want to replace holders
I have explained this to you already.
Whereever you want to replace %horse_health% with the horses health, you call setPlaceholders
same for all other placeholders
so delux menu have code for placeholder api?
idk, check the plugin's description
as I understand it, in 1 plugin I create them and in the other I fill them in, right?
so the delux menu should do that?
or i do it in mine
Yes
How can i change ItemStack of placed ItemFrame? Like i have placed Frame, i want to change the display name of this item
so i not need write setPlaceholder in my code yea?
declaration: package: org.bukkit.entity, interface: ItemFrame
?
?
There is a frame at certain coordinates. I want to setDisplayName of this frame under certain conditions.
yes
Then call setCustomName on the frame
I want to add a NPC(fake-player) to a team to hide it belowname scoreboard
is that possible?
if yes what should be put in the hideEntry()
the name, I guess
but scoreboard teams always only use addEntry(String), so having a player object doesn't really help
Players are added differently to scoreboards than entities
Entities you add the stringified UUID.
CraftTeam#addPlayer just calls getName() on the player and throws that to addEntry
but in either way you wouldn't need any bukkit entity, just add the name or the UUID as string to the entries
using Teams if there is no bukkit entity I don;t believe it will be added
Hello, I have a plugin who listen to console and send to a webhook the console messages but when making rl confirm, I get this errors :
[12:33:04 ERROR]: [club.minnced.discord.webhook.WebhookClient] Encountered 429, retrying after 3000 ms
[12:33:04 ERROR]: [club.minnced.discord.webhook.WebhookClient] Encountered 429, retrying after 3000 ms
[12:33:04 ERROR]: [club.minnced.discord.webhook.WebhookClient] Encountered 429, retrying after 3000 ms
[12:33:04 ERROR]: [club.minnced.discord.webhook.WebhookClient] Encountered 429, retrying after 3000 ms
[12:33:05 ERROR]: [club.minnced.discord.webhook.WebhookClient] Sending a webhook message failed with non-OK http response
club.minnced.discord.webhook.exception.HttpException: Request returned failure 400: {"message": "Invalid Form Body", "code": 50035, "errors": {"username": {"_errors": [{"code": "USERNAME_INVALID_CONTAINS", "message": "Username cannot contain \"discord\""}]}}}
at club.minnced.discord.webhook.WebhookClient.failure(WebhookClient.java:757) ~[DynumoBotPlugin-1.0-SNAPSHOT.jar:?]
at club.minnced.discord.webhook.WebhookClient.executePair(WebhookClient.java:832) ~[DynumoBotPlugin-1.0-SNAPSHOT.jar:?]
at club.minnced.discord.webhook.WebhookClient.drainQueue(WebhookClient.java:801) ~[DynumoBotPlugin-1.0-SNAPSHOT.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]```in loop
Here is my code :```java
@Override
public void onEnable() {
saveDefaultConfig();
Logger rootLogger = (Logger) LogManager.getRootLogger();
Filter myFilter = new LogListener(this);
myFilter.start();
rootLogger.addFilter(myFilter);
}``````java
public class LogListener extends CAFilter {
public LogListener(DBP dbp) {
super(dbp);
}
@Override
public Result filter(LogEvent event) {
String message = event.getMessage().getFormattedMessage();
String sender = event.getLoggerName();
if(message.length() > 400) return Result.DENY;
String webHookURL = dbp.getConfig().getString("webhook-url");
if(webHookURL == null) return Result.DENY;
try (WebhookClient webhookClient = WebhookClient.withUrl(webHookURL)) {
// Change appearance of webhook message
WebhookMessageBuilder builder = new WebhookMessageBuilder();
builder.setUsername(sender); // use this username
builder.setContent(message);
webhookClient.send(builder.build());
} catch(Exception err){
dbp.getServer().getPluginManager().disablePlugin(dbp);
}
return Result.NEUTRAL;
}
}```
Username cannot contain "discord"
because it's trying to send upper messages
[club.minnced.discord.webhook.WebhookClient] Encountered 429, retrying after 3000 ms
so the webhook name will be club.minnced.discord.webhook.WebhookClient
then strip discord from the username, idk
the problem is the [club.minnced.discord.webhook.WebhookClient] Encountered 429, retrying after 3000 ms
it creates a loop
then ignore LogEvents where the sender's name is club.minnced.discord.webhook.WebhookClient
hasJoinedBefore
okay thanks
hasPlayedBefore*
yeah thanks
Hi, im making a mine system for my plugin and one question about was how can i place block without making the server lag,
i saw this post https://github.com/TheGaming999/BlockChanger but i can't set multiple blocks in one any idea of a faster way to set random blocks in a cuboid?
how do i use custom yml files in my plugin
scroll and you will find it there
ty
how many blocks are you setting and how often ?
what if u want getDataFolder(), data, config.yml??
like another folder
don't know, im testing with 10.000 blocks in 10 minutes
File dataFolder = getDataFolder();
File subFolder = new File(dataFolder, "sub");
File fileInSubFolder = new File(subFolder, "myfile.yml");
thx
ofc you wanna create the subfolder beforehand, using mkDirs()
dead chat
So is there any other ways to achieve that goal?
have you even tried adding them by name or UUID?
try before looking for an alternative
adding a player by UUID won;t work
But I do have a memory of a packet based NPC not working in Team
Yes but it semed doesnโt work
So any idea about how to remove the belowname scoreboard
So it is a packet based NPC?
Someone?
you should tell us how you're placing blocks (and making server lag) in the first place
(I assume it's the vanilla worldedit way)
with this method
but the problem is i can't use more blocks only one so for a mine is not quite good
i stumble upon this post and so i was trying to use this and last post made on this thread was this git repo https://www.spigotmc.org/threads/methods-for-changing-massive-amount-of-blocks-up-to-14m-blocks-s.395868/
I think yes ?
It is from citizen2 plugin
You will probably have to send yoru own Team meta packet
citizens? Then it shoudl work just fine
they are full Bukkit entities
you are doing it wrong then
The belowname scoreboard is display 0 as health
It is the only plugin on the server :l
I advise you look at source code of other plugins and see how they do it lag-lessly
one example https://github.com/Drawethree/X-Prison/blob/master/modules/core/src/main/java/dev/drawethree/xprison/mines/model/mine/reset/GradualReset.java#L24 and https://github.com/Drawethree/X-Prison/blob/master/modules/core/src/main/java/dev/drawethree/xprison/mines/model/mine/reset/InstantReset.java#L22
Run command /scoreboard objectives list and see what it returns
Nothing :l
seems it does the same thing as the https://www.spigotmc.org/threads/methods-for-changing-massive-amount-of-blocks-up-to-14m-blocks-s.395868/
got my brushes working real nice for my new minigame ๐
The current block systems is not optimized for prison
I used to work with a optimized systems where blocks are all stores in ram and then handle the mining task like: mine the whole layers or mine the whole mine with the complexity of O(1)
i think i will start using an API for now, for the mines
Nice
@tender shard I think I have the answer for "Issues when using Paper ?"
https://blog.jeff-media.com/how-to-read-or-block-spigots-console-output/
ty ๐ i managed to get it nailed down with a bresenham line-like algorithm and tuned just right. it feels really nice. my vids dont do it justice, weird frame drop on OBS when recording on my mac ๐ฉ โ got everything nice and asynced where i can too. its feather light even with massive arena canvases so far ๐
the brush anyway, the bucket isn't async lol โ i experimented a lot with it and didn't get the performance i wanted. https://github.com/TheGaming999/BlockChanger is interesting though but tbh overkill
using a regex to remove the ยง + the character after with :java event.getMessage().getFormattedMessage().replaceAll("ยง.", "");
Does that work? If so, i guess ChatColor.stripColors should work too
I think it will works
I use java event.getMessage().getFormattedMessage().replaceAll("\u001B(.*?)m", "");Because I have a strange thing with a square with numbers and after a m
with this the message is correct
i just wanted to open the blog and it said "couldnt establish database connection"
so I got out of bed when I realised, yeah it's the daily backup that takes 3 seconds. and I opened the site in exactly those 3 seconds lol

I think, not sure but I think
Looks like I'm about to find out xD
dude it's really 3 seconds. I just made this number up, but it's correct
== is for reference comparison .equals() for content comparison
frostalf.getCat() == null ? "Frostalf does not have a cat" : "Frostalf bought a cat " + frostalf.getCat().getType().name();
npe, cat has no name
It's to represent an enum name lmao
I think I might just sneak one into my apartment
cat type
maybe 2
NICE
smelly cat is a type ๐
Ur a smelly cat
I had a smelly cat. Alwasy tried to stick its ass in yoru face.
I have spigot as dependency added using maven (because I don't want to include spigot jar through intellij idea because it is then decompiled, and this way I get the sources) , but I cannot access obc and nms this way, I saw on the hub spigotmc org/nexus/content/repositories there is bukkit but it's only up to 1.15.2. What dependency do i have to add to get CraftBukkit and NMS (and preferably mojang.authlib)?
can i make intellij not index a certain class/file? i have a map with 1000 entries and it really eats ram
?remap
?remmap
?mappings maybe
Compare different mappings with this website: https://mappings.cephx.dev
ah
above link is for you
me?
yes
ty i'll look into it
cephx or jeff-media?
maybe I said my question wrong, I want to add maven dependencies


