#help-development
1 messages · Page 1220 of 1
😮💨
Anyone who can help me 🙂
why would you use skript if you can use java?
For like scoreboard or something, just so i can easy get it. But do you think it's easier just to make a scoreboard in a plugin and take the placeholders in that?
Just use an existing scoreboard plugin
True, but still know how to use it in script it just says it can't understand the expression...
If I have a custom item that launches a projectile (snowball) and it hits a player and I detect it and damage the player, how can I make it so that the shooter of the projectile is equal to PlayerDeathEvent#getEntity#getKiller if the player dies from the damage I give them?
In other words, how can I know the killer of a player if it is from a custom projectile and custom damage?
Is it possible to assign a killer in ProjectileHitEvent?
I'm having a problem with placeholders. I'm creating my custom placeholder with PlaceholderAPI (extending the PlaceholderExpansion class).
Heres my code:
https://paste.md-5.net/zanenakayu.java
Here is the code of me registering it in the main class:
https://paste.md-5.net/mawirituda.cpp
Ingame when i run /papi list, "glarkourparkour" shows up.
But whenever I try using the actual placeholder with commands like:
/say The best food is %glarkourparkour_featured_course_author%
It doesn't work. I even have a debug message under #onRequest(), but this does not print out aswell.
DamageSource (specifically the builder) to construct a damage source that has the player as the causing entity
I figured out that I can send in a damage source entity when damaging the player
Do you mby know how to use it in skript? Or are you also trying to fix so it works in general?
I don't know how to use it in skript, I'm just trying to create a custom placeholder that works ingame.
Ooh, okay. Don't know if you can do it in that way tho
You can use /papi parse me %glarkourparkour_featured_course_author%
Then see what the output is
whats un1bande?
Ooh sry didn't remove it mb
/papi parse me %glarkourparkour_featured_course_author%
THis didnt work
just printed out unparsed placeholder
But it's a plugin i work on. It's like gangs, it's "bande" in danish. It's something that many danish prison servers has.
Okay, idk then 😦
MAIN.getLogger().info("Requested placeholder: " + params);
Is what I'm using under onRequest() function
And this does not run.
So yeah something is fked up
Idk what doe
I have tried the last 3 hours i think to get my placeholders to work in skript. But don't know how 😦
any ideas on how to fix this? I can get the file manually without problems, but gradle at github actions is giving this
Okay wtf, I started using onPlaceholderRequest() and it works now
So why tf didnt onRequest() work...
Could it be the reason why my placeholders dosen't work in skript you think?
Guess he's blocked GitHub
Idk, I watched kangarkoo video, he used onRequest() and it worked for him, the API also specified that I can override either onRequest() or onPlaceholderRequest()
I'm too lazy to break my code again but probably onRequest() runs if a console tries to access the placeholder or sht like that.
Mine just give me error at @Override
@Override
public String onPlaceholderRequest(OfflinePlayer player, @NotNull String identifier) {
if (player == null || player.getUniqueId() == null) {
return "N/A";
}
I have more than that tho.
Show me your code
Like the full class
Okay 2 sec
package dk.un1log1n.un1bande.placeholders;
import dk.un1log1n.un1bande.Un1Bande;
import dk.un1log1n.un1bande.database.DatabaseManager;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public class BandePlaceholders extends PlaceholderExpansion {
private final Un1Bande plugin;
private final DatabaseManager databaseManager;
public BandePlaceholders(Un1Bande plugin, DatabaseManager databaseManager) {
this.plugin = plugin;
this.databaseManager = databaseManager;
}
@Override
public @NotNull String getIdentifier() {
return "un1bande";
}
@Override
public @NotNull String getAuthor() {
return "Un1Log1n";
}
@Override
public @NotNull String getVersion() {
return plugin.getDescription().getVersion();
}
@Override
public boolean persist() {
return true;
}
@Override
public boolean canRegister() {
return true;
}
@Override
public String onPlaceholderRequest(OfflinePlayer player, @NotNull String identifier) {
if (player == null || player.getUniqueId() == null) {
return "N/A";
}
String playerUUID = player.getUniqueId().toString();
int bandeId = databaseManager.getBandeId(playerUUID); // Find bandeID
// Hvis spiller ikke har en bande
if (bandeId <= 0) {
return "N/A";
}
// Placeholder: %un1bande_name%
if (identifier.equalsIgnoreCase("name")) {
String bandeName = databaseManager.getBandeName(playerUUID);
return bandeName != null ? bandeName : "Udefineret";
}
// Placeholder: %un1bande_level%
if (identifier.equalsIgnoreCase("level")) {
int bandeLevel = databaseManager.getBandeLevel(bandeId);
```
return String.valueOf(bandeLevel);
}
// Placeholder: %un1bande_bank%
if (identifier.equalsIgnoreCase("bank")) {
double bandeBank = databaseManager.getBandeBank(bandeId);
return String.format("%.2f", bandeBank); // Formatér som decimalværdi
}
// Placeholder: %un1bande_id%
if (identifier.equalsIgnoreCase("id")) {
return String.valueOf(bandeId);
}
// Placeholder: %un1bande_owner%
if (identifier.equalsIgnoreCase("owner")) {
String ownerUUID = databaseManager.getBandeOwner(playerUUID);
return ownerUUID != null ? ownerUUID : "Udefineret";
}
// Placeholder: %un1bande_members%
if (identifier.equalsIgnoreCase("members")) {
int memberCount = databaseManager.getBandeMembers(bandeId); // F.eks. antallet af medlemmer
return String.valueOf(memberCount);
}
return null; // Hvis placeholder ikke genkendes, returner null
}
}
That's everything `
Ur having an error because you are overriding the method with wrong parameters
Change OfflinePlayer to Player
3AM for me
Damn
Okay, so dumb question, but how do i turn on UTF-8 if that's possible in Intellij Idea. Can't use the danish letters "Æ, Ø & Å"...
Just my letters that's looks weird cause i use some of the danish letters.
It should say "Indsæt Penge" "Tryk for at tilføje penge til Bande Banken"
In English:
"Deposit Money" "Click to deposit money to the Gang Bank"
Mby it's because i use a config.yml to set it...
It could be the error i think
But i'm pretty tired so i think i will fix it later. Good bye
you should set utf-8 on whatever build tool you are using
I guess i could just make a encoder or something in the plugin, that goes in the config when it's used and then edit the letters. Could be a idea i think. Could try and see if it's possible.
Don't know if it's called encoder but my english is pretty bad..
I can try and look on it before i go too bed. But goodnight man
It's already set to UTF-8, think it's because it's from the config.yml...
It's set to UTF-8 everywhere so i think it's because config.yml is stupid aha
But thanks tho
could you show us your pom.xml or build.gradle please
The whole file?
yes
It's here where UTF-8 is set
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dk.un1log1n</groupId>
<artifactId>Un1Bande</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Un1Bande</name>
<description>Et Custom Bande Plugin lavet af Un1Log1n</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
The rest is just repositories & dependencies
You still here?
I'm goin' to sleep can you mby just send a dm if you find the error/solution? @golden turret
how do i return a variable in a Supplier?
i don't want the value of the variable when the supplier was made, i want the current value
int value = 1;
Supplier<Integer> supplier = () -> value;
value = 2; // supplier will now return 2```
supplier.get()
AtomicInteger, class field, do logic inside supplier instead of outside
honestly sounds like a bit of an
?xy
i got a loop section that basically just executes abunch of actions x amount of times, these actions could want to access some values like what iteration we're currently in and to do that i use suppliers which would always return 1 until i used AtomicInteger
it might seem like just more steps to make a for/while loop but it's just a simplified explanation
could you not have a local variable that stores the number of iterations (or whatever else you need) and just access that whenever needed?
it's an abstract class of loopsection that other sections extend like for loop and while loop, for loop would also want to register some loop values like the current object being iterated
not sure what loopsection is but i assume it's something along the lines of
public abstract class LoopSection {
public abstract boolean tick();
}
? because in that case using an atomic int wont even be needed
like so a for loop implementation could have a constructor that takes in a consumer<T> and an iterator or something and pass in the current object being iterated into that consumer every tick
public abstract class LoopSection extends Section {
public void executeSection() {
// executes the section's body, in this case calling executeIteration unless shouldExit() returns true
}
public void exitSection() {
// called after the section is executed to then continue execution of the parent section, in this case do executeIteration is shouldExit() is false
}
public Object getLoopValue(String name) {
// returns loop value
}
public abstract void executeIteration();
public abstract boolean shouldExit();
protected void registerLoopValue(String name, Supplier<Object> supplier) {
// register loop value
}
}
is a minified version that explains how it works
ah so the supplier in #registerLoopValue is the supplier you need the atomic int for?
yep
it has a constructor that registers an "iteration" loop-value with supplier () -> iterations.get()
im wondering if you could just return the current loop value in #executeIteration and storing that where needed rather than having a separate method and supplier for it
im assuming the loop value is just the current "value" the loop is on
loop value is the current value that a for loop would be in rn and it could be the amount of iterations already done, depending on the given name
there's multiple loop values
oh right yeah i didnt see that
even then you could have like a record that contains data about the loop value
then executeIteration would return that record
you could add a generic too like
public abstract class LoopSection<T> extends Section {
// ...
public abstract T executeIteration();
// ...
}
and a for loop implementation could have the T set as
public record ForLoopValues<T>(int iteration, T value)
forgor syntax of records i think that's right
the thing is the section's body has no idea what the executeIteration returns since technically executeIteration is the one that executes the body
it's possible but it'd just add complications
does the section need to know what executeIteration returns? you could make an interface depending on what the section expects from the return value of executeIteration. because currently, are you just inputting magic strings and checking null in section?
it's currently like this:
root section -> multiple actions and inner sections
inner section -> multiple action and more inner sections
action knows what section it's currently in so if it wants to know what iteration it is in it could first check if it's in a LoopSection then cast the section it's in to a LoopSection and then do LoopSection#getLoopValue("iteration")
if it's expected to always have an iteration property, you could just make an interface with like a #getIteration method
if not you could cast the return type ig
and do something different depending on what it returns
you mean make a getIteration method in LoopSection?
i mean having executeIteration return like a T extends LoopValue
where LoopValue is an interface that contains a getIteration method
so whenever you execute on that section you get its current loop value
and other properties depending on the implementation
i could try doing that
https://helpch.at/docs/1.14/org/bukkit/inventory/meta/ItemMeta.html
Does anybody know since they added string for CustomModelData, how i would use that when the method is forced to integers?
Use NBT Api
use PDC instead since you're using 1.14+
?xy potentially? if its for a resource pack just change the tag to use integers instead of strings
I get your point, but i rather dig into the option of using strings, since this is a new feature and will make many of the upcoming tasks a lot easier. Thats why i wanna find out how i use string for the metadata.
custom model data strings is from like 1.21.3 or something
?paste
I am attempting to make it so packets for only certain chunks are sent to the client, giving the effect that only certain parts of the world have loaded (on client side)
i tried tinkering with protocollib but failed miserably, anyone got ideas?
any obvious issues with this? its some string manip https://paste.md-5.net/ikadirusav.cs
i need someone in my team who know how work with byte code
i need use it for remove reflection 🙂
sec i translate for more information
for those who don't know, I'm doing a project. Combining Spring with Bukkt api. In short Spring is a framework that provides convenient mechanisms for developing backend sites. DI, JPA, Controllers and all this is based on anotations for convenience. And to leverage all this Spring uses byteCode generation instead of reflection to optimize searches
i trying create DI too
so i want find someone who know how work with bytecode and help me with it
and why do you need it to "remove reflection"
byte code manipulation is more difficult than reflection
spring just uses cglib
optimize code
reflection is long
And writing bytecode won't help with that
i will have many annotations
you still cannot access private methods with bytecode
oh sorry i mean ASM
yes and this help with remove reflection code where is possable
I did a LOT of work with IDA and ASM modding NeverWinter Nights. Avoid it if at all possible
No it won't
Where do you think that will remove reflection?
you sure?
i think this not mean you cant create proxy class with ASM
i was hear this better then reflection
???
ASM is just a bytecode lib
You need reflection in some places and using ASM will not help you
Unless you really wanna transform the base JDK's classes at runtime
Are you even able to properly do that
Something tells me no
Mixins can
Mixins cannot afaik
yes reflection need but the less the better.
Spring framework based in MANY annotation
just image what will be if you will use only reflection
I believe I have mixin'd into String before
I think you just have zero clue what bytecode injection even is
Are you sure
not entirely
Last time I asked in fabricmc they told me no
Like I said I'm not very good at using byte code to create and read classes so I want to find someone who is good at it. Only what i know use byte code this better then reflection
end i need it
Using bytecode is not better than reflection
why spring use it then
and why is not better
Because it does not allow you to do more than reflection
if you are not overwriting existing classes
And the only way to get annotations of something is reflection lmao
You could write bytecode to call the reflection but it's just pointless
sir this is help-dev
rad I'm stupid
I know
so you mean i not can create class ? And reading class with reflection is faster then byte code?
lets say ASM
ASM not faster reflection ?
You can create classes but can only load them in another classloader iirc
But what the fuck do you even mean reading a class
readig class
are you trying to actually create new classes on teh fly and not just instances of existing ones?
That does not explain anything
And reflection also isn't slow at all as long as you cache it
ASM allow you read class like file if i remember
It makes zero sense to parse and read a class file that's already loaded at runtime
Ye lol
yeah I don't see any point in what you are doing
so this mean you think reflection is faster
why is speed an issue here?
premature optimisation
you say me or him?
I was replying to elgar
creating Proxies at runtime is not going to have a speed issue using ASM or reflection
pick whatever is simplest to do
Reflection isn't slow as long as you cache it
hm
I'm only guessing but I have an idea hes trying to inject new classes from file or even through db queries
basically tryign to script runtime actions
me when I store a classfile in postgres
yep 🙂
method handles are faster than directly invoking a method sometimes, too
if you are making your own implementation of the server, you don't need reflection or annotations as you could just modify the code as you see fit. If you instead mean to say you are creating a plugin and need to make methods that are private or whatever accessible annotations is not going to fix this. Annotations is a processing mechanism that either happens at compile time or at runtime which neither of which will change how the server code runs because annotations doesn't bypass the JVM mechanisms which is what reflection does. If this plugin is not going to be released for the public and instead just your private server then once again you could just modify the server code directly that you are needing access to without all this complex unnecessary stuff. Proxying classes is a method that can be used but its not more optimal then reflection nor is it inferior as it depends on the scenario. With spigot most times reflection is going to be the best
alr
thenks
when i remove BELL using EditSession#removeBlocks in a selection, only one of these bells gets removed
using FAWE
i would ask in the FAWE discord but their support is basically dead
es.replaceBlocks(select, new BlockMask(es.getExtent(), new BaseBlock(BlockTypes.parse(material.toString()).getDefaultState())), BlockTypes.AIR);
the material is BELL
still ask
how would i replace every state then
BlockType is a mask or whatever it was called
nvm, use a SingleBlockTypeMask
session.replaceBlocks(region, SingleBlockTypeMask(session, BlockTypes.BEDROCK), BlockTypes.AIR)
how often do you need to access a array[index] before it's worthwhile to put it into a temporary variable?
depends, as long as you stay under 4 local variables they have the fastest access
?nohello
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
give me that web can i paste my code
?paste
and what is the problem
Error occurred while enabling ExcellentServerManager v2.0 (Is it up to date?)java.lang.NullPointerException: Cannot invoke "me.clip.placeholderapi.PlaceholderAPIPlugin.getLocalExpansionManager()" because the return value of "me.clip.placeholderapi.expansion.PlaceholderExpansion.getPlaceholderAPI()" is nullat me.clip.placeholderapi.expansion.PlaceholderExpansion.register(PlaceholderExpansion.java:147) ~[ExcellentServerManager-2.0.jar:?]at org.abo876.excellentServerManager.ExcellentServerManager.onEnable(ExcellentServerManager.java:78) ~[ExcellentServerManager-2.0.jar:?]at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.19.4.jar:git-Paper-550]at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.19.4.jar:git-Paper-550]at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.19.4.jar:git-Paper-550]at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.19.4.jar:git-Paper-550]at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:638) ~[paper-1.19.4.jar:git-Paper-550]at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.19.4.jar:git-Paper-550]at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.19.4.jar:git-Paper-550]at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1104) ~[paper-1.19.4.jar:git-Paper-550]at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.19.4.jar:git-Paper-550]at java.lang.Thread.run(Thread.java:1583) ~[?:?]
is your plugin depending on papi
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
</dependency>
show your plugin.yml
name: ExcellentServerManager
version: '2.0'
main: org.abo876.excellentServerManager.ExcellentServerManager
api-version: '1.19'
authors: [ my discord user name .5_05 ]
description: This is the best plugin in the world
website:
softdepend: [PlaceholderAPI]
?
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
getLogger().severe("PlaceholderAPI is enabled!");
new PlaceHolderExpansion().register();
} else {
getLogger().severe("Could not find PlaceholderAPI! This plugin is required.");
}
I mean, if it's required, don't softdepend
but i dont want it required
I'm so confused
?
the JVM has 5 specialized instructions for the first 5 locals iirc (or was it 4?) one is always occupied by this, and thus
@blazing ocean
Why did you ping him
that is not going to make a performance difference...
@sterile axle
hmmmmm
Pings rad again 💀
@blazing ocean
And now you're on the blocklist
lmaooooo
Congratulations 🎉
aight im out of here
NO
no you're not
What is going on
Caused by: java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
?
can you not split by "?" or something?
Escape it
invalid regex
ah yes of course bleh
regex in a nutshell
the problem i have is that this is a string input
how do i tell regex 'hey split by this string'
Escape the ?
Pattern.quote(String)
String#replace(CharSequence, CharSequence) doesn't do regex does it
i have the split string as variable input. sure, i can escape the questionmark where i call it, but thats kinda not the point
hm, delmimter("", split) maybe?
no thats an int
zzz
Impressive
.
you got replied
?
.
pretty sure this dude barely knows java, or quite possibly barely knows his way around a computer
this is pretty pointless
are you sure? they have "JAVA" in their name tho
In my experience in this chat the more people advertise their java skill in bio (and now name) the worse they are at Java
Having Java dev in bio is big red flag that they do not know Java
JAVA PROFESSIONAL (started this weekend)
meh it's usually just kids who watched some videos and wanna make stuff, which is fine. but it's like, meet me half way. the stuff like "not working", "theres an error", upload random text and ask for help bs gets tiring after well over a decade (for me) at this point of seeing it
haha true
like, ask a full question, show your entire code, what did you try, do you have any ideas about what the issue might be...what can you contribute to this discussion? i am not google. or better, in 2025, i am not chatgpt.
if you can't bother to meet me half way to the finish line, then i am not going to entertain you, gud nayt
💀
This smells like scam
its a request, not a requirement i guess? in the rules
it does
hes asking for your country of residence and his answer to asking why he wants to know is 'i dont have time for this' lol
How can I send all arguments because I did a silly and accidentally only made the command send back the first argument
using args[0]
can't you just concatenate them?
help
You've already been helped.
Stop being annoying before the whole server blocks you.
no one helped me
this is help?
legendary message
Please don't tag random ppl when.
You can reply without the tag.
I'm sorry if this guy is just using a translator or something but "ther is a proplem" is so funny
no translator is that bad
Yes
You are using the PlaceholderAPI
so it is required for you to run code from it
Your plugin only softdepends on it, which doesnt make sure PlaceHolderAPI is loaded before your plugin, so if your plugin loads first it cant find the code from the API making it error
If you don't want it as an dependency, don't use it
it`s depend
and i run it on the server but it's the same
is this the x coordinate of the chunk corner, or the actual chunk coordinate? I can't tell
chunk coordinate
k
the actual position can be calulated easily
nah im asking coz i need mediumint
having actual coords would need to be shifted to fit
on a different topic, why does this error appear? the previous code cannot not return something
(its a switch on a enum with all branches filled, all returning something)
return the switch expression
return switch(foo) {
case Foo.FOO -> 123;
case Foo.BAR -> 456;
case Foo.BAZ -> {
yield 789;
}
};
what
i mean, i can't see your code
why would seeing the full switch statement help here? its complaining that it's 'outside a switch expressions' which i doub is affected by the other cases
genuinely curious lol
i need to see the code to know what intellij is seeing to see how you can fix it
You're annoying just fork it over context almost always helps
otherwise i literally cannot help
It's because you're yielding instead of returning
well, it's not exactly a switch expression, that's the thing
yield can only be used in a switch expression
like this, returning the switch expression; once the code is adjusted as such it'll be fine
what the fuc
that error is misleading as hell
Not really you just mixed yield and return and never return from the function
eh, it's not wrong
i read that as 'switch is not switch'
switch expression
Hi! Is it possible to make a encoder or something like that, that checks the config.yml when in use and then change som letters so UTF-8 works on them? Cause i'm from Denmark so i use some danish letters that won't work in the config when i use them ingame from the config? Hope you understand my english aha
Save the file in UTF8 with your text editor
The thing is that in the config the letters is right but ingame it's not...
Did you save it with UTF8
Yep, it's all saved in UTF-8
Try starting the server with the -Dfile.encoding=UTF-8 flag
ok this is cursed
case STRING -> object instanceof String string ? string : null;
JS ahh
In the start.bat right? I'm using localhost to test on
yes
Alr will try that
Like this?
@echo off
java -Xmx1G -Xms1G -jar server.jar nogui
-Dfile.encoding=UTF-8
pause
No, java -Xmx1G -Xms1G -Dfile.encoding=UTF-8 ...
Thankfully Java 18 and above always uses utf8 by default so that environment dependent issue doesn't happen
But why not java 8? I'm just trying to make a plugin for 1.8.8, but then UTF-8 isn't set for configs and that 😦
Because ancient
If your original config is created as UTF8 it will be saved/loaded as UTF8
Hello! I am very new to spigot and I've been searching through the discord but couldn't find any great examples. Could you in theory register a custom block natively in spigot and then have a client using a mod fill in the gaps?
Looking for an example for registering the block on spigot specifically!
No
Your mod would do it, or you use a platform which supports both Spigot and mods
Hey, since 1.21.2 you can no longer define the effects in a FoodComponent, how should you do it now? I can’t find anything similar to a ConsumeComponent
ConsumeComponent is missing from the api
The platform injects custom blocks into Bukkits Materials
ho
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
i am going to bring forth exactly one pr
I did a pr once. It was rejected 😦
i want to swap the call order for two events in the player logout lol
Hmm, not sure if this will help but I am trying to create a system that allows Chunker to read the custom blocks on Java. I can't seem to get Fabric to do it so I was hoping another plugin loader would. Thanks for the insight though, perhaps this approach isn't the right one.
It was to Bungee not Spigot though
Happens to the best PRs
PR exists already
I only wanted to expose teh Map behind the Config
Is just stuck in serialization hell
oh hi choco, have you seen my question the other day?
ive been told u know about spigot internals
ouch
Everything is right in my config and checked if it's UTF-8 and it is, it's just when i use it in a GUI ingame it isn't but it's fixed now
What's the problem exactly?
(can't see PRs without account)
It it an actual yml config you are using? If it is you may be suffering from teh system code page. I see its fixed for you though
I think Doc updated it a few days ago so it just needs another review
I'm using a file i called config.yml. But someone gave me a line to type in my start.bat, so it's fixed now..
is there a way to create a sort of invisible wall that projectiles can pass through but players cannot?
my new rule of wisdom: never abstract away method parameters using default value overloads
foo(bar a) {}
foo() { foo(defaultA); }
this might work for simple case like this, but after a while you will get combinatorial explosion of function parameters that need to be default
instead be more verbose and just have pass the default value through parameter itself
foo(Bar.DEFAULT)
or smth
You do that only when the default behaviour is obvious and documented. There's a reason we have Javadocs
tbh those overloads are kinda evil because it might make your code cleaner but then you're gonna scratch your head of how to decouple the code
i would rather not even provide such thing even if it was documented
it just that such methods succeptible to deprecations in the future
All methods are susceptible to deprecation
.equals aint
again kotlin moment
kotlin allows to pass default values however you want
by using parameter names lol 😄
fair enough,
man i want optional arguments to be a thing in java
i dont want to learn kotlin just for one thing
kotlin is just a hack on top of JVM
mostly everything you can write in Kotlin, you can do it java
albeit in such a nasty way
Kotlin is also a multiplatform language
Gradle also supports x86 assembly
and ARM
Right, there's a huge community for kotlin multiplatform
KMP is amazing for app dev
There's even https://klibs.io/
ion wanna have to learn another language just for optional arguments in methods
i think ill stick to java
You know, Kotlin has lots of other features too!
none of which i will ever use!
Doubt that
only times ive really learnt a new language is if it enables me to start doing something new
or if its far better than what i already use
Does your java have kotlin's amazing null safety and chaining
no but we can type
Right but a lot of people don't use optionals
i.e. spigot
Spigot doesn't use optionals so you're gonna just end up with a trillion not null checks and shit
for custom methods
whereas with Kotlin you have actual nullable types
just write your code properly
?
nvm im cooked
disregard that sentence it made no sense
ive been IntelliJ-ing too much
does anyone know how I can make a mob drop xp if it wasn't killed by a player?
someone explain this to me
are you sure you are using the latest jar
I've gone through the documentation and I'm assuming entityDeathEvent is the right place to be messing with, but i can't find any method that would let me decide whether the mob drops xp or not
yes
i even changed the name of the class just to be sure
look at recaf
Correct package name?
do you have it loaded twice
?
I'm wasting my time aren't I.
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDeathEvent.html check and change the drops of this i guess
declaration: package: org.bukkit.event.entity, class: EntityDeathEvent
Is there a way to get the "best" possible drop of a block?
I want to remove a block by code but I still want whatever block that is to drop the "best" possible default drop. E.g. stone instead of cobblestone or ice instead of nothing.
Blocks that don't drop anything (e.g. reinforced_deepslate) should not drop anything as well.
can I get some help developing my Minecraft server it runs on purpur and I’m pretty sure that runs spigot stuff
Not sure if there are blocks where a silk touch pick won't be able to yield something, otherwise I can just use that by default
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
actually
declaration: package: org.bukkit.block, interface: Block
- silk touch pick
should do it
Alright lets hope it will stay like that and they won't decide that Grass blocks need silk touch shovels specifically, thanks
it doesnt
I wasn't sure if there's any material where it is like that. So for now I'll just pray they don't change it
reason i said pick is bc 90% of the time im holding it and when i randomly mine a grass block its still grass
i know silk touch on picks works on more or less anything affected by silk touch
someone on the internet just accused me of being old because I played civ 3 on release
Grandpa
call me grandpa again and I'll lobby to raise your rent by 30% in the next two years
Sorry uncle
if you have that kind of power go after the people that actually should bleed money lol
stop and think for a minute about who has this kind of power
im painfully aware
I wasn't even born then
You're just old
bro lives under a palm tree
does anyone know if packetevents is able to detect unauthenticated packets like handshake? ive got java public class PacketEventsPacketListener implements PacketListener { @Override public void onPacketReceive(PacketReceiveEvent event) { // do stuff } } but it doesnt fire for handshake packets
.
project blocks to the player AND move them back if they move into it
how do people end up being in 100 servers
you cannot possibly need to know 100 sources of information like that
about half of them are for the emoji's/stickers/gifs
the other half is for informational purposes for variety of stuff
for example, I am in paper but I don't actively engage in that discord
mainly because they would probably ban me if I did 😛
well the wall has to be invisible
🚫
players from either side shouldnt be able to move to the other
so push the player back is the plan then
with a barrier block wall
I think I'm in 50 servers max
and I can prolly leave half of them without even noticing
there is no reason to do scoreboard-related things without using the API
I want prefixes that are automatically done
And tab sorting
with luckperms
so if I ever add ranks nothing happens
So why can't you do that with the api
What API and how?
I can't find much information on it.
The Spigot API?
hello. I am making a minigame Spigot plugin. in my Spigot plugin I'm trying to show a player's name in chat. however, it does not display the way I would like. I've tried player."getName()", "getDisplayName()", and "getListName()". all of these are returning the same value for me. they are returning a plain white text only version of the player's name. however that is not what I would like. I would like the version of the player name that shows up on the tab list, and in chat, such as with death messages and such. in my minigame, there are multiple teams, each with their own color and prefixes. when a player is shown on the tab list, or the scoreboard sidebar, or the chat in a death message, their username has their color, and their team prefix automatically shown by Vanilla Minecraft. I would like to "get" this string, but I cannot seem to find a method that returns this version. does anyone know what method to use to get that built in vanilla formatting instead of the plain version?
I don’t think there is a method for that
really? huh, I'm surprised there doesn't exist a way to obtain this vanilla data. I guess I'd have to make a system to recreate it from scratch
You’d probably have to get the players scoreboard, figure out what team they are on, and get the prefix and colour from there
that's definitely what vanilla is doing already. wish we had access to that method
but alright I'll try that thanks
You could probably make a PR if you want to
declaration: package: org.bukkit.entity, interface: Player
add color in here and it will change their color of their name
this is only used in plugins and chat. There is another method to change their playerlist name as well
declaration: package: org.bukkit.entity, interface: Player
this is the method to obtain the version you are most likely seeking
it helps if you would just search the Javadocs as it does have a search bar other then just looking at the interfaces
They did say they tried getListName
Considering getListName isn’t a thing I assume they meant getPlayerListName
idk, but it will include color in it as it grabs the exact data that is set. The only way it wouldn't is if you are making use of packets to do all these things instead and thus the server is unaware of these things
so if they are using packets to show a custom player list to players for example and they modify how the names are shown using only the packets
then the server wouldn't have any information in regards to color since it was never set using the api
I am using 1.8.8
Why
but appreciate the resource
those methods exist on 1.8.8
and hasn't changed in functionality
oh sorry i didn't realize you sent me documentation
I thought you sent me an API or external plugin
okay, I tried all these methods already btw
they all return the same thing
are you using spigot and do you have any plugins modifying packets?
then not sure what you are doing wrong because I never had an issue in regards to chat where their color is not being set unless you have some other plugin interfering
it has always been a thing you use SetDisplayName to change their name/color in chat
or if you wanted to show their name in color in a message you would grab their display name
the only way the server wouldn't know about a players color is if you weren't actually using the api to set the color of their name to begin with
you're probably using PaperMC
I don't use paper
don't make assumptions about people
I am probably one of the biggest supporters of using only spigot
I went from CB to spigot. I have tried paper, but I don't like the development of it and some of its staff
I was once a BukkitDev staff member just like md_5 was long time ago 😛
I see. well that's pretty neat
indeed, but that aside the api methods should work. Even though you are making use of scoreboards maybe try using the api methods to set their names too?
sorry for making an assumption out of nowhere. anyways yeah I'm on regular Spigot, 1.8.8, my plugin, and world edit are the only things in the server
not sure if using the api methods would conflict but I don't think it would as the scoreboard should temporarily override even if you are setting the same colors
I am using Spigot to create and set the scoreboards as well
I meant, using the api methods to set their displayname even though scoreboard overrides it
as well as the teams, their color, and prefix
so that later you can use the api methods to obtain their color
Like I said, grab the players scoreboard, get their team, and then get the color and prefix of said team
yeah that's what I'm working on rn
I'll probably just do that approach tbh
either way, the api methods do work, just can't expect it to grab data it doesn't know about
with that, I am off to work now 🙂
in case you need a way to look at the javadocs better for that version even though I don't like people using outdated versions
here is this link
unfortunately doesn't have the search function
that's fine I can control + F. thanks for that resource. I think I may have visited this before at some point
Does anyone know how I can change the keybind to accept autocomplete answers using ctrl+y in IntelliJ?
it's vim
probably "Complete Command"
under keybinds
vim has the most wild hotkeys lo
though if you want vim hotkeys just use the vim hotkeys extension
i'm trying to but the ctrl y doesn't work idk why
i'd seek support from the intellij forums or support page
Is this your twin @blazing ocean
I think I broke deepseek
was curious to see if it would spot the logic problem in how I'm indexing my commands
it's been typing out text nonstop for about 5 minutes now while thinking
it's still going
ok now it stopped
How would I go about making a plugin that removes dolphins needing to go up for air?
I know how to "make a plugin" with commands and modded items but what I'm asking for is the logic that controls the dolphin mob
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#setRemainingAir(int)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#setMaximumAir(int)
declaration: package: org.bukkit.entity, interface: LivingEntity
Probably just set these to Integer.MAX_VALUE or smthing
is it possible to return the ResultSet of a SQL query, if within the method you try-with-resources the prepared statement?
Not really. pass a consumer into your method to process the ResultSet
bleh
return List<Object> it is
oh btw assuming a List<Integer> is stored in a List<Object> can you just cast it like you would primitives?
ie (ArrayList<Integer>) arrayList
casting would be unsafe. Probably better to stream.map
well, i have a check that guarantees it's in that format
i just want to deduplicate the function
specifically, there's a final field that guarantees its, for example, ArrayList<String>
(aka: what about it is unsafe? the way my code is structured might be able to circumvent it)
The returned Object may not be a parsable String to an Integer
ah
im not tryina cast string to int
i have a List<Object>, which i have a final field stating of what type 'Object' is
so i was wondering if i could just go if(field == STRING) -> (ArrayList<String>) cast
(workaround to not have to copy and paste the same function for every type it can be)
If your original is a List<?> yes, but unsafe cast. If it is List<Object> no
uh
how does ? work again
wait
primitives arent objects
riiiiight
can this be done with generic signatures somehow?
ideally I'd have one method spitting out List<T> but i cant figure out how to input the desired T atm
I'd still recommend you downcast using stream
if you are passing a Type (Integer) you can .map(type::new)
however ARE you talkign about Integer or int?
resultset can spit out Object in place of int i guess?
basically im trying to do this
just.. yknow, working
bc the alternative is to duplicate this function for every possible SQL type instead of just having to put the values into the switch
or as before, return object which also isnt ideal
Yeah you can;t easily cast T so your return is goign to be problematic
thats the crux. since my generic is Class<T> i wouldnt get primitives so i could have an intermediary in List<Object> but how tf do you cast to T lol
if I were you I'd return the List<Object> and stream cast once returned
i mean i could but the idea is to have this data manipulation in here, so you dont have to deal with those casts upstream lol
then there is no need to pass in T
public static <T> T convertInstanceOfObject(Object o, Class<T> clazz) {
try {
return clazz.cast(o);
} catch(ClassCastException e) {
return null;
}
}
that could work. Assuming o is instanceof clazz, can this throw the exception?
because if not, ill throw a runtime exception stating to not use reflection bc with the checks in place it cant hit it otherwise
example how the above would look when using it
final Class<int[]> intArrayType = int[].class;
final Object someObject = new int[]{1,2,3};
final int[] instance = convertInstanceOfObject(someObject, intArrayType);
does this work for collection datatypes too? i could return an array, but the situation is much more suited to arraylist
(im assuming yes but at this point i dont trust java as far as i can throw it lol)
it should work
anything passed to that method I gave above will have the compile time type Object
if you are still unsure I can show you the byte code of it
nah thats not why im asking, its just that java is jank
public static <T> T convertInstanceOfObject(Object o, Class<T> clazz) {
try {
return clazz.cast(o);
} catch (ClassCastException e) {
return null;
}
}
public static void main(String[] args) {
String k = convertInstanceOfObject(345435.34, String.class);
System.out.println(k);
}
byte code of this is as follows
public static <T> T convertInstanceOfObject(java.lang.Object, java.lang.Class<T>);
Code:
0: aload_1
1: aload_0
2: invokevirtual #2 // Method java/lang/Class.cast:(Ljava/lang/Object;)Ljava/lang/Object;
5: areturn
6: astore_2
7: aconst_null
8: areturn
Exception table:
from to target type
0 5 6 Class java/lang/ClassCastException
public static void main(java.lang.String[]);
Code:
0: ldc2_w #4 // double 345435.34d
3: invokestatic #6 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
6: ldc #7 // class java/lang/String
8: invokestatic #8 // Method convertInstanceOfObject:(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
11: checkcast #7 // class java/lang/String
14: astore_1
15: getstatic #9 // Field java/lang/System.out:Ljava/io/PrintStream;
18: aload_1
19: invokevirtual #10 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
22: return
i... think i understand it?
been a while since i looked at anything low level
btw, would it be better to cast the list directly or to stream it?
ie return results.stream().map(e -> genericCast(e, clazz)).toList();
depends, but streaming it might make it easier to understand in case you forget about it lol
doubt there is any significant drawbacks to either method
i think it makes more sense to direct cast it th en
uh
how do i get the class of a list lol
List<String> myList = new ArrayList<>();
Class<?> listClass = myList.getClass();
I don't have my IDE opened, so can't really check lol
but, it seems you have an array list already from your above code
you have ArrayList<T>
so just grab the class from there
thats a ArrayList<Object> unfortunately
nope
yeeea but i really dont want to have to write O(n) functions lol
map it is i guess
btw sanity check, its Integer.class coz getObject from set returns Object, right?
or do i need to make separate calls for integer entries
Class<? extends Object> clazz = items.getClass();
the annoying part with generics is the type erasure which in this case T gets removed
and without using reflection, it isn't a very straight forward way to get what you want XD
did you write this by hand
no
javap -c com.mypackage.MyClass
ah yea
this will show you the bytecode for a given class
I just got confused because you said you didn't have your IDE open
but yea I always forget about javap
right, I just used notepad to make a simple class
since I wasn't making anything complex lmao
how could i go about making an API for my plugin that other plugins can plug into and interact with the plugin in some specific ways?
Add methods that plugins can interact with inside your plugin or create an api module that has the backing for this that they can get from your plugin
hello i got questions on prepareAnvilEvent where my result item stuck in the result slot when trying to get them out
public static methods
s what i use at least
I expected better
i dont think public static methods is the best way to do it....
illusion its been two days lol
an API module might be the way, but how would people use it? ive never exactly made any sort of package
You're still breaking my expectations every day
do you know if jeff by chance has a post about doing library modules?
com.siliqon.pluginName.api.aReallyFancyMethodWow
The fancy proper way is having an API module full of interfaces and inject them using something like bukkit's service system
jeff might have something about APIs
thats cool and all but like
how would i do that
any tutorials or guides?
(jeff doesnt seem to have anything, its multiple nms versions using modules is the closest on his website)
would that change how you use those api methods? or could you still just go 'scope provided' and call the methods
hello
?nohello
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
basically make your interface, register it in your plugin and provide impl class. then anyone who wants to use your service just depends on your plugin in plugin.yml, adds your api pom as a dependency to their project, and gets your impl from the bukkit service manager while declaring your interface as the type
Bukkit Plugin for in-game player tutorials. Contribute to frostalf/ServerTutorial development by creating an account on GitHub.
dis is da wae (TM)
Exposing the api is simply for hiding code flow and building something long-term
the link I provided has an api module
the api module for it to work your main plugin has to implement it
otherwise the api never gets values etc
Here comes frosty sharing that one repo he has
we're talking about the bukkit service manager
your repo does not show that, so it's not applicable here
oh service manager
thought we were talking about providing an api module and how you do that
well more like how to do api properly in general lol
Interfaces n shi
alright well, if you wanna go outside of service manager, then sure look at frost's repo
anyway im going back to netflix bai
i have a question, i'm hosting a server in my community. i was wondering if how can i integrate the fog and ash effects in basalt biome in nether onto a world and not affect other worlds. i'm specifically doing this in my lobby, and exlude the smp world.
Practice dependency inversion and just throw the interfaces into a separate module
you might get mileage out of changing the biome
I wouldn't necessarily say my repo follows strict proper stuff, but it shows you how to provide an API for others to use
Fog and ash are biome related
although i can use resourcepack, or /particles. resourcepack affects all world, and /particles is too complicated to setup with skript.
also its open source that if you want to copy it you can as long as you give credit, think that is the minimum MIT requires

✨ packets ✨
I don't think there is a packet to change the biome dynamically, whereby you would have to painfully modify the chunk packets
my vision was the lobby is a ship, and the fog and ash on the basalt biome really fits the theme. like a ghost ship
if it's not possible, is there anymore way to make a weather fog on minecraft? any server sided plugins?
in just a specific world?
you can just change the biome for a block or set of blocks or chunk or set of chunks only
just fyi
so you could just set your lobby as the appropriate biome and leave everything outside of that untouched
Yeah. Worldedit's //setbiome command could help you with that
i could try that
you can use that, or make use of the spigot api to do it if you want to make a small plugin to do that lmao
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Block.html#setBiome(org.bukkit.block.Biome)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#setBiome(int,int,org.bukkit.block.Biome)
declaration: package: org.bukkit, interface: World
declaration: package: org.bukkit.block, interface: Block
first link is for setting blocks to a specific biome, and the second is if you want to set an entire chunk to a certain biome
and last question, are particles really controlled on command blocks only?
if you don't want to use a plugin
is there a plugin for that?
otherwise there is a variety of plugins and libraries available as well as various api methods if you want to make something yourself
There’s even a vanilla command for setting the biome now
hello i got questions on prepareAnvilEvent where my result item stuck in the result slot when trying to get them out ?
oh really?
thats new for me
You could try to use InventoryClickEvent for that
oh yes, i also have that part in, but still cannot get it work... do we need to handle the exp cost ? cuz i saw all the cost functions are deprecated
i felt like im missing something
another hindrances in our build, we want to spice things out. if you know god of war, when going inside the smp world we want to integrate the particles to atleast make some visuals on the portal room.
just search around on spigotmc or use google. Bound to find some kind of plugin already made that can provide what you are looking for in regards to particles
are you trying to make the ghost-ish ship from helheim from GOW5
cuz im making a re-roll function on items where only apply when onInventory click, i can tell the inventoryclick event triggered, but the item still stuck ;-;
if nothing else you can make it yourself
however unlike your biome request particles are bit more involved
I believe you can’t take the item out if there is no cost set
So you have to set it to at least 1
trailing particles on the floor as if it is like a lightning, and after this lightning thingy touches the lectern it shoots out a shulker bullet in the portal. we added custom datapacks that added custom particles.
nah its kind of a mix match tbh, mix with pirates of the carribean, god of war, and idk what is
You could try to remove the item from the result slot and instead set it on the players cursor
oh thankss, i was looking into it too but arent the setCost from the event are deprecated ? if so what should i use ?
nothing, they are all command based. we could not find sources on plugins
deprecated doesn't always mean unusable
or im very blind
Use the AnvilView instead
imma try out Jishuna method, hopefully that works, if not gonna go for this hahahaha
also, in case you wanted it to cost nothing, you can set the cost to 1 and this use this event I believe to refund them the cost
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerExpChangeEvent.html
declaration: package: org.bukkit.event.player, class: PlayerExpChangeEvent
Event#getView
ahh fax
alrighty, thankssss, will try that outtt
If i remember correctly, that only gets called for dropped exp orb
how could i go about getting the current selection that the player has made in FAWE/WE?
oh, that sucks then the description was a bit misleading then
lmao
Use their api
i cant figure out what to do in their api to get the player's selection
nice
and lets say i wanted to save this selection in a file so that it can be retrieved at any time and put into a new world?
it depends on worldedit, so you would use worldedit api to get the selection
which in WorldEdit, its CurrentSession I think it was? Something with Session in its name.
i got the getting part above, but i also want to save it as a file so i can get the selected area any time i want and put it in a world wherever i want
They have an api for schematics too
then look at how world edit saves schematics
oh i see the example
and Jishuna beat me to it -.-
tried that //setbiome on worldedit and faced with an error "java.lang.NullPointerException: null"
nvm it worked, but idk how to do the fog
anybody know how to do a weathered fog?
there should be a packet for that
how can i know that?
huh?
is it still applicable on 1.21.1?
probably
i dont think thats how it works
possible to drag the cloud in the ground?
\xb4\x0c\x07\x18minecraft:worldgen/biomeA\x12minecraft:badlands\x00\x17minecraft:bamboo_jungle\x00\x17minecraft:basalt_deltas\x00\x0fminecraft:beach\x00\x16minecraft:birch_forest\x00\x16minecraft:cherry_grove\x00\x14minecraft:cold_o``` do you guys know what this 0x0C in the registry data packet is supposed to be? the packet ID is 0x07 and the byte before is the packet length im guessing but no clue what that 0x0C sneaking in there is
?protocol
the protocol wiki doesnt cover this thats why im asking here
0x07 is the actual packet ID for registry data (and im expecting a registry data packet)
for some reason there's 0x0c before the 0x07
(also just saying I disabled both encryption + compression server-side)
Yeah I'd assume that's the length
^
yeah ive been getting by with ```python
initial_response = await asyncio.wait_for(reader.read(3), timeout=0.5)
if initial_response:
response_length = initial_response[0]
remaining_data = await reader.read(response_length - (len(initial_response) - 1))
full_response = initial_response + remaining_data
packet_id = full_response[1]``` on every single packet
python 💀
🐍 💀

That’s a cobra innit
nerd
Kek
uh... why does my FAWE dependency not have the BukkitAdapter class?
Did you add the bukkit dependency or just core
yeah i felt like for a small mc protocol client it was the best option
im going to port it to another lang later when its ready
another lang being js
So just Mineflayer with less features
my first time making an arena-pvp typa minigame, getting to learn so many new things
im kidding it wont actually be mineflayer lol
but mineflayer seemed to have far too much overhead for my use case
its damaging my mental health just as much but its almost.... fun
I need like 10 packets to be defined + the client to follow a login flow, even node minecraft protocol was using like ~80mb of ram for that I think
What are you doing?
a truly foreign concept to java developers
just making a bot that can log onto servers
it doesnt really need to know of whats going on it just needs to follow the login sequence and then disconnect
but why
oh this is for my mc scanner project
i already do netscans but I also want to test the validity of the results
and there's no efficient tool to do so at least that I saw
why cant i player#sendMessage while simultaneously having a conversation with the player
then i could add some small metadata info to the server info
💀 we don't need more server scanners
like whitelisted / offline-mode / premium ath
trust me you do 🙏
it will be glorious
wow
I made one myself a while ago lol
🔫
It was actually pretty fast but I didn't do the whole botting shit
Damn I made it in August 2023
how can i clear the current selection of a player in WorldEdit
i cant find it in the docs
look at //clear
i meant in the developer api
Did a quick javadoc search 🤷♂️ https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/release/com/sk89q/worldedit/regions/RegionSelector.html#clear()
declaration: package: com.sk89q.worldedit.regions, interface: RegionSelector
im legally blind
How do you think that command was implemented?
Without the API?
magic
magic, obviously
what is the best way to do custom villager shops?
spawning a villager entity on server enable and save them?
or spawn a villager via packet
can i get them even if the chunk is not loaded without lagging the server?
You'd need to load that chunk
.
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
conversation api I assume
ok so
inside my StringPrompt, i have a condition so that if the player enters the thing i dont want em to enter i player#sendMessage them a message telling them whats wrong so that next time they enter it correctly
but the message never shows in my chat
have u made sure its actually ran
log a console message right before
to make sure it’s actually being called
if that doesnt help make sure its the right player
otherwise
show code
and how can i load all the entities stored and then load the chunk
like this?
Why do you need to access villagers in unloaded chunks
i want to make something like shoopkeepers
so i need to acces to the villager after server restart
or wait
i can save the entity id and detect the rightclick?
@Override
public @NotNull Prompt acceptInput(@NotNull ConversationContext conversationContext, @Nullable String s) {
...
int teamSize;
...
if (teamSize < 1 || teamSize > 8) {
sendMessage(player, plugin.LANG.getEnterValidTeamSize(), true);
return this;
}
...
}
yes it runs.
sendMessage is supposed to send them a message, that method itself works
but i get no message
the entity id is permanent? i mean the entity
Entity id is not permanent
