#help-development
1 messages · Page 599 of 1
as elgar suggested
if you want to, you can still respawn it on chunk load.
Dunno if that's necessary if they can summon it anytime and anywhere anyway
I'd do...
Player uses summon command...
Search all loaded worlds for your horse.
If found teleport to player.
If not found spawn a new one.
on chunk unload delete any player spawned horses
that would ensure no duplicates and the worlds stay clean
thanks to both of you, im working on a similar plugin and the advises are really helpful
Sounds like someone is paying for a plugin and multiple people are attempting to be first
i'm working on a plugin that im going to release for free >_>
where to add plugin.yml file
you mean the config.yml file, right? It should be in the "resource" directory
the error you're encountering is that the config.yml isn't in the resources folder
oh yea sorry
okay thanks
how can i add a tag container tag to a PDC
You mean a CustomItemTagContainer?
or what tag container
in blockplaceevent how do i get the Item that was placed?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockPlaceEvent.html#getItemInHand()
declaration: package: org.bukkit.event.block, class: BlockPlaceEvent
so getItemInHand?
Yes
thanks
how to ban someone that's on another server, i have 3 servers, proxy, hub and game 1, and how do i ban someone on hub when im on game 1
how would i save a block inside a chunks pdc like you told me to?
Bungeecord
yea
are you making a plugin in bungeecord
then you cant
why
so if i would do a bungeecord plugin, would it work on every server
or i would must do a bungeecord plugin and also a spigot plugin for the other servers
so if i would only do a bungeecord plugin, the commands would be visible on spigot servers?
and no databases?
this would kick a player
okay thanks
np
Heyo, I've been trying to use Block.getBoundingBox().overlaps(player.getBoundingBox()) in an if statement, but it always evaluates to false. Anyone know what I can do? I'm trying to check if the player is within a specific block and was suggested this, but I haven't gotten it to work
how do i convert a block to byte[]
i think it should be the other way around
if a player overlaps a blocks box
that code is fine
I think I had it the other way around before but I'll try again.
I told you how?
how do i even convert a block to byte[] 😭
no you just told me to do it
Exactly I told you how to do it
do i convert a block to string and then back to block?
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
how do i convert a location to byte[]
.
Neither works :/
Why are you checking if a player is inside a block? ther emight be a better way to do this
then your other code is wrong
The code that comes both before and after works fine, though
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
lol fair
sysout before teh test. make sure your code is getting there
I just checked
It gets there, passes it
All the code before and after is executed whenever it should be
not sure if AIR gives a full bounding box
It's only that one if statement that is always false
Hmm, good point. I'll look into that
This method will return an empty bounding box if the geometric shape of the block is empty (such as air blocks).
Funny hacky way would be to place a block that doesn't suffocate but has a full bounding box, and then checking that for overlap before removing it again? lmao
or just test if its empty and expand
Sorry, could you elaborate?
I see, thank you
its possible to use shaders to tilt your screen, i wanted to make a system for a wallrun with this mechanims any idea how can i implement shaders on a "custom" feature like that?
you could probably trigger a shader by equipping a pumpkin
I printed the bounding box 'cause it was still not working... No wonder it doesn't work lol
but if i do for example the roll than i cannot do it for another only for the wallrun
Cool to know, though. If a block is without a bounding box, the default values are all XYZ = 0
expand in x,y,z by 1 and it shoudl work
It doesn't, sadly. I did this to an extreme and expanded by 100, it worked then but only when I was within those coordinates near XYZ 0
int posX = toPlace.getX();
int posY = toPlace.getY();
int posZ = toPlace.getZ();
BoundingBox block = new BoundingBox(posX, posY, posZ, posX+1, posY+1, posZ +1);
if (block.overlaps(p.getBoundingBox())) {
AddToVoid(itemClicked, e);
p.sendMessage("overlaps");
return;
}
``` Works like a charm at least
is there any other way to pay cause my counry dont accept paypal
Pay for plugins on spigotmc?
contact the author
Is this possible to modify NMS method using a plugin? I tried to use javassist but it gives to me an error. Did I do something wrong?
javassist.CannotCompileException: by java.lang.reflect.lnvocationTargetException
try {
ClassPool classPool = ClassPool.getDefault();
CtClass ctClass = classPool.get("net.minecraft.world.entity.player.EntityHuman");
CtMethod method = ctClass.getDeclaredMethod("fv"); //sweepAttack
method.setBody("System.out.println(\"Sweep\");");
ctClass.toClass();
} catch (NotFoundException | CannotCompileException e) {
e.printStackTrace();
}
so i wanted to split my plugin in half so its on two different servers and now it gives me this error:
Error occurred while enabling freakcore v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: The embedded resource 'config.yml' cannot be found in plugins\freak-core.jar
and i did have a config.yml but its now deleted and in the other plugin (which works)
is there a config.yml
why "replace" can be ignored?
no, its in the other plugin
in the other plugins default folder?
nah, i have like two plugins and one has it and one dont, the one that dont, gives the error, but i deleted the classes that used that config file
how
and also removed the save config file function
well maybe a different class is trying to access it or you are calling saveConfig
is there anyway to download deluxecombat for free?
replace returns a string, not void
what is a stacktrace
like the whole error
?paste
you dont use the output
oh fook
im not pink
at com.freakcore.FCore.onEnable(FCore.java:18) ~[freak-core.jar:?]
send line 18 of FCore
you dont have config.yml in ur resources folder
command = command.replace("a", "b")
package com.freakcore;
import com.freakcore.commands.Fly;
import com.freakcore.commands.Gamemode;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;
public final class FCore extends JavaPlugin {
public static String prefix = ChatColor.BLACK + "[" + ChatColor.WHITE + ChatColor.BOLD + "FREAKMC" + ChatColor.BLACK + "] " + ChatColor.RESET;
public static String noCommand = ChatColor.RED + "Nie ma takiej komendy";
private static FCore instance;
@Override
public void onEnable() {
Bukkit.getLogger().info(prefix + "Enabling FREAK-CORE");
// There was a save config here (line 18) but now in line 18 is "instance = this;"
instance = this;
getCommand("fly").setExecutor(new Fly());
getCommand("gm").setExecutor(new Gamemode());
}
public static FCore GetInstance() {
return instance;
}
@Override
public void onDisable() {
Bukkit.getLogger().info(prefix + "Disabling FREAK-CORE");
}
}
cool
wdym
which line is line eighteen
oh
oh i thought this just came out of nowhere
the saveConfig wont work because the config.yml is not in src/main/resources
you should do saveDefaultConfig() if u want a config
rn its the instance = this; but before splitting it was between instance.this and info
i dont want a config
because i don't need one
does this code error
that's the point, i don't have it and it still gives the error
idk how to rebuild with maven
are you using eclipse
there is the problem
run the package goal again
im doing install, yt video said so
amma do package
maven lifecycle package
that isnt needed, just run package
install for most spigot plugins isnt needed, it adds it to your local maven repo
did you copy the jar
send the stacktrace again
run clean package and use the newjar
its the same line 18 evidently u didnt change anything
ur not putting it on ur server correctly then
ctrl+s
in the target folder i have the old classes that used the config file and the old FCore that had the config save
mvn clean install -U
mvn package
why install? just run mvn clean package
okay, i cleaned it and it doesnt have the old classes
run package goal again
i dont think he was
wait he was
nah, just selected it
ok
did you reload
...
i was doing this: <outputFile>C:\Users\natiy\OneDrive\Pulpit\mc\plugins\freak-core.jar</outputFile> and i forgot that i have changed to bungeecord and my plugins folder is now in different folder
would u not just drag it from the target folder..
im doing a lot of builds, i just made it faster
i tried it and it works without errors
sorry guys
oh wait thats sql
you shouldnt be doing it like that
use = ? and PreparedStatement.set(1, value)
brb changing my name to DROP TABLE
Do the same for X
yeah, except you should do the same for X
?
@young knoll im gonna give this to you
how do i get the name of the item (i don't even care about the language) if both displayName and localizedName are empty
seriously contemplating stealing a language file and making a map
/**
* Converts UPPERCASE underscore full material names to something easier to read
*
* @param mat to format
* @return String of an easy-to-read Material name
*/
public static String getNiceMaterialName(final Material mat) {
final StringBuilder builder = new StringBuilder();
final Iterator<String> iterator = Arrays.stream(mat.name().split("_")).iterator();
while (iterator.hasNext()) {
builder.append(WordUtils.upperCaseFirstLetterOnly(iterator.next()));
if (iterator.hasNext()) builder.append(" ");
}
return builder.toString();
}
/**
* Turns the first letter of a String to uppercase, while making the rest lowercase
*
* @param word String to change
*/
public static String upperCaseFirstLetterOnly(final String word) {
return upperCaseFirstLetter(word.toLowerCase(Locale.ROOT));
}
/**
* Turns the first letter of a String to uppercase
*
* @param word String to change
*/
public static String upperCaseFirstLetter(final String word) {
if (word.length() < 1) return word;
if (word.length() == 1) return word.toUpperCase(Locale.ROOT);
return word.substring(0, 1).toUpperCase(Locale.ROOT) + word.substring(1);
}
ratio
last time i worked with a nice dude on a big project
he was fine with english so i just did kinda this
this dude, he won't
i bet
just take it from the material and translate it
there are multiple ways of translating keys and what not in minecraft actually
if he requires russian he can also pay for the google api key
but fyi they didn't wor k much
not even sure if it costs anything
this would work if a locale file was bundled with the server jar
but it just returns the english name
just give him a messages.yml
because only english is bundled
and let him translate it manually
tbh scraping these from a json file will take like a 5-10 minutes
start the stopwatch
i'll lyk when i;'m done
i know its spigot mc but anyone know what to implement in command class in bungeecord plugin?
?bing
Bing your question before asking it:
https://www.bing.com/
bungeecord support is here too
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
it wants you to send a component
oh
is there a simple way to limit enchants? for example a function like
Bukkit.enchantmentTable.setEnchantmentLimit("sharpness", 2);
with bukkit api probably not, you'd need to use nms
fyi im just starting becasuse i procrastinated
restart your stopwatch
how to convert string to player in bungee
what about if i just wanted to set it up so it limits it in an enchantment table and not the server. So when lvl 30 enchant can give a maximum of sharpness 2
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/enchantment/EnchantItemEvent.html
Well you can adjust the echantment map to your needs
declaration: package: org.bukkit.event.enchantment, class: EnchantItemEvent
how to ban player
thanks i'll look into it 🙏
hey guys what does the interpolation method do for display entities?
Bukkit.getBanList(Banlist.Type.IP).addBan(target.getAddress().getHostName(), reason, expires, source); // IP BAN
Bukkit.getBanList(Banlist.Type.NAME).addBan(target.getName(), reason, expires, source); // NAME BAN
but im doing Bungeecord not bukkit
oh
is there any way to create a vanilla map and set a custom centerX and centerZ, cause when I try to do it with this: java ItemStack item = new ItemStack(Material.FILLED_MAP); MapMeta meta = (MapMeta) item.getItemMeta(); MapView view = Bukkit.createMap(Bukkit.getWorld("world")); view.setCenterZ(player.getLocation().getBlockZ()); view.setCenterX(player.getLocation().getBlockX()); meta.setMapView(view); item.setItemMeta(meta); player.getInventory().addItem(item);, there is no cursor, and I need the vanilla cursor that tracks the player's location to that location
I'm not a bungeecord expert but you'll probably have to sync the ban to all relevant servers.
Or maybe there is a bungeecord connect event you can cancel with a message
im planning on banning the player only on lobby so he can't connect to the server
The cursor is something else
speak english
wanted to help you about banning players on bungeecord but wont after this
👋🏻
ok so apparently the language file is a magic shit so i only have about 400 items translated and the rest i'm looking up manually in minecraft but copilot is helping a ton ngl
specifically the colored items and shit for example are not translated normally
iron man dies in avengers infinity war, good luck with that one
(which makes sense to split them)
never planned to watch that
wasting hours of my life watching that dumb sience fiction
rather would be dead instead of doing that
please fight in DMs
it is not fighting silly
nah, not accepting him into my dms
well in that case
#general
damn
get rekt
AHHAHA
there is no really function for banning players as you might think you can execute ban command like this
ProxyServer.getInstance().getPluginManager().dispatchCommand(proxy.getConsole(), "ban " + player.getName() + " " + reason);
so ban will be ran through console and that is if you have third party plugin that allows you to do such thing
if that is not what you were looking for then you will have to use database and make your own functions to call when you want to ban player unban player etc you will just check if they are in database and then disallow their connection
really no other way of doing such thing i mean you dont have to use database you can store it locally but idk i prefer database for that
indeed
class horse can be serilizible?
it can be as long as it implements Serializable interface but since it doesnt directly implement that interface you will have to handle it manually
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BukkitObjectOutputStream data = new BukkitObjectOutputStream(outputStream);
data.writeObject(horse);
data.close();
return Base64Coder.encodeLines(outputStream.toByteArray());
}catch (IOException e){
Bukkit.getLogger().warning(e);
return null;
} this can?
why dont you test ?
bc long
long
i hope you know
it is
yes
yeah, but I would like using the normal cursor that tracks the player's position
how i can serilize class if he not have interface serizble
impl it 😮
You can save just uuid, and then find a horse using it
just serialize the properties of the horse
and all the data about it is recognized? And not the fact that the horse will not be removed
what method
create a class and store the information in it
i need serization for save in nbt
and create a persistent data type that could store the class
If you have an interface you can always use @DelegateDeserialization
Does anyone know why LivingEntity#playEffect(EntityEffect.HURT) does not get displayed?
horse not have intarface for serization
i dont know how to explain stuff in english, but you can create a class like this
can you manipulate the jump hight? probably with velocity. but also to like 0.43 if the default jump hight would be 1?
you not engish?
end all this i can set in horse7
then create a persistent data type for the class
When I try to build a server jar for 1.20.1 I get an error "could not resolve dependencies for project..." What do I need to do?
i can send you the codes, but you have to figure things out yourself🙁
If you're trying to run BuildTools send the full log in a paste
?paste
at the end i managed to solve my issue, serverkickevent provides "state" that helped me
people who were translating item names to Russian were SO consistently inconsistent
fucking
irritating
as
SHIT
what google translate does to a mfer
no
that's the thing
it had like 29%
the rest was done by joining stuff
for example i could not find orange wool for the life of me
and honestly i just want to foolproof everything
i know that dumbass will fail to do something if i don't do it for him
just 371 more 🙂
it was ~800 so
You mean the full building process?
There's a buildtools.log.txt
paste it's contents in to the paste and send the link
?paste
looks like an internet issue getting authlib:4.0.43 from libraries.minecraft.net (connection reset)
disgusting
why lol
The use of AI in most things is just straight up unethical. In programming its unpredictable and makes worse programmers. AI also leaves alot of security problems
do you even know what i was doing
an AI just chooses based on math, it's not unethical
you know, translating colors by hand 10+ times would make my speech to you less ethical, if anything
copilot recognized the pattern and did it for me
just one of the parts
Would you say that a categorization model is unethical? I'll give you a really simple example: LVQ
It just has groups and moves them, the closest group to the point you add is categorized as that, is that unethical?
I have very bad internet right now
i first said ai is unethical in most things which doesnt make it all. Code samples generated from AI have shown to have alot of security problems. Using AI for the core code is unpredictable and can lead to unmaintanability. Saying the CPU is unethical is just out of context. Lets say an AI caused abunch of fully qualified people to lose their jobs, so thats not unethical in some way? you can also make the argument that AI is ethical in advancing medicine. Im not gonna debate ethics since thats so long and it'll go back and fourth all day about scenarioes where its ethical and unethical. To call it completely ethical though is completely wrong. Me saying it was disgusting wasn't a dig at you @icy beacon and was just a sarcastic comment lol
For an AI to be unethical it would have to be aware of what it is doing.
im talking about the use of AI not the AI itself
it's not unethical that an AI can take jobs, it's unethical if those people are replaced, the ethics issue falls on the employers I guess
thats better 😉
AI itself is a tool
do you know that computer used to be a profession? by your logic, computers are unethical
two different things
if using AI is unethical, then send me straight to hell right now, but with access copilot and chatgpt
AI can’t be ethical or unethical unless it somehow has the freewill of a person. If not, the use case determines if it is unethical
Exactly
"Lets say an AI caused abunch of fully qualified people to lose their jobs, so thats not unethical in some way?"
replace the word AI with the word computers
Big business is pushing AI to replace humans in the workplace and increase profits. Thats unethical
AI has the ability to create it's own decisions, computers dont
ai is not that good to completely replace people yet
its unethical to replace humans in the workplace? why?
AI doesn;t
As AI replaces jobs, it opens new ones
It doesn't
How to create a custom treasure map?
yet
no lol
it just rehashes it's inputs
it more or less does
yeah based on the data its trained on
if so then it's sentient
lol no it doesn't
if ai is sentient why didn't copilot yet tell me to fuck off with my unreasonable prompts
opening new jobs kinda. If AI replaces 9-5 jobs then it could push people to work harder in education to get better jobs
"ai has the ability to create its own decisions" yet chatgpt can't decide to start doing stuff that it's restricted from doing (unless you deeply gaslight it, or even that doesn't help)
thats not creatign jobs, thats eliminating jobs
ayple
true true
If I try to build it many times it can work?
yeah
did you start the argument to compensate the time i saved using copilot
You are probably rate limited. It probably won;t re-test the connection for an hour
I would guess copilot saved atleast one hundered hours already, probably more than that
that's a heavy underestimation
It is
you can train a parrot to say words when it recognizes a pattern, yet it doesn't understand what the fuck it is saying
not the best example but kinda comparable to chatgpt
anyway i'll go continue being unethical as hell
Copilot is really good, when it knows what it has to do. Sometimes it gives code I wanted to write, but a little better and that all in a second. Without it I would be writing code for way longer
youre grossly missing my point
I'll never use AI just like I'll never use a self checkout
.
Unrelated, but does anyone know of a way to stop tree generation when chunks are generated?
I can add a populator with custom generation, but how would I override the existing tree populator?
Keep in mind I have very little experience with custom generation LOL
Well, this is why we need mixins
lovely
its the mc dev plugin
Is there an event in bukkit for when the player puts on armor?
i dont have it on
yea
Is it some mem leak or something
built in there isnt, there is a 3rd party lib
might be a mem leak but it despises the material class
I had the same problem even with it off too yoo
i had to disable the java bytecode decompiler plugin to make my ij not die if i touch the class
did removing it help?
same shit
lamo real
Dunno
u still got the problem?
What abot multithreading
no clue
i was bored one day so manually downloaded souces and javadocs so i can disable the bytecode decompiler and not die opening the material class
Haven't seen it for a while, but I dunno
i love custom drops
public void onDeath(EntityDeathEvent event) {
event.getDrops().clear();
event.setDroppedExp(0);
Random random = new Random();
for (RNGDrop drop : getDrops()) {
int randomNumber = 0;
if(drop.getRate() > 0) {
randomNumber = random.nextInt();
}
if(randomNumber == 1 || randomNumber == 0) {
event.getDrops().add(drop.getStack());
}
}
}
Imagine the performance boost if decompiler shit was on a seperate thread
real
And what if we also put indexing onto a different thread
im gonna scream at you for not adding a bound to that nextInt
wait what
i swear i did that
nextInt(bound)
im not even lying
smh
i swear i did
My IJ deleted some code before crashing with the 3 gigs of mem thingy
Reverted it, actually
public void onDeath(EntityDeathEvent event) {
event.getDrops().clear();
event.setDroppedExp(0);
Random random = new Random();
for (RNGDrop drop : getDrops()) {
int randomNumber = 0;
if(drop.getRate() > 0) {
randomNumber = random.nextInt(drop.getRate());
}
if(randomNumber == 1 || randomNumber == 0) {
event.getDrops().add(drop.getStack());
}
}
}
there we go
Why can't I visit libraries.minecraft.net? I wanted to download files manually for the server
jree fava
How can I download authlib-4.0.43.jar manually?
anybody having problems with anvilgui 1.7.0-SNAPSHOT?
Caused by: java.lang.IllegalStateException: AnvilGUI does not support server version "1_19_R1"
at com.roughlyunderscore.anvilgui.version.VersionMatcher.match(VersionMatcher.java:32) ~[?:?]
at com.roughlyunderscore.anvilgui.AnvilGUI.<clinit>(AnvilGUI.java:43) ~[?:?]
at com.roughlyunderscore.anvilgui.AnvilGUI$Builder.<init>(AnvilGUI.java:336) ~[?:?]
at com.roughlyunderscore.ui.sell.SpecifyAmountToSellUI.createAndOpen$lambda$7(SpecifyAmountToSellUI.kt:141) ~[?:?]
at com.roughlyunderscore.gui.guis.GuiListener.onGuiClick(GuiListener.java:102) ~[?:?]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:577) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
... 20 more
Caused by: java.lang.ClassNotFoundException: com.roughlyunderscore.anvilgui.version.Wrapper1_19_R1
maven:
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.7.0-SNAPSHOT</version>
</dependency>
<repository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
</repository>
<relocation>
<pattern>dev.triumphteam.gui</pattern>
<shadedPattern>${shadedPackage}.gui</shadedPattern>
</relocation>
i even tried to Class#forName this class in onEnable but no
for reference, the class does exist
in my maven anvilgui jar it's also there
but for some reason not in the plugin jar file
there's nothing lol
are you minimizing
modify
oh ty
I'm fine
I mean I did it. Thanks anyway
how do placeholders work? do they need to be updated regularly? or how?
That's not how it works
no no
i mocked him basically
лол
I'm english
and told him that he was using the wrong channel
why
well it's simple
ehhh
rules are here actually https://www.spigotmc.org/wiki/spigot-rules/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
because who were you even talking to????
i mocked you because you were talking to the void
ah i say obaut save horse in json
why do you need to save an entity
you don't save the horse, you save the details of the horse
yes
Superhero
entity per entity
no mean i dont know how i can save horse in string format bc he not serizble
you do NOT NEED TO DO THAT
there isnt a reason to save an entity
i need
why
or an it or they
@icy beacon can you ask why they need to save this horse and translate it
нахуя тебе лошадь сохранять
for nbt
сохранять нужно ее важные данные
NBT
а не саму лошадь
чел я с тобой по русски говорю потому что ты на английском не ебашишь
"нбт" ну и что тебе это нбт дало
тебя не забанят?
меня попросили тебя спросить
крч тебе все нбт все равно не нужно лол
это во первых
во вторых на версиях 1.14+ есть persistentdatacontainer в котором можно зранить данные
а не нбт
Whats that
короче идея сохранять лошадь в файл хуйня так и так
I can read that
Same
если ты хочешь ее сохранить в файл, проще прочитать файл существа который уже есть в папке мира
we can speak russian now
а не выебываться
мне нужно для плагина поскольку я хочу создать копию лошади если это нужно
сохрани ее uuid
и все
и я могу сделать точную копию?
потом по uuid найдешь ее и скопируешь то что надо
я хз есть ли метод для полной копии но это явно будет проще
you need to copy its attributes, jump info, health etc, saving the direct entity wont work
она исчезнуть может я ее по миру ищу
как лошадь исчезнет
пассивные мобы не деспавнятся
если лошадь существует значит чанк вокруг нее существует
Passive mobs don't despawn? Really?
блять тебе не надо знать где она
ну вот видишь
ты ее найдешь по uuid
как я ее найли если она к примеру не прогружена будет
declaration: package: org.bukkit, interface: World
берешь метод
ищешь в списке существо с тем uuid
и все
это задевает тех кто прогружен
ох а мне сказали что только тех кто прогружен игроком
ну лошади на 200000;200000 например не существует потому что ты там не был
но тебе и не надо
ты не можешь всех мобов в мире найти просто потому что их столько нет
есть только те кто существуют в прогруженных чанках
а если лошадь попытается забрести в непрогруженный то она либо не сможет либо прогрузит его
i think at this point its better to just say what to do and leave them to it
лошадь прогружает чанки???
блять я не ебу проверь
это была теория
"либо либо"
good luck my friend as this is hopeless and a massive xyproblem
he will keep asking 😭
Asking about your attempted solution rather than your actual problem
even though you explained your idea, you are trying to do something else and i have no clue
One person is tryna to explain that you can get the horse by UUID and the other is saying what if chunk not loaded
но чанк выгружается если там долго не быть
💀
if you don't have enough horses, then you can just create a loop that checks the stored uuid until it finds a horse
if the mob dies, then stop the cycle
Hi, i need it to get some info about the user when he logs in, the problem is that i need info from each user every time a chat is sent so dealing with direct requests is really not optimizes but otherwise I could have just made a hashmao where I store the player and the data but doing with caffeine is always better I imagine?
You get teh data you need when the player logs in. You keep it in memory so it's easy to access until they log out
what's the difference between TimeStamp and DateTime? (MySQL)
one is auto the other you provide
TimeStamp itself sets the time which is now?
what is the best way to arrange a cooldown
for 24h+
Instant/DateTime
TimeStamp is the time of whenever the function was invoked, in most cases TimeStamp is used on an auto basis but there is occasions where it needs to be invoked manually, however the timestamp only refers to the time it was invoked. DateTime is a date or time that you specify and needs to be in a particular format that mysql supports which there is a variety
timestamp because it is usually in milliseconds for the timestamp
so you would just check the timestamp from the DB and compare it to the time of now and see how long it has been
Patching Block.java
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:676)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown S
ource)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Sour
ce)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknow
n Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.forEach(Unknown Source)
at org.spigotmc.builder.Builder.main(Builder.java:627)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content does
n't match the target
at difflib.Chunk.verify(Chunk.java:86)
at difflib.ChangeDelta.verify(ChangeDelta.java:78)
at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
at difflib.Patch.applyTo(Patch.java:43)
at difflib.DiffUtils.patch(DiffUtils.java:70)
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:664)
```Anyone can help me ? I want to setup 1.8.8 buildtools
86400 seconds are in a day, add 3 more zeroes 86,400,000 is how many milliseconds in a day
Damn kids these days use Instant instead of math fucking lazy kids back in my day we added nd shit
Got bored taking my socks off every time I went over ten
What the fuck is all that
now i can teleport my horse but if i not in world were horse plugin not can searh him
which is why I told you to delete it on chunk unload
Hi, Can Anyone Help Me? I Cant make spigot 1.20 or latest version of minecraft plugin because my minecraft above 1.16.5 gets an GLFW error my PC Specs:
Device name: DESKTOP-NINDB45
Processor: Intel(R) Core(TM) i3-2330M CPU @ 2.20GHz 2.20 GHz
Installed RAM: 4.00 GB (3.84 GB usable)
Device ID: 6F24D6B6-E105-448D-AD28-D516BB6318A9
Product ID: 00326-30000-00001-AA893
System type: 64-bit operating system, x64-based processor
Pen and touch: No pen or touch input is available for this display
I KNOW ITS NOT RELATED TO SPIGOT BUT OVERALL MINECRAFT.
still I have to save the horse somewhere
I'm currently doing some changes to a Minecraft class called DefinedStructure which basically represents the structure block schematics of minecraft for my Spigot contribution.
My change converts the BlockPosition, IBlockData and NBTTagCompound (entity tag) of each block to a CraftBlockState for plugin use later on.
However I noticed that some blocks have an entity tag that doesn't have a id field which is required by minecraft to create a TileEntity.
Therefore I'm getting Skipped BlockEntity with id (normally it would print the id however there is no id so no id in the message) in the console.
There are multiple options to fix this issue however I don't know which one would be best suitable:
- Create the
CraftBlockStatewithout the NBT data and load the NBT data afterwards - Add the
idfield to the NBT data based on theIBlockData
I would like some opinions on this if possible.
In my opinion the first solution sounds best however I'm unsure if it won't cause any problems
bro still through id is not an option
would some1 maybe vc with me so i can screenshare, bc i would be alot easier for me to understand?
i have a problem in plugin
?
any tutorials for spigot 1,16,5
run buildtools with java 8
can a ItemStack hold more items then the items stack size?
stacksize is restricted by material
I saw people make more than 64 items using the resource pack, but I think it works very unstable
public static Map<Enchantment, Integer> getAllEnchantments(ItemStack item) {
if (item == null) {
return null;
}
EnchantmentStorageMeta enchantmentMeta = (EnchantmentStorageMeta) item.getItemMeta();
Map<Enchantment, Integer> enchantments = new HashMap<>();
assert enchantmentMeta != null;
// Combine the standard enchantments of the item with its stored enchantments
enchantments.putAll(enchantmentMeta.getEnchants());
enchantments.putAll(enchantmentMeta.getStoredEnchants());
return enchantments;
}
So I'm trying to get the item's enchantment meta but the assert is failing
What I'm confused about is - why is EnchantmentStorageMeta a type of ItemMeta? Wouldn't an item have multiple types of metadata?
And, how do I make sure to modify the EnchantmentStorageMeta of an item? Because if I use instanceof there is a chance that the meta is an instance of another type
In what cases would it even be an instance of another type?
EnchantmentStorageMeta is for enchanted books
So only enchanted books have it?
math is incorrect
yeah
everything else just uses normal meta for enchants
you want to divide millis by 1000 first, and then multiply by 60 after
So would it be better style to say if item.getType() == Material.ENCHANTED_BOOK and then just downcast the meta?
Or to use if meta instanceof EnchantmentStorageMeta
so (((TimeStampMillis / 1000)*60)*60)
I did this: I immediately save the time when the cooldown ends, and then check it
imo id say this would be better but up to you
other then the slight math issue, it looks good from a glance
the code with the problem in mathematics was made by ChatGPT)
Lol
what you had is similar to what I have, but when you actually work out the math, yours comes out wrong then what mine would. 😛
Shouldn't you divide by 60?
millis / 1000 => seconds
seconds / 60 => minutes
minutes / 60 => hours
If you multiply by 60 you get something completely different
because order of operations
I'd not bother with all teh math
or divide yeah, but I was merely trying to just point out how the math needed to be structured
thats why we have Instant/Duration/etc
there is a big difference in how I have it, and how the math is worked out, vs the way they had it
This might be a stupid question but am I right in saying that the anvil does only 5 things:
- Repair breakable items using other items of the same type
- Repair breakable items using the material they were crafted with
- Apply and upgrade enchantments using books
- Apply and upgrade enchantments using items of the same type
- Rename items
I need to reimplement the anvil due to needing slightly different functionality 😑
rename items?
Ah good point
hi is it a good idea to keep a lot of BukkitRunnables that are not started in an ArrayList?
Why are you storing non started runnable
I wanna basicly just call code when something based on Objects happen
I am registering hooks. It's like events, but with extra Information
Map then? Vs a bunch of lists
there will be an async loop checking for conditions based on registered Hooks(which are in the ArrayList)
and then it somehow has to call the code that is specified in the Object
but idk how it would be done better than with BukkitRunnables
Could you say exactly what you are trying to accomplish?
I am making a hook for hold-interacts
so PlayerInteractEvent but with holddowns
and different pieces of codes gotta get called based on different timings, like one has to call 500ms after the first click and the next 2000ms
Why don’t you create the runnable just when you need it
Otherwise you create and store it and might never use it
how would I create it if I gotta specify it in my plugin
where can one find the spigot source
Pretty sure I had code for hold-interacts
Call it in the event
?stash
Hi everyone !
Is it possible to disable native 1.20 feature of rightclick-editing signs ? Its suuuuuuuuuper annoying
yes you already sent it to me but its handled a lot different than my expectations
I don't remember ever sending it
Cancel player intrract event on signs
Without coding ^^'
I dont know how to do this ^^'
#help-server then
you should not register an event in runtime for 1000 different timings
Okay ^^
I don’t even get what you want to do
Hold down interacts
@echo basalt ohh sorry it was the code of someone else yesterday
Thanks for the very detailed explanation
is the player count on a server found anywhere in bukkit or is it just the mc jar
Run specific code if the player holds down click for x seconds
could you show it to me please so I can see if it achieves what I need and how it does it?
you want to get player count ?
yes
Bukkit.getOnlinePlayers() returns list

where do the sources go when i run build tools or click download sources?
Is anyone aware of some library that basically does regex on steriods? i.e. I'm looking for something that can evaluate something like follows:
{
"priority": 100,
"validFor": {
"locales": ["DEU", "FRA"],
"patternMatches": "[\d\.]+(,\d+)?[KMGTY]?"
},
"value": {
"pattern": "([\d\.]+)(?:,(\d+))?([KMGTY]?)",
"transform": [
{
"validFor": {
"ifNotPresent": ["{2}"]
},
"data": "0",
"store": { "variable": "{2}", "as": "STRING", "via": "STORE" }
}, {
"concat": [ "{1}", ".", "{2}" ],
"store": { "variable": "ret", "as": "DECIMAL", "via": "ADD" }
}
],
"return": "ret"
}
}
I know, cursed beyond belief but without some cursed combination of sscanf (which would require the FFI anyways) and regex it is hard to do otherwise
Thanks for the back handed compliment
I assume the right way for me to add a local .jar file I want to use without doing any distribution is something like:
mvn install:install-file -Dfile=<path\to\file>\PluginIWannaUse.jar -DgroupId=com.group -DartifactId=artifact -Dversion=ver -Dpackaging=jar
then doing the import as Provided right in my Pom.xml?
Yeah, though personally I am more of a fan of using file://-repos
Alrighty - Just wanna make sure 😄
tell me what doesnt work
also you should save hand1 like
ConfigurationSection hand1 = config.getConfigurationSection(args[1]+".items.hand1");
i don't understand why you modified my code, it looked way better
and pls tell me whats not working
The enchantemtns arent adding, that is all
ahhh i gotcha
do a .toLowerCase()
entry.getKey().toLowerCase();
it will fix it
i tested
namespacedkey can't find with uppercase
i just tested
Well that worked locally, but now I need to fix my ,github\workflow\maven-publish.yml file for that Local .jar file....
Fails cause Maven cant find it anywhere XD
Exact Error: https://github.com/Wolfieheart/ArmorStandEditor/actions/runs/5447666453/jobs/9909961763
Local building works a charm - Just remote not so much
Any good way to stop the tree populator in certain biomes?
I wrote L and wanted to write o and it crashed yaay
@vivid cave
I assume that also works when building remotely then? Cause thats now where my next problem lies
you dont override the onCommand
Yeah your OnCommand needs an @Override at the start
also GG will never be 6
the bound is hieghst number, the highest it will be is 5 iirc
sure
New to this so it may be a dumb question, but how can i change the file destination when building my plugin? Would be nice to have it saved directly in the plugins folder of my server
would this be relevant if im using gradle?
or am i dumb lol
that method seems easy enough though. appreciate the link!
Sorry for not having seen that earlier.
You are right, using the mvn install way would not work on another machine as long as you don't mvn install there too.
This is why I recommend file:// repositories, but that is a rather untraditional setup that is recommended by not much more people than me (though I don't know why - probably a bit harder to setup?).
(See #help-development message concerning how file:// repos are implemented)
though make sure you have the rights to distribute the jar file first, otherwise it gets messy
Yo people I need help
How do I get the name in the anvil rename box from a PrepareAnvilEvent
Everythings working except adding the enchantments
NamespacedKey.minecraft
lower case the getKey
did you test it in under 30 seconds?
I did lol
how can i cast ProxiedPlayer to player or should i ask this in an other dc bc this is only for spigot?
proxied player is for bungee, the bukkit player class doesnt exist on it
hi, how to make "secure" gui (I heard that you don't just have to get the name)
You compare instances.
yeah i mean how can i just use p.getUniqueID etc in bungee
call the method?
check the spelling then and make sure it exists on the server
thats what im asking what is the method
getUniqueId
i dont think you understand
its on the method
still not what i need
loop over online players
you asked how to call p.getUniqueId(), i gave you how to call p.getUniqueId
for bungee
how can i do ProxiedPlayer p = p.getUniqeID dosnt make sens to me????
you want to know how to get the proxied player then
YES
where do you need it
Do I get the item name from the rename box from the PrepareAnvilEvent or something?
what do you mean where
I'm not sure where it can be accessed
do you need it when they join? when they leave?
in an command there i need it
get the result and check if it has a display name
check if command sender is instance of proxied player
Is the name automatically applied to the result?
thats not what im asking still
id guess so
so what are you asking
if you need to obtain the proxiedplayer
you ask one thing them say something else
alternatively you can use commandsender too
you said you need it in a comamnd so instanceof check the sender, most events probably have a getter otherwise
it just depends at what point you are trying to obtain the proxiedplayer object
no, change the ((Player)sender) to po
no i need to get the UnqieID in spigot is it to make it more easier
Player p = (Player) sender;
but im not sure what the bungee thing is
Yeah
ProxiedPlayer p = AND THEN WHAT THATS WHAT IM ASKING
?paste the entire class of where you have that
Interesting, it seems that anvil rename is completely built-in functionality
the same item
seems they lack the understanding of java
change the for loop
i dont have something in my class i do every time before i do my code in spigot
Player p = (Player) sender;
but
Is it like
ProxiedPlayer p = (ProxiedPlayer) sender;
????
I'm confused as to how you can find whether an item is being renamed if you don't put an item as the result first
yes
good thanks
but you should do an instanceof check before blindly casting
but then where is the fun in that
also, they could have just looked at the api link
?learnjava but now you really need to go and learn java
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
it clearly shows Proxied player deriving from CommandSender lol
Is it even possible to do a "rename check" before determining the result item, or using some sort of cursed placeholder item?
somehow they dont know what instanceof is
My first language was Java and I forgot how bad it was before I started doing this
Lol
I used to like it and then I tried Rust
And C# and others
Java isn't all that bad
the for (player po : ...) is called a for loop
anyone who decides to learn modern java is lucky in that Java is quite good and don't have to endure the times of 1.6 or before java
Its syntax is very annoying and makes it a bit hard to read in a lot of places, though I'd say that's more the fault of C because it's highly derivative of C
you just have to change it to get a random item
I really like Rust's syntax of fn(args) -> ReturnType
syntax has nothing to do with whether Java is good or not. Every language has its own syntax and whether you like it or not has nothing to do with it being optimal
you are free in how you want to place everything as well
as long as the rules are followed
you want spaces after parameters you can do that
I mean, we could make Brainf*** with good features and it would still suck. Like it's still a bad language even though it's just syntax
make a list, populate said list and get a random entry of it from a getter
Not to say Java is a bad language
We can continue in #general if you want @wet breach
🤓html better
this derived of personal opinion
I wouldn't ever be able to use any language that doesn't use maven.
you can't argue opinions
Maven is just too good. A gift from god
@remote swallow
Everything is speleld right
Conifig
My favorite thing about java is how I don't have to compile per OS
Hey just a high level question for anyone who knows. I'm trying to run an event listener for each instance of aa custom class to see if a player enters its location.
Question 1 -> is this possible
Question 2 -> would it be more efficient to store all class locations in a hashmap and just perform a search on each playermoveevent? that seems like a lot
public class ExampleClass {
private final List<ItemStack> stacks = new ArrayList<>();
public ExampleClass() {
// add stuff to the stacks list
}
private ItemStack getRandomStack() {
return stacks.get(ThreadLocalRandom.current().nextInt(stacks.size));
}
check the config on the server
Fuck me I forgot to update it
2 would be better than a whole bunch of listeners. And yes that could end up being thausands of checks per tick
jeez, should I just plug into the worldguard API?
You can do that if you want
and how can i get the target for ProxiedPlayer target = ??
another player like if i do ( its spigot just to provide it ) fly [Player]
same
ProxyServer.getInstance().getPlayer probably
yep but i have to say an name or uuid
you get the name from the command?
how would i do this without making it all wonky
private static final Map<UUID, Map<Material, List<PlayerGenerator>>> playerGenerators = new HashMap<>();```
i was thinking something like this but i would have to .stream() it everytime since i gotta sort the materials
```java
private static final Map<UUID, List<PlayerGenerator>> playerGenerators = new HashMap<>();```
i hate the first one
i dislike doing that
but any alternatives
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
ive created a recipe plugin with PrepereItemCraftEvent but the problem is that when i do the ercipe this happens
you should add recipes with the built in recipe api
wdym
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#addRecipe(org.bukkit.inventory.Recipe)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/Recipe.html
declaration: package: org.bukkit.inventory, interface: Recipe
declaration: package: org.bukkit, class: Bukkit
bro i know about them
i did it with the PrepareItemCraftEvent bcs i need to put itemsstacks
wait
LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.
LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.
hmmm where
still dont get why you cant just use the recipe api
Use a combination of the two
my brain hurts too much
Register a recipe and then check stack sizes in the event
i think thats not possible
hmm with hashmap ?and how i will get the ammound of the material
For loop
??
You don't
Just register a normal recipe
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
bro i need a certain amount of each piece to make each recipe
i dont need just one
with this API i do it just 1
That's how mojang implements it
.......
So you'll need to amke your own custom recipe system from scratch
Have funnnn!!!!!! 
Can anyone help me about buildtools
I did with git bash java -jar BuildTools.jar --rev 1.8.8 but i have some problem
Patching Block.java
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:676)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown S
ource)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Sour
ce)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknow
n Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.forEach(Unknown Source)
at org.spigotmc.builder.Builder.main(Builder.java:627)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content does
n't match the target
at difflib.Chunk.verify(Chunk.java:86)
at difflib.ChangeDelta.verify(ChangeDelta.java:78)
at difflib.ChangeDelta.applyTo(ChangeDelta.java:44)
at difflib.Patch.applyTo(Patch.java:43)
at difflib.DiffUtils.patch(DiffUtils.java:70)
at org.spigotmc.builder.Builder.lambda$main$2(Builder.java:664)
just use the compression technique like all mods use, 9 crystals 3x3 in teh table gets compressed crystal, then 9 compressed crystal gets double compressed crystal etc
way easier than creating your own recipe system
yo yo yo back with another question
Trying to set a spawner location but i need to be able to set multiple? how would I go about automatically adding to the next number so if #1 was set it would make #2
Nvm I believe I got it
why do you need a number?
could just go with
spawnerLocations:
- x:
y:
z:
- x:
y:
z:
Wow didnt even think of that
the advantage to using a number however is if you wanted to specifically refer to a single spawner