#development
1 messages ยท Page 6 of 1
isn't player interact event below the eventhandler?
that sentence makes no sense
ok look
public void hornSounded(PlayerInteractEvent) {```
this is what I figured it out
does it make sense
?
ok look
cus you've declared a input type, but not what its called
i'll send you the whole thing ok?
import net.minecraft.util.datafix.fixes.GoatHornIdFix;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Item;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.SpectralArrow;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerInteractEvent;
public class CustomItems implements Listener {
@EventHandler
public void arrowHit(ProjectileHitEvent event) {
Projectile spectralArrow = event.getEntity();
if (spectralArrow instanceof SpectralArrow) {
World world = spectralArrow.getWorld();
Location location= spectralArrow.getLocation();
world.createExplosion(location, 2);
}
}
@EventHandler
public void hornSounded(PlayerInteractEvent) {
}
}
have a look
you want to identify if the item used is a goat horn
yes
well its quite simple
get the itemstack that was used, get its material, check if it was a goat horn and bobs your uncle
nods with head to pretend i understood
now if you want to get a very specific goat horn then the best option would be to use nms and add a nbt tag to that item or you can simply use persistentdatacontainers which does the exact same thing as the nms way but with a bit of extra text in the nbt tags
id say majority would say to use pdc as its very simple to do
this is the problem with trying to create stuff without any basic knowledge of programming in general
well in my defence I know some programming languages but nothing that will actually help me
bob is also my uncle
and
playerinteractevent has a couple methods that make it dead easy to get exactly what i said
I could be the best java programmer but I'd still struggle a little bit with spigot
look into the spigot api docs
not as much as you are
they're very clear
the spigot docs are available right here https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerInteractEvent.html
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
and some of the other stuff relating to the spigotapi can be figured out with a few key word searches on google
an item
itemstack is an item?
why they just dont call it item then ๐
ah fuck this
yk, the one that exists on the floor
yes
ohhh
whats a persistent data container
it
and a nbt tag
an nbt tag is a simple chunk of data thats stored on an itemstack for example
enchantments on an item is stored in the nbt data
for example
the custom name, lore, unbreakability, etc are all other forms of data stored within nbt
you can also store your own data inside of the container
the horns are all seperate in their sound
and their material type
wait
actually they're not
hmm
They have the same name but different sounds and lore
wouldn't lore be visual only?
and they are separate items
sorry for so many questions
sorry, clientside only
tooltips are clientside only, they cannot be changed unless the client was modified too, lore is seperate, it can be changed on the server.
they may look similar, but they are seperate
tooltips can be dynamic but lore is static
now I have to figure out things I have no clue how to do
its like 2-3 steps
if (event.getItem().getType() == Material.GOAT_HORN)
currently it seems, the spigotapi doesnt have a method for getting goat horn instrument types
afaik the data is stored as nbt data so it would be extractable
extracted? what am I doing now? rescuing a hostage?
yk, get the compoundtag from the itemstack, get the string contained in the instrument tag
its extractable
for once I feel like I am understanding a word that comes out of your mouth
so whatcha mean is
itemstacks have a nbt data container, its called a compoundtag
in the compoundtag there will be a tag called instruments or something like that
so it's where the data is stored?
i'm using all my brain power to understand
can you explain better the compound tag please, never asked you anything (well I actually did more than 10 times only today)
compound tag is basically just a big list of data
you can have a compound tag inside of a compound tag
like you can have a list of lists
lets say you got a box, you can have many things inside of that box
all single things
or you could also have a smaller box inside of that box
OH
I get it now
so basically
get the list of the itemstack
the data
the list of data
get the string (the name of the horn basically)
every piece of data has 2 things, an identifier and a value.
the identifier would be instrument
what does that mean
its type will be string
so getString() would be used
its how you get the data, you ask the list for the value of the identifier
itll either return the value, or an empty string or maybe null i cant remember
does instrument mean anything or it doesn't matter what it is?
like it can be anything
your not setting the value
your trying to get the value
according to the minecraft wiki, the tag is called instrument
which you need to know the id to get the value
like when giving yourself an item, you need to specify the item type to get the value
you cant just type redthingy when you want a barrier
my question was if it could be called anything else
like if the devs wanted it to call monkey instead of instrument
would that change anything
if they wanted to yeah but its quite unlikely thwy would
instrument is like the id
when you want to get an item in minecraft
you type /give (player) minecraft:(item)
and the value is like the item itself
?
idk a better way to put it
I've been trying to make a placeholder expansion and it doesn't appear to be working no matter what I do. my placeholder expansion does show up in /papi list as well as there are no errors in the server console. I am making this as a standalone jar which I am putting in the expansions folder.
but when I use it in game it simply doesn't work. I have downloaded expansions from the ecloud and they work just fine, but this is all I get with my own:
> papi reload
[02:06:14 INFO]: [PlaceholderAPI] Placeholder expansion registration initializing...
[02:06:14 INFO]: [PlaceholderAPI] Fetching available expansion information...
[02:06:14 INFO]: [PlaceholderAPI] Successfully registered expansion: exampleplaceholder [1.0.0]
[02:06:14 INFO]: 1 placeholder hook(s) registered!
> papi parse --null %testplaceholder%
[02:06:56 INFO]: %testplaceholder%
>
my code is below, this is essentially all that's included in my project
public class ExamplePlaceholder extends PlaceholderExpansion {
@Override
public String getIdentifier() {
return "exampleplaceholder";
}
@Override
public String getAuthor() {
return "edgeburnmedia";
}
@Override
public String getVersion() {
return "1.0.0";
}
@Override
public boolean persist() {
return true;
}
@Override
public String onRequest(OfflinePlayer player, String params) {
if (params.equals("testplaceholder")) {
return "an example placeholder";
} else {
return null;
}
}
}
I like to ask why I can't open the deluxemenus wiki site
You need to parse it using %identifier_placeholder% which in your case is %exampleplaceholder_testplaceholder%
not sure where I missed this, but this worked; thank you!
hmmm im getting this java.lang.NullPointerException: Cannot invoke "me.clip.placeholderapi.PlaceholderAPIPlugin.getLocalExpansionManager()" because the return value of "me.clip.placeholderapi.expansion.PlaceholderExpansion.getPlaceholderAPI()" is null
Your plugin / expansion shade PlaceholderAPI. Here's how to fix that:
- For Maven, set
<scope>toprovided - For Gradle, use
compileOnlyinstead ofimplementation
already tried
@Override
public void onEnable() {
new Placeholders().register();
}``` main class
public class Placeholders extends PlaceholderExpansion {
@Override
public @NotNull String getIdentifier() {
return "papiutil";
}
@Override
public @NotNull String getAuthor() {
return "Pickle";
}
@Override
public @NotNull String getVersion() {
return "1.0.0";
}
@Override
public String onRequest(OfflinePlayer player, String params) {
if(params.contains("doubleparse_")) {
String[] splitStr = params.trim().split("_");
Bukkit.getLogger().info(splitStr[0]+" "+splitStr[1]);
return PlaceholderAPI.setPlaceholders(player, PlaceholderAPI.setPlaceholders(player, splitStr[1]));
}
return null;
}
}```
placholders
@granite mountain Show your plugin.yml file, please.
It should be located in your resources folder.
/src/main/resources/
ok sure sorry i didnt replay sooner
name: PapiUtil
version: '${project.version}'
main: net.picklestring.papiutil.Papiutil
api-version: 1.19
authors: [ pickle ]
description: util for papi
website: infinity-craft.net
depend: [PlaceholderAPI]```
here^^
Why arent you making an expansion instead of a plugin?
i dont really know how tbh
maven
oml
All you have to do is to create a project, make a class that extends PlaceholderExpansion and then just put the jar in /plugins/PlaceholderAPI/expansions
send pom.xml
<?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>net.picklestring</groupId>
<artifactId>papiutil</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PapiUtil</name>
<description>util for papi</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>infinity-craft.net</url>
<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>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
why do you have shade plugin?
idk i used a intellij plugin to make it
try removing it
That will shadow only dependencies that are marked as include or whatever is the scope
If you open the jar, does it have papi classes inside?
but how do i make the jar not be a plugin?
ill check
What makes the jar a plugin is plugin.yml and a class that extends JavaPlugin
wait how do i check
Open it with winrar
oh ok thanks
hmmm im on mac
Use whatever program you have there to open archives
ok i'll try and find one to open jar
wait i wasnt building using maven i was using intellij. i'm dumb it works now thanks guys
thanks
Anyone know how to check if the player is eating an enchanted golden apple and not the normal one?
Just check the items material?
It checks it for the normal one and the god one lol
What version?
1.12.2
ah so janky materials then, you're gonna have to check the data as well
Know why when I eat the golden apple before the effect I added it doesnt readd it? So like if I eat the apple the effect I added adds but if I eat another golden apple before the effect has ran out it doesnt put it back to the duration I set it just stays as it is
So i get this error when i try to load maven
Cannot resolve org.spigotmc :spigot : 1.16.5-R0.1-SNAPSHOT
thats my pom
<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>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.
A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.
How can I summon a lightning strike that doesn't deal damage? I tried player.getLocation().getWorld().spawnEntity(player.getLocation(), EntityType.LIGHTNING, CreatureSpawnEvent.SpawnReason.CUSTOM); and World#strikeLightning but both deal damage
strikeLightningEffect?
Hello
PlaceholderAPI have a parser that i can add it to mine plugin?
lore example %player%
itemmeta.lore(Parser.parseKyori(RewardFile.getStringList(sezione.getCurrentPath() + ".lore")));
You need to edit the list to add the placeholders then set the lore with the edited list.
Mmmh ok
um. PlaceholderAPI.setPlaceholders
use that static method to replace placeholders
Does that take in lists now?
no. I just realised its a list of strings. but they can easily use a stream or create a utility method for it
Yeah i will add it to mine Parser
Suggestion for the api then xD
you can open an issue on github for it. not a bad idea I usually didn't really care as its very easy to just stream it. but it wouldn't be that bad to just have a setPlaceholders method that takes in a collection of strings and returns another back
I don't "do github" lol I barely like posting my shit to it. I'm sure its already been requested anyways.
Nothing stops you from opening an issue LOL
let it go gaby. I'll just do it
Nah I get that. I just don't like too
pretty sure u can do lists now
what?
yeah wasn't that added a while back
omg you're right
I didn't know about it
@ripe island no need for the extra util methods
there's already methods for that in PlaceholderAPI
and its been there for a while now
I had no idea
lmao
..?
public static List<Component> parseKyoriPAPI(List<String> message, Player utente) {
List<Component> parsed = new ArrayList<>();
for (int i = 0; i < message.size(); i++) {
PlaceholderAPI.setPlaceholders(utente, message.get(i));
parsed.add(i,MiniMessage.miniMessage().deserialize(message.get(i)).decoration(TextDecoration.ITALIC, false));
}
return parsed;
}
I doit this but don't work :C
Method names?
no need to do all of this
change this code
to:
itemmeta.lore(Parser.parseKyori(PlaceholderAPI.setPlaceholders(player, RewardFile.getStringList(sezione.getCurrentPath() + ".lore"))));```
Oki
papi supports list parsing apparently
and it has for a long time. I just didn't know bcz I'm dumb xD
Btw append the component to an empty component that has italic set to false, rn it will override the italic thats set manually
thank you gaby โค๏ธ
Anytime brother
for agreeing with me
ngl I didn't know either ๐ฌ
ok. minimessage question. what exception does MIniMessage throw when you deserialize a string which has section symbols in it? I can't seem to find it.
is it not actually an exception?
it is
and as I type I found it
just used IntelliJ's scope searching lol
its a ParsingExceptionImpl
wonder why the javadocs don't mention it tho.
it's not something you should expect to happen
well
https://github.com/KyoriPowered/adventure/blob/69683764a1a1cb6e9369531e11b7f261f98fde84/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/internal/parser/TokenParser.java#L168 and probably because is thrown from an internal class 
but I agree it should be documented
also. the client parses colors like ยงA? I thought its case sensitive.
good to know lol
Emily, while you are here, is there a better way than this to get all permissions that start with a certain value to compare them? Ignore the comments
return LuckPermsProvider.get().getPlayerAdapter(Player.class).getUser(player).getNodes().stream()
.filter(NodeType.PERMISSION::matches) // Accept only permission nodes
.map(NodeType.PERMISSION::cast) // Cast the node
.map(PermissionNode::getPermission) // Get the permission
.filter(it -> it.startsWith(node)) // Filter permissions that start with the specified node
.map(it -> it.replace(node, "")) // Get the value
.map(Ints::tryParse) // Try to parse it to an integer
.filter(Objects::nonNull); // Filter possible null values```
basically there's this permission like something.duration.X and I need to get the highest X of all the permissions the player can have
can you remove all the leading spaces? can't read shit on mobile lol
return LuckPermsProvider.get().getPlayerAdapter(Player.class).getUser(player).getNodes().stream()
.filter(NodeType.PERMISSION::matches) // Accept only permission nodes
.map(NodeType.PERMISSION::cast) // Cast the node
.map(PermissionNode::getPermission) // Get the permission
.filter(it -> it.startsWith(node)) // Filter permissions that start with the specified node
.map(it -> it.replace(node, "")) // Get the value
.map(Ints::tryParse) // Try to parse it to an integer
.filter(Objects::nonNull); // Filter possible null values```
or that
Flip your phone
lol
this is probably better xD
you should really really really really be using meta nodes
fair, fair
and meta data cache
emily, while you're here, ๐
oh. those are also a thing. I forgot about meta.
lol for a second I thought discord is broken when I saw Emily and Emilia typing LOL
well discord is still broken
yeah the CachedMetaData is precisely for this stuff but they have their own "format"
everything in the Cached*Data is calculated
by format you mean like key=value (e.g. context)?
ah like a permission
lp metadata is awesome and more people should abuse it
yeah but those are treated specially precisely to be used as a Map lookup
do I want getMetaValue or queryMetaValue?
most likely get
Real question... Has anyone actually used vault for any of its other features besides economy xD
permissions?
query returns a Result? it can have some added benefits but for the most part just get is fine
ah I thought it returns all metas with that key (like from all groups the player has)
deluxemenus uses the permission features. there's also a vault chat plugin that uses the chat feature
a single meta key always evaluates to a single value (in the same sense that a single permission key evaluates to a single true/false/undefined result)
LP takes inheritance and all that into consideration when calculating it
for a second I thought normal metas also have priorities, but looks like that's only for prefixes and suffixes, which is great
yeah
Ok cause I never see plugins use those methods and only just read the resource page a month ago xD
this is great wtf
there are some configurations regarding meta ordering and something about weight, don't remember exactly, I remember suggesting adding weights to meta nodes and luck pointed me to the config lol
[LP] -> max-ban-duration = '12' (inherited from self)
[LP] -> max-ban-duration = '1' (inherited from default) ```
I wonder which one will be returned 
:d
Because I need the lowest for one meta and the highest for another 
I love that you can configure it per meta key
๐ง
You got me this time
I did indeed
Man I love LP
I've never seen anyone make use of those settings, it's always nice when you do
can't you get all the values for a given key anyway
True, but most people use like 20% of what lp can do: permissions and prefixes/suffixes
Yes
but it's better if LuckPerms does the work it already can, no? ;d
i don't think i've ever perceived the metadata as anything but a key-value storage with multiple values per key, that's how i always use it
well, "yes" i suppose
but for the majority of use cases one needs a single result, ideally aligned with the inheritance rules
I guess an exceptional example could be discord roles, and mapping your plugin key to the role id
so if you have many roles you can still fetch them all
anyone wanna make a srv? Dm
no
lol
i guess i just haven't encountered such an usecase lol
it's not hard to come up with examples, say you have a chat plugin and your name colour is determined by a meta key, funny-chat-name-colour
default could be white, VIP green, admin something else etc
no no i mean i haven't personally implemented anything with that usecase
ah
Hi guys in mine GUI i need to load 12 blocks that have on lore 2 Placeholders and i'm parsing it with PlaceholderAPI.setPlaceholders
(the for(cycle) of these items is Bukkit.runasynctask) but for loading 1 of these items with placeholders takes about 1 second per block
itemmeta.lore(Parser.parseKyori(PlaceholderAPI.setPlaceholders(player,
MenuFile.getStringList(sezione.getCurrentPath() + ".lore"))));
This are the placeholders how i can improve the performance?
public @Nullable String onRequest(OfflinePlayer player, @NotNull String params) {
if(params.equalsIgnoreCase("level")) {
return String.valueOf(instance.getDatabaseManager().getLvl(player.getName()));
}
if(params.equalsIgnoreCase("exp")) {
return String.valueOf(instance.getDatabaseManager().getExp(player.getName()));
}
return null;
}
doing database queries in a placeholder (or anywhere on the main thread) is an incredibly bad idea
you should be caching things rather than always querying the database
In this case repeat the request everytime
Create a class and use maps or what ever you prefer to cache the data then set the data in the database when you no longer need it cached
mmmh oki
it fires when the player hand visibly swings
it's ultimate stupidity
what
you're comparing nothing to 71
one more thing
so I need to add && < 71?
well it depends on what you're trying to achieve?
what do I have to do so it prints 2 instead of one when the first int is 71?
if (idade == 71) {
// PRINT 2 HERE
} ```
I wanted something like
if first int is superior to 18 but lower than 71
print one
if first int is 71 or superior
print two
otherwise
print three
i am doing exactly like the guy on the tutorial is doing and his works perfect
mine doesnt
if (idade > 18 && idade < 71) {
System.out.println(1);
} else if (idade > 71) {
System.out.println(2);
} else {
System.out.println(3);
}``` it really sounds like you need to find a better tutorial
Online Courses:
Online courses are also great for learning java. Some websites that offer them are:
- Coursera - Free unless you want a certificate
- PluralSight - Great courses from what I've seen. Mostly Paid
- Udemy - Never used them myself but they seem to all or at least most be paid.
My first ever course was one from Coursera. - I can say it was pretty good at introducing me to the programming world as a whole not just java.
Oracle Docs:
Oracle docs can help a lot at learning and understanding java:
- Start with this,
- Breeze through this (skipping stuff that doesn't seem relevant like bitwise operators),
- Hit this.
They're the first three from this larger thing which you should definitely go through overall. But those three should be enough for slightly better understanding of what is happening here without feeling like a huge time sink.
That one is a small part of this larger site wherein "Essential Java Classes" and "Collections" also have good useful stuff
Other services:
Some other cool services that will help you learn java are:
As you can see there are plenty of good ways to learn as long as you're willing to invest the time. Have fun learning!
you can try some from here 
all of these are paid
youtube is free
well im not doing exactly like the tutorial
as his starts with false and mine starts with true
but anyways
JetBrains Academy has a 3 month free trial and it has exceedingly good reputation
That you still have to input credit card info
If I had one Id do it but I dont
do you? I thought I've set that up before without it
most likely
I mean have you tried it? if not I do recommend you try at least.
it clearly says its not actually required. you just need an account
i'll check it out then
Guys i need some help, im getting this bug
java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getUniqueId()" because "java.util.List.get(int).p" is null
at com.blockbreakreward.handler.BlockBreakEventHandler.AddBlockBreakToPlayersList(BlockBreakEventHandler.java:85) ~[?:?]
but my code is check if its not a null value
if (Plugin.plugin.players.get(i) != null) {
if (pler.getUniqueId().equals(Plugin.plugin.players.get(i).p.getUniqueId())) {
PlayerProcessor.CreatePlayerFileAndSetValue(pler.getPlayer(), p);
return;
}
}
:\
secs let me take a look
fixed it, nvm โค๏ธ
Anyone know how to fix this in my yaml? (<unknown>): did not find expected key while parsing a block mapping at line 128 column 9
Run it thru a yml checker @lucid mica
anyone here got experience with mythic mobs API
private final BukkitAPIHelper mythicMobs = MythicBukkit.inst().getAPIHelper();
im trying to get instance but its returning null
172 | # if they don't match the defined IP ...
173 | # You can use * as wildcard (127.0.0 ...
174 | # Example:
175 | AllowedRestrictedUser:
--------------------^
176 | - FriedBee;IP
177 | AllowedRestrictedUser: []```
Didn't fix it
I can't see the full indentation but that's your issue.
How will I fix it?
Can I just paste in the text
Wdym
That doesnt do anything, there is 2 red lines and the first says "All mapping items must start at the same column" and "Map keys must be uniqueYAML"
I have already done that
That didnt help at all
Fixed it
Is there anything I can do to stop player's health going back to 10 hearts when the rejoin, even though their max health is 13?
once a recipe is registered, is not possible to replace it while the server is running?
I tried this but the old recipe is still in-game
Bukkit.removeRecipe(recipe.getKey());
Bukkit.addRecipe(recipe);```
Need to do it via nms
whats the difference between if and switch?
will it change anything? one is faster than the other?
Bukkit.removeRecipe(recipe.getKey());
Bukkit.addRecipe(recipe);
for (final var player : Bukkit.getOnlinePlayers()) {
player.undiscoverRecipe(recipe.getKey());
player.discoverRecipe(recipe.getKey());
}```
Easy fix
Does anyone know a lightweight/open sourced runtime dependency manager?
haha
It might be a little broken but I think there's forks that fix it.
hahaha
do you really maintain it?
yea
I use it for one of my projects
without it my jar would be like 80mb
lol
I think I counted 26 dependencies
๐คฃ
it's all because of the kotlin script thing I think
I keep forgetting to take it out (it doesn't even work rn since it's relocated)
but even still the jar size is too big to send through discord (plugin is for a server owner)
just get nitro
I just used wetransfer ๐คท
first thing that pops up
when google "file transfer" or somethign liket hat
help
?help
ยป Give the helpers some details
ยป Ask suitable questions
ยป Be polite
ยป Wait
I made an infinite loop on intellij and now I can't stop it
wha
how do I stop it
what now
is that really the only way to stop it
Uhh
it is one way
the easiest way
other way is restart your pc
๐
or signing out
so you are telling me you cant stop a loop without closing the program
I don't know what you mean by loop
I'd guess that you already tried to close the program
i already tried that
and what happened
the issue is that the program started the loop again after a few seconds
what program is this
intellij
what code are you running
how do you know that it's still running then?
Just press the red square, if it doesn't stop then, it should've replaced the red square with a skull emoji (I think) which you can press to kill the loop
variable1++;
sout("I will be here forever. " + number)
}
that was the code
and it just didn't stop
Shutdown your computer? xd
Just press the red square, if it doesn't stop then, it should've replaced the red square with a skull emoji (I think) which you can press to kill the loop
or close intellij
or end task
or show an entire screenshot and I'll tell you what to do
task manager and kill java
the program is already stopped I guess then
Do this if you selected the second option when closing intellij
or do it if you want to make sure
It can sometimes still be running in the background if it doesn't exit properly so task manager to be sure

imagine you restart your pc and somehow the loop is still going
Lmao
you using windows?
yes
you could also delete system32, it would kill any looping process
lol
but it would also kill your computer
๐ด but no ๐ช
thats my computer screen rn
I'd expect him to know what that commanad is
oh shit
yeah they do
no problem. use this information in your next coding session
I appreciate the knowledge that you bring to me!
Will do.
I think it will improve my coding speed
I did not know that goats lived in mountains
yeah helped me a lot
is possible to get the entity from a Merchant?
I get it from Inventory click event final var merchant = ((MerchantInventory) event.getClickedInventory()).getMerchant();
But is not an instance of Villager or AbstractVillager
Guh. The only thing I slim is Kotlin. I keep around 4MB or just under without it. With it I'm probably more like 7MB?
Merchant.getTrader() ?
that's the player I think ๐ฌ
Gets the player this merchant is trading with, or null if it is not
ye
I tried merchant intanceof Villager villager and it didn't work
Odd. Debug it i guess
[19:51:32 INFO]: [AeroQuests] [STDOUT] merchant.getClass() = class org.bukkit.craftbukkit.v1_19_R1.inventory.CraftMerchant
[19:51:32 INFO]: [AeroQuests] [STDOUT] (merchant instanceof AbstractVillager) = false
[19:51:32 INFO]: [AeroQuests] [STDOUT] (merchant instanceof Villager) = false```
I'm not even seeing CraftMerchant in the java docs? Or atleast when google searching
its the craftbukkit class
that extends Merchant
its basically the implementation of the merchant
What about instanceof WanderingTrader?
no
Try using InventoryHolder casted to villager
Very pog 
๐
thanks yapp
np
Does anybody know if it is possible to edit the chat message after it was modified by VentureChat? It has an event but it is immutable ๐
thats a no then ig
stupid plugin
reflection time
because it uses the data passed to that event https://github.com/Aust1n46/VentureChat/blob/master/src/main/java/mineverse/Aust1n46/chat/listeners/ChatListener.java#L503-L512
yup, it worked
is there a way to uninstall fuckin nms and install it again in an older version?
and the spigot server too
i need to know
change the dependency version
ok at this point you know i am a beginner
and you know you will have to explain me this
but i am not as dumb as i was before
I actually did watch some java tutorials
and now i know the basics of java
run buildtools but with the diff version
so you dont need to talk like you are talking to a 5 year old
you can talk like you would talk to a 7 year old basically
so we have that
lol
as simple as that?
I don't need to delete any files
yes
yes
ok thanks
np
can I use the same folder I used for the 1.19 buildtools btw?
just delete whats in there
and another thing
do i have to redo all my spigot projects?
and ANOTHER thing
do I have to do something else for creating projects for that specific version i want?
@dusky harness
yes
no
no
yes - change the version to the different nms version
which I'm guessing you'd know how to do since you already selected an nms version
yes
thanks for the help
๐
how the fuck do I downgrade my java version
I wanted to downgrade it to java 10 but I just cant download from oracles official website
it asks me to create an account
because I need to develop plugins for 1.12.2
and I cant download nms with java 17
not for 1.12.2
yeah 8 or possibly 11 should work then
You can just give it the full path to the java 8 or 10 bin files
he didn't have java 8 or 10 installed
Yeah, just letting him no he doesn't have to downgrade the installed version
running buildtools in the IDE ๐คจ
Can u help me?
is there a way to hide the player model from the client maybe by resource pack or something? I want to hide the player from themselves and using an invisibility potion will still how them as just transparent.
Spectator mode
Because you added a semicolon right after your second for loop
So f = 5
but the highest index is 4
that's why you should declare the variable in the loop header
Hi, any idea, why is
this line
int savedPlaytime = playersCollection.find(filter).first().getInteger("playtime").intValue();
causing this error?
java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
playtime is a long, not an int
its int64 in document
an int64 is a long
๐ค
I mean yeah Java int is 32 bit but still but ig it makes sense ty
yeah. the method naming there is very weird. Idk why they couldn't have just said long instead.
the player still needs to be able to move like a normal player
its not a static method.
why not you (not going to insult you)
use listaDeNumeroCabulosa.toString();
instead
hmm tho there should be a static method tho iirc
now it says unexpected token
yeah. weird.
yeah the previous method I tried worked for the guy thats teaching me
but not for me
and im completly sure I did everything exactly like he did
same thing
I fixed it by myself but
the method you gave me is not what I wanted to do
I wanted to print them out individually, not add them
print them on individual lines?
then you will want to for loop over the array and print them
no
print them in the same line
but individually
is there possibly any way that I could develop a plugin on spigot that would randomly and automatically spawn mobs made with the custom mob plugin?
its for a tower defence minigame
except you are the one killing the mobs
so the waves would be infinite
and automatically generated
its definitely possible. but judging by the posts you've made in the past few days its most likely out of your capabilities. I do recommend you practice some more java first.
im learning, this isn't a project for now
I want to do this as soon as possible of course but I know that it will take some time
maybe a few weeks
best thing i can do in spigot now is a plugin that welcomes you or says bye when you enter or leave the server
and even then I need help for this lol
Hi, how can I update string in object in object (key)?
var value = 1;
Bson playerUpdate = Updates.set("???", value);
are you asking how you would change the "???" into a different string?
nope, jsut want to change value of servers.kitpvp.key
but i dont know how to access servers.kitpvp.key
look into the bson api, you probably need to access 'servers' then 'kitpvp' then 'key' with separate statements
๐ :*
still didnt found it :d
aight, the dots are working fine, i forgot to convert uuid to string...
can someone explain to me why the error 'can't resolve' symbol keeps annoying the living shit out of me
here's the code
public static void main(String[] args){
/*
Classes & Declaring Objects (Ep. 17)
*/
class Human {
String name;
int age;
static boolean isMale;
double height;
double weight;
String species = getClass().getSimpleName();
}
Human human1 = new Human();
human1.name = "Peter Griffin";
human1.age = 44;
human1.isMale = true;
human1.height = 1.80;
human1.weight = 122;
System.out.println("Hello, my name is " + human1.name);
System.out.println("I am " + human1.age + " years old!");
//Unmovable rock in the way
if (isMale == true){
System.out.println("Im a man!");
}else{
System.out.println("Im a woman!");
}
System.out.println("My height is " + human1.height + " meters, and my weight is " + human1.weight + " kilograms.");
System.out.println("I am a " + human1.species + ". Ehehehhehehehehe");
Human human2 = new Human();
human2.name = "Lois Griffin";
human2.age = 48;
human2.isMale = false;
human2.height = 1.72;
human2.weight = 52.16;
System.out.println("Hi, mah name is " + human2.name);
System.out.println("I am " + human2.age + " years old!");
System.out.println("I am " + human2.height + " metahs tall!");
System.out.println("My weight is " + human2.height + " kilograms.");
System.out.println("My husband's name is Petah and " + human2.isMale);
}
}
specifically this part
//Unmovable rock in the way
if (isMale == true){
System.out.println("Im a man!");
}else{
System.out.println("Im a woman!");
}```
it keeps saying that it cant resolve symbol 'IsMale'
even though i did absolutely nothing wrong
from that code shouldn't it be
if (human1.isMale == true){
System.out.println("Im a man!");
}else{
System.out.println("Im a woman!");
}
that's how it was before
and it worked for peter griffin
now that I added lois to the collection it doesn't work
it doesnt work for her
not even if
not even if I just change the object name
human2.isMale == false?
yes
look
it wasnt working
so all i did was
human2.name = "Lois Griffin";
human2.age = 48;
if (human2.isMale == true){
System.out.println("Im a man!");
}else{
System.out.println("Im a woman!");
}
human2.isMale = false;
human2.height = 1.72;
human2.weight = 52.16;
System.out.println("Hi, mah name is " + human2.name);
System.out.println("I am " + human2.age + " years old!");
System.out.println("I am " + human2.height + " metahs tall!");
System.out.println("Mah weight is " + human2.height + " kilograms.");
System.out.println("Mah husband's name is Petah and " + human2.isMale);```
and instead of sayin im a woman
it says false
why
static i presume?
well
before the variable wasnt static
but now it is because the IDE kept me giving another error
I don't actually have to put the same lines of code for every object right?
I should be able to put it just once
if you want to create a unique Human yes
you can setup default values though
that's not really what i am trying to do
so I am looking for a database tools and wanted to try SQL Server Management Studio 2019 but I cannot get it to connect to my remote mariaDB server I am guessing this is not possible?
it should be possible
hmmm I think now I see whats happening
notice how the if is
if male then print "im a male"
if woman then print "im a woman"
whats happening is that
OOOOH
its exactly this
eureka
because Im saying to print "im a woman or im a male"
you don't validate if null
but here System.out.println("Mah husband's name is Petah and " + human2.isMale);
so if isMale isn't set it defaults to is female
im just telling it to say if the variable is true or false
get it?
it's outputting the information to console
yes
the console is saying
'Mah husband's name is Petah and false'
I wanted it to say
oh do you want the console to say is male
yep
Odd do you know how because I am using the correct data to login to connect but it is failing. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
look at class methods for something like
class Human {
String name;
int age;
static boolean isMale;
double height;
double weight;
String species = getClass().getSimpleName();
public String getGender(){
if(isMale){
return "male";
}else{
return "false";
}
}
}
then use
Human human = new Human();
...
...
human.getGender(); //<- this will return "male" or "female"
a quick google search found this
Go to control panel.
search for services.
Open Local services window from your search results
Restart your MSSQLSERVER service.
Is there a way to change the amount of golden hearts I get when I eat a god apple?
It is just a potion effect
Tou can print gender with one line
System.out.prinln(human2.isMale ? "Im a man!" : "Im a woman!");
It is a inline if statement
Pretty useful thing, i use it a lot
First you put your if statement, then question mark and then put what it should return if true and then colon for false and return smth
Ternary operator
Don't need ternary operators in Kotlin ๐
true, but sometimes looks better than if (x) y else z
Then there's y if x else z ๐ท
python?
yea
Anyone know why I'm getting absorption iv and not 1? My code is p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION, 2400, 1), true);
d;PotionEffect#PotionEffect
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles)```
Creates a potion effect with no defined color.
type - effect type
duration - measured in ticks, see getDuration()
amplifier - the amplifier, see getAmplifier()
ambient - the ambient status, see isAmbient()
particles - the particle status, see hasParticles()
amplifier 1 is level 2
I know, I set it to 0 but it still gave me iv
So I changed it to 1 to see if that changed anything but it still kept giving me iv
@Deprecated
boolean addPotionEffect(@NotNull PotionEffect effect, boolean force)```
Adds the given PotionEffect to the living entity.
Only one potion effect can be present for a given PotionEffectType.
no need to force since multiple effects of the same type are now supported.
whether the effect could be added
effect - PotionEffect to be added
force - whether conflicting effects should be removed
no need to force since multiple effects of the same type are now supported.
let me try without force
Nope still IV
If it changes anything its for when I'm eating a god apple. I'm changing the effects for when you eat it
And I'm using 1.12.2
make sure you cancel the event and add your own effects
yeah I've tried that but when you keep holding down right click you cant eat another god apple after you already ate one you have to let go off the mouse button then repress it down
Is possible to get all items crafted? If I use click + control to take all items I get only one from ItemCraftEvent but 16 in inventory
org.bukkit.event.inventory.CraftItemEvent#CraftItemEvent
org.bukkit.event.inventory.CraftItemEvent#getInventory
org.bukkit.event.inventory.CraftItemEvent#getRecipe```
not many things I can use I guess
I hoped maybe PlayerStatisticIncrementEvent will fire once
but it is ok I guess
Hello, is there a way to automatically translate the item of the player with the language he is using ?
depends where you need that, @mystic gull
for messages, there's adventure, which offers TranslatableComponent s
I just want to translate like "You received [item_name] !"
do you use paper?
yes
Ok, what you need is Component#translatable and then pass a translatable instance, on paper, Material extends Translatable
text()
.append(text("You received "))
.append(itemStack.displayName())
.append(text('!'));
:)
does ItemStack#displayName fallback to the item type?
it returns whatever the vanilla system uses for, e.g. the feedback for /give and such
hmm, interesting
Hi ๐ I need to print placeholder asynchronously but because it's on quit event, empty string is printed, how could I solve that?
@EventHandler
public void onQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
System.out.println(PlaceholderAPI.setPlaceholders(player, "%player_health%");
});
Why do you need to print it asynchronously
real code do db query
Player is null by the time async runs. (not the variable)
basically im trying to save placeholder(s) value to database on quit
take the placeholders before jumping to the async task
or just use player.getHealth() ๐คจ
(synchronously)
the placeholder is just for test
it can be any placeholder
Ohhh
get the placeholder, save it to a variable, then do the db stuff async ```java
@EventHandler
public void onQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
String result = PlaceholderAPI.setPlaceholders(player, "%player_health%");
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
// db stuff
});
๐
time to be that dumbass that uses c++ in a place full of java
So, I'm currently messing with JNA shit bc I want to make native notifications using the windows sdk thing, the part of the java part (like accessing the .dll and shit) is clearer than shit, my problem now is to setup that fricking .dll, I know the basics of c++ and should have no problem on making the code in c++, but I also need to setup the windows sdk thing so I can bundle it into my .dll, which is kind of a problem.
if anyone can help with this I'd be very thankful
and before anyone says I have tried things like notify
but I dont like the result
how do I give custom texture to player heads in paper
for some reason GameProfile isnt available in paper
is it possible to detect if an arrow was shot at full charge?
I use this dependency https://github.com/deanveloper/SkullCreator
oh
#getForce() in EntityShootBowEvent ig
Hi i'm try to use protocol lib to get when a player press TAB in the chat to cancel / change what the user got right now i'm at the start of this project and i want to know how to do certains things ->
Here a link of a error with the code
https://pastebin.com/VpBcLCd5
at the error i get net.minecraft.server.v1_8_R3.PacketPlayOutTabComplete@30392545[
a={/?,........}
]
and i want to know to get this thing (the a)
so i'm here to ask you this
thx for read me and thx for any kind of help
what is a?
like what does it represent
if you mean the text, then it's event.getPacket().getStrings().read(0)
and it should be the same on all versions
does anyone knows if redis or specifically jedis is thread-safe
or should i create a queue based system for publishing messages
i'm whit server not client
wdym
the "Client" means client -> server packet
super(SL_Main.getInstance(), ListenerPriority.NORMAL, PacketType.Play.Server.TAB_COMPLETE);
PacketType.Play.Server.TAB_COMPLETE
and a is a private string[] from the Packet class :
public class PacketPlayOutTabComplete implements Packet<PacketListenerPlayOut> {
private String[] a;
public PacketPlayOutTabComplete() {
}
public PacketPlayOutTabComplete(String[] var1) {
this.a = var1;
}
public void a(PacketDataSerializer var1) throws IOException {
this.a = new String[var1.e()];
for(int var2 = 0; var2 < this.a.length; ++var2) {
this.a[var2] = var1.c(32767);
}
}
public void b(PacketDataSerializer var1) throws IOException {
var1.b(this.a.length);
String[] var2 = this.a;
int var3 = var2.length;
for(int var4 = 0; var4 < var3; ++var4) {
String var5 = var2[var4];
var1.a(var5);
}
}
public void a(PacketListenerPlayOut var1) {
var1.a(this);
}
}
but i'm going to try the thing you say with the packetwrapper
use the code block i gave you, the packetwrapper is what I used to find that code block
My plugin all work fine, but THIS METHOD with this database call give me a lot of lag problems in the server
@Override
public @Nullable String onRequest(OfflinePlayer player, @NotNull String params) {
if(params.equalsIgnoreCase("balance")) {
return String.valueOf(instance.getGems().bilancioPlayer(player.getName()));
}
return null;
}
What i can use?
Bukkit.getScheduler().runTaskAsynchronously(); say invalid return value
Cache it using a map, also storing names might not be a good idea
Retrieve player data every couple seconds or so and store it in a HashMap
then in onRequest get from the hashmap
that not working i use this packet PacketType.Play.Server.TAB_COMPLETE and the wrapper use this one PacketType.Play.Client.TAB_COMPLETE
oh you're doing clientbound tabcomplete?
oh you are
oh are you trying to modify the tab completion
and if i use the wrapper for server packet that not working because i need a class from mojang (Suggestion)
try this
thx and i'm goind to kill my self i see why its wasn't working
thx a lot
Hello, i need help. If i want make new menu is dont registred. https://paste.helpch.at/rujasotuwa.http
error: https://paste.srnyx.xyz/recuzoqotu.txt
issue regarding error: https://github.com/PlaceholderAPI/PlaceholderAPI/issues/515
code: https://github.com/srnyx/Server-Expansion
how do i set the main class?
i thought i had done it with application.mainClass.set("io.ktor.server.netty.EngineMain") (i have no idea what io.ktor.server.netty.EngineMain is i did this a while ago), i tried changing it to com.extendedclip.papi.expansion.server.ServerExpansion but that didnt work either
I'm not sure if this issue is related to the github issue
i dont even know what to say, why is there ktor being used for papi placeholder expansion?
and plugins/expansions should not have their main class set
Also make sure to relocate your dependencies
wait a minute
ktor isn't even in your build script ๐คจ
and it's in java
Uhhhhh
If this error is coming from your expansion, make sure to relocate caffeine
If not, then identify what expansion is causing this issue
you shouldn't set the main class and you shouldn't be using ktor here
ignore ktor i think i had copied the applications main class thing from somewhere and just forgot to change it ๐ญ
cause i literally have no idea what ktor is
ok still why do you have a main class
placeholders do not need them
as dkim19375 aka kotlin = best aka kotlin = best said
remove expansions (yours first) to see which is causing this error
relocate caffeine
how do i do that?
yeah thats probably the issue
uhh
tasks.shadowJar {
relocate("com.github.benmanes.caffine", "com.extendedclip.papi.expansion.server.libs.caffeine")
}
@dark garnet
and remove the application plugin
and update the papi dependency :))
yea i havent touched this expansion in a long time
what exactly does this do? just so that i understand it
changes all of caffeine's packages to a custom one
so that it doesn't conflict with other plugins or expansions
ahh
used this (after fixing the typos smh) and it worked, ty 
correct pattern was com.github.ben-manes.caffeine
you sure?
the error said benmanes
implementation("com.github.ben-manes.caffeine:caffeine:3.1.1")
oh
either one works uh oh
not including it at all works too
lmao
if you open up the jar in winzip or something
you should only see com.extendedclip...
(and maybe like a META-INF file etc)
yeah
Anyone know why I'm getting absorption IV and not 1? p.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION, 2400, 1), true); When I cancel the event then add my effects it works but it doesnt remove the golden apple and all other stuff that it messes with lol
Assuming I would like to listen for all events that could remove blocks (like BlockExplodeEvent, BlockBurnEvent, etc), is there an extensive list of what events should I listen for to acomplish this goal?
Note that you'd also have to handle state updates too (ex breaking the bottom of a tall flower, gravity block updates, etc)
safest way would probably to save the blocks in something like a schematic and compare the blocks using that
those are fine, I won't have to handle blocks breaking with gravity or blocks that break when their next block is broken, I just need to discover what events I need to listen to be notified of all normal block breaks
piston events
ยฏ_(ใ)_/ยฏ
although you prob got that already
oh wait
oh block breaks
nvm
don't care about pistons too
take a snapshot of the entire world
every tick
and compare it with the previous one

ooh why did I not think about that? ๐คฆโโ๏ธ You just solved my issue!
anything that is not considered automatic or periodic effect, in other words, all block breaks that require some kind of interaction of players or other entities
but it is gravity related, I don't care about gravity at all, nor pistons
ah right
sorry, I should have said "solid" blocks
okay
then... is there a list for those events?
by that it seems like you're saying if I use an item, so I guess
- BlockBreakEvent
- BlockExplodeEvent
- EntityExplodeEvent
- BlockBurnEvent
since this would also exclude grass etc which could be broken in other ways
so those are the only ones I can think of for full blocks, and left/right clicking from a player
Piston push event
nice, so that was it, thanks for the help dkim
that would require redstone
also cannot break full blocks (afaik)
BlockBreakBlockEvent in paper
Which is good for pistons and water destroying
BlockDestroyEvent which is also paper only
this event list apparently never end, do it? ๐
OH WAIT
ENDERMEN
I FORGOT
Endermen can pick up blocks
noooo ๐ฆ
Okay but you said no physics, only full blocks, only entity/player interaction so I think thats it
i dont think blockdestroyevent is required
unless theres something we missed
Oh one more
lol
@robust flower zombies breaking doors in hard mode
luckily I think this will never happen in the scenario I plan to use them for, but the enderman one might happen, what would be the event name?

fixed