#help-development
1 messages · Page 1679 of 1
RegexOne provides a set of interactive lessons and exercises to help you learn regular expressions
it does not
bump
mcp 🤮
old-ass version 🤮
🤮
why using such an old version lol
help pls
It's weird how people still ask "why use an old version?" when there's a fuck ton of reasons why you may want to do so.
Experimentation/curiosity, compatibility with other old mods that don't have ports, you just like that version, etc.
That excuse was fine 5 years ago
1.8 is now 6 years old. Let it die
Here's a fun website https://howoldisminecraft188.today
I'm currently working on a project that uses 1.7.10 :p and that version is 7 years old.
Why? Well, for one, I enjoy 1.7.10 and I think it fits the spirit of the modpack this project is for (it's meant to be nostalgic since it's basically a remake of a modpack I made years ago when 1.7.10 was still alive), and two, there's some mods that don't exist in newer versions, or at least don't have the same level of quality in newer versions (e.g. Extra Utilities removing Division Sigils in newer versions).
So, no. Let people use whatever version they want. Stop policing the version someone uses or else you look like one of those Forge assholes.
Hey anyone who can help is anyone familiar with MACOS and MySQL
Does anyone know how to disable collision using scoreboard packages?
At that point, wasn't the latest version 1.9 or 1.10? If 1.8 is 6 years old, then 5 years ago can't even be considered as an "excuse," it's just smart to support an older version since it was still commonly played 5 years ago.
Hell, some people still play 1.7.10 nowadays because it and 1.12.2 are the best versions for mods.
what are the arguments for PathfinderGoalFollowEnity?
Other people still play 1.8 because it makes/made PVP less jank on some servers.
who said I was using an old version?
I think it was assumed by the lack of properly mapped parameter names.
e.g. p_549065_yourmom instead of somethingSensible
well idk what then
TeamOption
Do you have any examples?
the fact that you use sr. i'm kind of 99% sure, that's a ScaledResolution
that got removed/replaced someday
For some reason Block#getDrops doesn't work properly on BlockBreakEvent
Is there a way to go around that issue?
hola Real
waiting
BlockDropItemEvent
still indexing
@sullen dome Didn't work
I just did something else and it worked
this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1);
i believe there's even drawCenteredString, if you need that
I'm not drawing text though
how do you create an empty Collection<ItemStack> variable?
You can't create a generic Collection
You need one of its implementations
It varies based on your use case
also that thing I sent was the the one in GuiMainMenu
But ArrayList is the most common
kk
So, Collection<ItemStack> items = new ArrayList<>();
ty
What happened to my getCommand thingy
This guy has the same code but no indent errors
shift+crtl+f
ok
nothing
select all of it and press tab
All at the same time make sure you are typing in the class. or the class is the highlight
nothing happening just text moving
the error shows this
The method getCommand(String) is undefined for the type Main
Works for me
i dont think the nodes are merging correctly
nvm redempt i wasnt setting the tail's next node
@quaint mantle You got it working?
Nice
Hey, it's not directly related to spigot but especially with the compilation of a java / kotlin project with gradle,
I could see with some research that when creating an android application it was possible via "buildType" to insert variables in the code when compiling, but despite my research I did not find any alternative to this outside of android development, does anyone have an alternative solution to have a similar result?
okay i'm at a loss
produces this
please ignore the clipped off end of the string at the front
the important part is that it's tacking on white numbers
it's clearly based on their position in the configured scoreboard
but here's the thing - this code worked fine before 1.17, and now it's adding those white numbers
with the api
SpawnParticle
iirc it is World#SpawnParticle
?jd
declaration: package: org.bukkit, interface: World
declaration: package: org.bukkit.entity, interface: Player
ok ty
i made a smol PlayerLoginEvent but it doesn't work
show code
@EventHandler
public void onLogin(PlayerLoginEvent event) {
try {
TimeUnit.SECONDS.sleep(5);
getServer().broadcastMessage("Кто-то зашел, это что, "+ event.getPlayer().getDisplayName() + "?");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
whats that
This tutorial will guide you in using the scheduler provided by bukkit. It will allow you to defer the execution of code to a later time. This is not the same as registering a Listener, a block of code which is executed in response to an event in the game. Blocks of code may also be scheduled to be executed repeatedly at a fixed interval, with o...
making the thread sleep will pause the entire server for 5 seconds
also, without sleep it doesn't works too
is it registered
idk ¯_(ツ)_/¯
i just noticed something
i did getServer().broadcrastMessage()
i think there should be something before getServer()
package ...;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.concurrent.TimeUnit;
public class testPlugin extends JavaPlugin {
@Override
public void onEnable() {
getLogger().info("Loading test plugin!");
}
@Override
public void onDisable() {
getLogger().info("Unloading test plugin!");
}
}
So I am having a few issues with logging online players to a text file with my plugin
public class eventPlayerCount implements Listener {
public static int playerCount = 0;
@EventHandler
public void addPlayerCount(PlayerJoinEvent event)
{
playerCount += 1;
discordPlayerCount.getPlayers();
}
@EventHandler
public void subPlayerCount(PlayerQuitEvent event)
{
playerCount -= 1;
discordPlayerCount.getPlayers();
}
public static int returnPlayerCount()
{
return playerCount;
}
}
it does technically work but the thing it produces is a box with a question mark around it, if needed I will share my file writing class
me.sab.exlpode.Main
paper server is giving and error that says
cannot find main
class
but I think what I have written in my plugin.yml is correct
Your class is called main, not Main
Paper will complain if you call your main class like that
how to register events?
What does this mean
It means the version on the disk is not the same as the one Eclipse has loaded
I think...
You need to refresh you project with the F5 key
org.bukkit.plugin.InvalidPluginException: org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register ..testPlugin.testListener@72617e4b while not enabled
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:157) ~[patched_1.17.1.jar:git-Paper-243]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.17.1.jar:git-Paper-243]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.17.1.jar:git-Paper-243]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:410) ~[patched_1.17.1.jar:git-Paper-243]
at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:276) ~[patched_1.17.1.jar:git-Paper-243]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1212) ~[patched_1.17.1.jar:git-Paper-243]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-243]
at java.lang.Thread.run(Thread.java:831) [?:?]
?
how'd you do that?
I guess you did Bukkit.getPluginManager().registerEvents(listeners, new MyPluginMain());
PluginManager pm = getServer().getPluginManager();
pm.registerEvents(this.testListener, this);
it's not the getServer() btw, pretty sure Bukkit just delegates to server calls so it doesn't matter
but still doesn't works
and where do you do that?
onEnable
that should work? Could you show the actual stacktrace?
The stacktrace you gave is obviously cut in half
this thing
[10:57:17 ERROR]: [[STDERR] ] org.bukkit.craftbukkit.v1_17_R1.legacy.CraftLegacy Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
[10:57:27 WARN]: Legacy plugin test_plugin v1.17.1-1.0 does not specify an api-version.
[10:57:27 ERROR]: Could not load 'plugins/testPlugin-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register com.andreasmelone.testPlugin.testListener@72617e4b while not enabled
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:157) ~[patched_1.17.1.jar:git-Paper-243]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:414) ~[patched_1.17.1.jar:git-Paper-243]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:322) ~[patched_1.17.1.jar:git-Paper-243]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:410) ~[patched_1.17.1.jar:git-Paper-243]
at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:276) ~[patched_1.17.1.jar:git-Paper-243]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1212) ~[patched_1.17.1.jar:git-Paper-243]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-243]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register com.andreasmelone.testPlugin.testListener@72617e4b while not enabled
at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:653) ~[patched_1.17.1.jar:git-Paper-243]
at com.andreasmelone.testPlugin.testListener.<init>(testListener.java:14) ~[testPlugin-1.0-SNAPSHOT.jar:?]
at com.andreasmelone.testPlugin.testPlugin.<init>(testPlugin.java:7) ~[testPlugin-1.0-SNAPSHOT.jar:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) ~[?:?]
at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:350) ~[?:?]
at java.lang.Class.newInstance(Class.java:642) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:83) ~[patched_1.17.1.jar:git-Paper-243]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[patched_1.17.1.jar:git-Paper-243]
... 7 more
thats all i have
remove the registerEvents call in your testListener constructor
(never register events in a constructor, ever)
that this.plugin.getServer().getPluginManager().registerEvents(this, plugin);?
yes
fyi, this is just naming convention, but your classes should be in PascalCase instead of camelCase
aka you should make testPlugin into TestPlugin because that's the more common way to capitalize in Java
and apparently PacalCase == camelCase
yes, confusing, I know, but apparently that is the case
PascalCase is just a commonly accepted name for a variation of camelCase, so I mean, you're not wrong
UpperCamelCase and lowerCamelCase
yeah
I prefer PascalCase bc it's shorter but those are the more specific names
at least, according to Wikipedia, since people haven't decided on a fixed definition for most variations of programming cases
Ok i'm working on my plugin which saves persistentdata onto hoppers, but can someone explain why does this code if (container.has(new NamespacedKey(BitMiners.getPlugin(), "miner"), PersistentDataType.BYTE)) {
result in false even though ingame checking the data it is indeed there:
:miner
Misspelled
well, is it actually saved as a BYTE?
where to check spigot 1.8 -> 1.9 changes and code difference?
"are you fucking instrumenting the class to change the method body of 'has'" /j
Someone explain why it's printing the different miners value?
(yes, my math is very bad)
hashrateList.add(i);
}
for (int i = hashrateList.size(); i > 0; i--) {
switch(i - 1) {
case 0:
lore.add(Utils.color("&9" + hashrateList.get(i - 1) + "H/s"));
case 1:
lore.add(Utils.color("&9" + hashrateList.get(i - 1) + "KH/s"));
case 2:
lore.add(Utils.color("&9" + hashrateList.get(i - 1) + "MH/s"));
case 3:
lore.add(Utils.color("&9" + hashrateList.get(i - 1) + "GH/s"));
case 4:
lore.add(Utils.color("&9" + hashrateList.get(i - 1) + "TH/s"));
case 5:
lore.add(Utils.color("&9" + hashrateList.get(i - 1) + "PH/s"));
case 6:
lore.add(Utils.color("&9" + hashrateList.get(i - 1) + "EH/s"));
}
}```
It has the value 10000
And that's what is ment to be displayed, but where tf is it pulling 9 from
case 1:
lore.add(Utils.color("&8&lCommon"));
case 2:
lore.add(Utils.color("&2&lUncommon"));
case 3:
lore.add(Utils.color("&1&lRare"));
case 4:
lore.add(Utils.color("&5&lSuper rare"));
case 5:
lore.add(Utils.color("&d&lEpic"));
case 6:
lore.add(Utils.color("&6&lLegendary"));
case 7:
lore.add(Utils.color("&d&k&llll&4&lM&c&lY&6&lT&e&lH&2&lI&a&lC&b&lA&3&lL&d&k&llll"));
}
```
Same thing here
@lavish hemlock youre smart
explain
meaning case 1 goes directly into case 2
and then it goes into the next case
and then into the next case
and eventually you're traversed the entire switch
See, in a good language, switch fallthrough is explicit.
Java is not a good language.
There are quite a bit of alternatives. Most of the require NMS and/or packets.
If I recall correctly, C# requires you to explicitly pass to the next case via a pass keyword.
You can always make it explicit with a few IDE/Gradle plugins
dont talk badly about my java >:(
Java is my sussy baka
If you dont want fallthrough you shouldn't be using standard switch statements anyways
are you assuming this person is using Java 16?
Well, if you are not using latest java you shouldn't be complaining about the language lacking certain features
It's like complaining that your computer is slow when it was made in 2005
Java doesn't have reified type parameters and this makes the generics system not as clean on the end-user.
Who uses switch statements in 2021 anyways?
switch > if else
-> > :
no im not smart
I dont use if else either
Or rarely
screw ->
I have one of the most up-to-date versions of Java possible due to me building openjdk/panama-foreign and I am complaining about the language lacking a certain feature :)
This looks like you should use a Map<Integer, String> instead of this monster switch case
I am trying to make a plugin that, when a player joins, it says their server name (I am using BungeeCord). However, whenever I use player.getServer() it returns null, and when I use player.getServer().getInfo().getName() it doesn't print anything.
<3 switch statement tho
you'd <3 a cleaner system more, trust me
And this should be a Map<Integer, Function<Integer, String>>
Its not bullying. Just a suggestion. If you like your switch case then keep it.
Map<Integer, Object> always scream Object[]
this would indeed be better
instantiating an array takes up less memory than instantiating an object most of the time, and you can set the default values of the array easier
(plus arrays are fixed size)
so if you want extensibility, Map, if you don't need it, array
Those versions are both really old and unsupported. If you want to find any information you will have to look
into old forum posts or find them out yourself by first loading 1.8 and then 1.9 to see if you have to update any
of your code.
yes but i want to find commits or specific changes in the code
?stash
You can look here ^
I coded a plugin that that writes every 10 seconds the position of a player to a file. But after a little bit of time there are not only a move.txt, there are other files like move.txt.save or move.txt.save.1. How can i stop linux to make this files ?
- If you do this on the main thread then this will lag the server.
- Show your code that writes the data to disk pls.
Sry i am not at home.
I tested it with 10 players a week long and there were no lags.
its not efficient to do it in main thread, you lose smoothness etc
I don't think writing something to a file every 10 seconds is a good thing.
You can do it simply with HashMap and save/load the location on plugin disable and enables.
Ok
But how can i stop linux make tihs saves?
Show code
How i sayed, I am not at home. But what can be the cause that linux makes that?
It's not the problem on linux?
Yeah pretty sure it's not Linux creating those files
Oh ok
Hey is there some fast way to sort array of objects by one of its property?
I can say that i every 10 seconds with a sheduler write the positions to a file
Use Arrays#sort
Yes. There should be Arrays.sort().
Do the classes implement Comparable?
Not yet, but your hints should be enought for me
You can either let them implement Comparable<SELF> or provide an external Comparator<YourClass>
My idea is to sort keys by color. First should be all black then all white. Whats wrong with this implementation?
Objects are not sorted
You need to consider the comparison cases when it’s a
black against black
white against white
black against white or white against black
is there some more clear way? For example black keys will return 0, Whilte 1, and then i use sth like SQL GROUPBY ?
could just return Boolean.compare(o1.isBlack(), o2.isBlack()); ?
that is one way to do it
Works 😄
Error occurred while enabling Lifesteal v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: Heart
what happened there ?
What is Heart
its a item
Heart is capitalized
i belive
it has to be heart
oh ok so it cant be capitalized ?
Probably because it’s suppose to be a name spaced key
key's must be lowercase
Rip gimme a few days to fix it
why tho? just change one char from upper to lowercase
It’s like a 2 seconds fix
i dont know how to use find and replace
tf
but turns out i didnt use the var hearts that much so it turns out to be a few minutes
go into the class, ctrl+r
enter old
enter new
hit enter
oh ok
Comprehensive guide right there 😆
if i get it right at least
sodium is kind of crazy when it comes to fps lol
oops wrong channel lol
we do a little gaming
currently re-creating a few structures
that's not really a lot of fps tho
for an amd gpu for 100€?
i think it is at 28 renderdistance tho
someone know how to set a skull skin with a link ?
oh yeah then it's quite a lot more.
i mean, i bought it in covid times for 250, but people say it's original is about 100€, but idk
rx580
damn, then it's good.
optifine is worse
yea
I use sodium over optifine everyday a week
only thing why i still sometimes use optifine is shader-options
yeah, optifine has some more options, I never use them tho.
some more?
fog and stuff
sodium (iris tbc) has no options at all when it comes to shaders
you can use some shaders... thats it
wait if i press ctrl + r it doesnt do anything
no
optifine has some options like disabling fog and whatever and other shit*
intellij
cringe
but tbh
optifine smh
a lot of that causes come from the 1.17 rendering changes, and of still not really beeing 100% optimized to it
at 16 distance
that's hillariously bad lmao
double playerMana = AureliumAPI.getMana(player);
double playerMaxMana = AureliumAPI.getMaxMana(player);
double lines = 10;
```How can I do lines (\||\||\||\||\||), they corresponding to playerMaxMana and the lines, that are filled by playerMana should be blueß
How can I calculate this?
@sullen dome we should prob move to #general
yea, my bad
Get a percentage out of 100% and then you can divide by ten then that’s how many lines
hey everyone, i have a maybe weird question but i want to ask it here cuz its related to spigot
i am thinking at creating some sort of library that will make creating simple commands easier like this (ik that code need to be published to external website but i think it is small enough to publish directly here)
and i am thinking is this useful or just unnecessary overengineiring
public class CommonCommands implements CommandListener {
@Command(name = "cc", syntax = "addkey {crateID: String} {playerName: String} {keyCount: int}")
public void onCommandCC(DCommand command) {
String crateID = command.getString("crateID");
String playerName = command.getString("playerName");
int count = command.getInt("count");
// Do some stuff here
}
}
any framework or lib is useful in a sense probably
and that doesnt look particularly over engineered
speaking of over engineered, then check out something like cloud
Example for HP and Mana.
private static final String HP_LOW_PRE = "§c";
private static final String HP_HIG_PRE = "§a";
private static final String MANA_LOW_PRE = "§7";
private static final String MANA_HIG_PRE = "§9";
public static String createBar(
final double max,
final double current,
final int length,
final String elem,
final String lowPre,
final String higPre
) {
final double percent = 1.0 / max * current;
final int highCount = (int) Math.ceil(percent * length);
final int lowCount = length - highCount;
return higPre + elem.repeat(highCount) + lowPre + elem.repeat(lowCount);
}
public static String createHealth(final double max, final double current, final int length, final String elem) {
return createBar(max, current, length, elem, HP_LOW_PRE, HP_HIG_PRE);
}
public static String createMana(final double max, final double current, final int length, final String elem) {
return createBar(max, current, length, elem, MANA_LOW_PRE, MANA_HIG_PRE);
}
I already had, but thanks. (:
the finals boy
final
😏
I've already asked this question before, but I'll have to ask it again because I still haven't been able to resolve this error.
This means that there is no JNI implementation for the current system.
Does this error occur on a headless machine?
what you mean with headless machine
Example: Linux server without GPU
i'm managing this library through maven
oh
i think not
https://paste.md-5.net/dekaduguzi.md Why does bukkitConfiguration.getKeys(true); return this weird?
Show your code pls.
Ok
public void validate(YamlConfigFile yamlFile)
{
Map<String, Object> validatedObjects = new HashMap<>();
List<String> wrongObjects = new ArrayList<>();
boolean missing = false;
yamlFile.saveDefaultConfig();
Configuration config = yamlFile.getConfig();
for(Map.Entry<String, ConfigClass> path : paths.entrySet())
{
String key = path.getKey();
ConfigClass configClass = path.getValue();
if(!config.contains(key))
{
System.out.println("Config does not contain " + key);
missing = true;
continue;
}
if(configClass.parse(config, key))
validatedObjects.put(key, config.get(key));
else
wrongObjects.add(key);
}
System.out.println("Wrong " + wrongObjects);
System.out.println("Missing " + missing);
if(missing || !wrongObjects.isEmpty())
{
yamlFile.saveDefaultConfig(yamlFile.getName().replaceAll("\\.yml", "") + ".invalidconfig.yml");
yamlFile.delete();
yamlFile.saveDefaultConfig();
config = yamlFile.getConfig();
for(Map.Entry<String, Object> validatedObject : validatedObjects.entrySet())
config.set(validatedObject.getKey(), validatedObject.getValue());
}
}
missing is always true because it can't find it
i'm trying to show the team name of a player in a scoreboard can someone explain me why this doesn't work https://media.discordapp.net/attachments/857624314811777034/883689496175050762/unknown.png
Some classes are custom
libgdx might need a GPU to properly work. Not sure. You should def ask this in the libgdx discord/github
You have to set a score, did you also set a DisplaySlot ?
So team.setScore(1); for example
yup
Your paths is missing the "plugin" at the start.
So "plugin.dogs.base.range" instead of "dogs.base.range"
I found that out, but I have no clue how to fix that, because I want to make it universal for every configuration
So you want to match the default config from within the jar with the currently deployed config?
Yes, to check if where for example a boolean is a boolean in the config from the server files
And that an integer not a boolean is
What do brackets around a minecraft item's display name mean? Custom Texture Data?
Ah thats a problem with the display component... Ive seen this problem a few days ago. Do you use keyori? Try updating to the latest server build.
im on the latest build and yeah im using adventure with a load of other libs
@lost matrix do you have any clue to fix it?
the problem is here because when the scoreboard show it display You are in the team : null but the player is in a team because i've set a prefix for a player when he is in a team but i just don't know how i am supposed to get the player team name because this doesn't work (sorry if my english is bad)https://media.discordapp.net/attachments/857624314811777034/883690986193182780/unknown.png
Cant remember what caused this. Try some stuff in a clean build and tell us if you found the cause pls 😄
Just load the yml from your jar and match it with the yml from the plugin folder
Yes but how to match it? I can't get the right keys
Show me how you get the keys.
Ok just with MemorySection#getKeys(true)
I save the original config for another name and get the keys there, and remove the file
Then the paths have to match.
Yes, but I get everything incomplete without plugin.
Show me how you build the paths structure.
The full class
Configuration is an interface, which will work for bungee and bukkit and it has all methods like Bukkit's yaml
for(String key : config.getKeys())
{
Sysout the keys after that and see if it truncates the "plugin."
Working...
Ok a moment
Building
[05:55:58 INFO]: Found key plugin
[05:55:58 INFO]: Found key plugin.world
[05:55:58 INFO]: Found key plugin.world.name
[05:55:58 INFO]: Found key plugin.world.autoreset
[05:55:58 INFO]: Found key plugin.game
[05:55:58 INFO]: Found key plugin.game.start
[05:55:58 INFO]: Found key plugin.game.start.countdown
[05:55:58 INFO]: Found key plugin.game.playing
[05:55:58 INFO]: Found key plugin.game.playing.gametime
[05:55:58 INFO]: Found key plugin.game.playing.playable
[05:55:58 INFO]: Found key plugin.game.playing.rejoin
[05:55:58 INFO]: Found key plugin.game.playing.hearts
[05:55:58 INFO]: Found key plugin.game.playing.chatformat
[05:55:58 INFO]: Found key plugin.game.dogs
[05:55:58 INFO]: Found key plugin.game.dogs.base
[05:55:58 INFO]: Found key plugin.game.dogs.base.speed
[05:55:58 INFO]: Found key plugin.game.dogs.base.health
[05:55:58 INFO]: Found key plugin.game.dogs.base.damage
[05:55:58 INFO]: Found key plugin.game.dogs.base.range
[05:55:58 INFO]: Found key plugin.game.dogs.upgrade
[05:55:58 INFO]: Found key plugin.game.dogs.upgrade.speed
[05:55:58 INFO]: Found key plugin.game.dogs.upgrade.health
[05:55:58 INFO]: Found key plugin.game.dogs.upgrade.damage
[05:55:58 INFO]: Found key plugin.game.dogs.upgrade.range
[05:55:58 INFO]: Found key plugin.game.dogs.max-target-distance
[05:55:58 INFO]: Found key plugin.game.end
[05:55:58 INFO]: Found key plugin.game.end.restart
[05:55:58 INFO]: Found key plugin.game.end.teleport
Just extend SimpleScoreboard
IMPORTANT: If you want to show the scoreboard you have to call update, this will update it for all players
This is the problem: I still get MemorySection:
[06:01:29 INFO]: Found key plugin.world
[06:01:29 INFO]: Key is universal: class org.bukkit.configuration.MemorySection
Oh so you need to properly handle the sub sections.
Yes, but how can I remove them? Just checking for with get?
There is honestly still so much happening in the background that i have no idea what you are doing.
Ok I will just try it
@Override
public Collection<String> getKeys()
{
Collection<String> keys = bukkitConfiguration.getKeys(true);
keys.removeIf(key -> get(key) instanceof MemorySection);
return keys;
}
Yes that works, now let's test overall
Why does MemorySection#get(path) return false if the value in the config is true?????
debug?
it can;t return false if the value is actually set true, unless you set the default true and not the actual value
try getBoolean?
No because I am making it universal for all objects so I don't acutaly know if it's a boolean
instanceof Boolean
I even did reloadConfig
It should make no problem
test it and find out
Ok
System.out.println("Config: " + key + " " + config.get(key));
[06:28:06 INFO]: Config: plugin.world.autoreset true
Now I will try it with instanceof for you
Update on this: for some reason using the globaltranslator ends up with a translation: chat.square_brackets with my current component
{
"italic":false,
"extra":[
{
"color":"white",
"hoverEvent":{
"action":"show_item",
"contents":{
"id":"minecraft:paper",
"tag":"{CustomModelData:1,PublicBukkitValues:{\"sealeaf:key\":\"sealeaf:prop_money\"},display:{Name:\u0027{\"italic\":false,\"extra\":[{\"color\":\"#80ed99\",\"translate\":\"sealeaf.item.money.name\"}],\"text\":\"\"}\u0027}}"
}
},
"translate":"chat.square_brackets",
"with":[
{
"italic":true,
"extra":[
{
"italic":false,
"extra":[
{
"color":"#80ed99",
"text":"Money"
}
],
"text":""
}
],
"text":""
}
]
}
],
"text":""
}
still no idea where its coming from :p
[06:31:23 INFO]: Config: plugin.world.autoreset true
I have not set any default values, I just did saveDefaultConfig and get
then the returned value can't be false.
And still System.out sais it is false
yamlFile.saveDefaultConfig();
yamlFile.reloadConfig();
Configuration config = yamlFile.getConfig();
for(Map.Entry<String, ConfigClass> path : paths.entrySet())
{
String key = path.getKey();
ConfigClass configClass = path.getValue();
if(!config.contains(key))
{
missing = true;
continue;
}
if(configClass.parse(config, key))
{
validatedObjects.put(key, config.get(key));
System.out.println("Config: " + key + " " + config.get(key));
}
else
wrongObjects.add(key);
}
Btw this is for every boolean I try to change
And integer, string, etc
So you are saying its not find any values?
then you are either deleting them or you are using the wrong path
are you pulling MemorySections and parsing them individually?
This is the full class
Look in validate
YamlConfigFile https://paste.md-5.net/ucevizumiy.java -> works without any problem
Why are you making this so complex?
all you are doing is reading from a config
Yes, and checking if the value is actually a boolean if it is also a boolean in the /resources folder
is it better to do this
Bukkit.getLogger().info("Hi");
over
System.out.println("Hi");
90% of this code is not needed
If not, I will replace the config with the default values and set the validated values
How would you write it then?
Generally people use getLogger because its formal. But you can use what ever you prefer
Well ConfigurationSerializable already handles all primitives and registered classes
Yes, but I am making it universal with every config
I am not going to do this with 1 config
It look slike you are just over complicating it all
one sec let me have a play
Ok
How can I make an armor stand helmet's pose North, South, West, and East?
The top armor stand isn't an exact 90 degree angle:
https://imgur.com/a/gpzaxKx
.setDirection is that a method in Entity? Or just set the yaw and pitch
Vectors are also an option
i just saw you responded me tvhee thx a lot
Yeah that should work
Does it work good?
i'm trying it rn
No need to change the head pose if I can just rotate the entire stand I suppose 😂 thanks
Ok because I just made it 1 month ago
😄
Seems it's not doing anything when I change from setHeadPose to setRotation 🤔
armorStand.setRotation(270,0) is doing nothing
👍
@chrome beacon Cannot invoke "java.sql.Connection.createStatement()" because the return value of "com.craftinc747.discord.logReader.access$000(com.craftinc747.discord.logReader)" is null
or anyone... why does this return null... please ping me if you respond. i need to be notified
armorStand.teleport(new Location(teleport.getWorld(),teleport.getX(),teleport.getY(),teleport.getZ(),270,0)); also not working 🤔
You have to set the YAW
Ah ok I see
This is kinda weird
It should work
270 is north, west, east or south?
Not sure, I'd assume yaw has 360 degrees total right?
0 degrees works perfectly for the very first armor stand placed, but I'm trying to place 4 armor stands in each direction
1 in each direction* 4 total
Oh cool! yeah I've been looking into EurAngle stuff for a bit. Don't understand it, and the forums didn't really help answer what I need so I thought I'd try here
I'll try setDirection
move into quaternions
for some reason there's no setDirection method for the object 🤔
you will need to teleport the entity afterwards
They're all spawning as if they're 0 yaw
oh okay I'll try that. Strange
the location returned by getLocation() is not linked to the entity location
more like a copy of the location at the time of the method call
Then use .add and .setLocation
Show code
No it's not a matter of preference. Actually neither of the options provided by @solemn gulch were the better option
System.out.println() provides no source from where the log message came, Bukkit.getLogger() has it come from the server itself which is also untraceable
Use your plugin's logger
JavaPlugin#getLogger()
how do i add a map that has something drawn on it intro costum GUI ?
Traceability isn't always needed. So yes preference.
Nah
Nothing more annoying than a server owner seeing "Hello!" from some unknown source
nah
If you're going to educate people on what to use, at least educate them on the correct way
The conversation made me realize that I need to set the yaw of the Location object before I actually spawn in the entity, instead of after.
Thanks for the help
Don't need to educate people on preferences. Thats up to the user.

I too like my server spitting out random log messages
I prefer
[Time] Message
[Time] Message
Rather then
[Time] [Plugin] Message
especially if the plugins I use are not mine but third party and I have no clue what those messages are
sure that layout is "ok" for you if you run your own server with just your plugins
you probably know all the messages that pop up
Hey short question. I want to change / check some things when TNT is exploding. For Example the explosion radius should be reduced at some points and I am looking an event where I can check for the blocks which are going to be destroyed
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
Oh thank you, was searching for a get... that's why I didn't found the blocklist 😅
How do I add a <player> Option to a tab completer?
if you don't use a command framework, add all the names of the currently online players to the tab completion ?
Method to get all playernames:
public static List<String> getOnlinePlayerNames() {
return Bukkit.getOnlinePlayers().stream().map(player -> player.getName()).collect(Collectors.toList());
}
tabcompleter:
List<String> completions = new ArrayList<>();
...
completions .addAll(getOnlinePlayerNames());
...
return completions;
is that good enough or need any further help?
You can use return null; instead, it will show a list of online players name.
Thanks
@maiden briar When you replace a value are you replacing just the value at that path, or do you replace the map?
I only replace the value
You do know you can just use teh class of the object, no need to define your own?
config.get(path).getClass()
[15:27:24] [Server thread/INFO]: autoreset:class java.lang.Boolean```
my current plugins are like 44,000 KB I assume its due to the API jar being around 44,000. how do i reduce the size
dont shade it
what is shading
maven or gradle?
Then you are on your own
what IDE?
intellij
Set teh dependencies scope to provided https://www.jetbrains.com/help/idea/working-with-module-dependencies.html#dependency-scope
No idea if thats available without maven as I don;t use InteliJ
well i can use Maven if its useful
i just didnt before cause i didnt know what it was
does anyone know if there's a way to listen to block break events from spawning iron golems
what number should be here its not right
for(Guild guild : plugin.getGuilds())
{
for(GuildChunk chunk: guild.getOwnedChunks())
{
if (chunk.getChunk().getX() == player.getLocation().getChunk().getX() && chunk.getChunk().getZ() == player.getLocation().getChunk().getZ())
{
}
}
}
```How can I do that easilier? With stream perhaps?
sure, tho keep in mind using streams in often called code might not be the most speedy idea
if (chunk.getChunk().equals(player.getLocation().getChunk()))
!paste
?paste
thx
@chrome beacon https://paste.md-5.net/efaxadeboz.java
i also get a sql error: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
are you executing SQL connections on every single log message 👀
no i don't want to.... only for the log messages i want to keep
well, your connection instance is null.
the reason the null message looks so weird is because you are using an inner class that captures outer class state (as in your connection field)
maybe you should look into using an SQL connection pool like HikariCP
as opposed to jbdc?
The connection pool still uses it under the hood
but it manages creating connections for you
is it possible to detect X, Y cordinates of a click on the item frame ?
so you can create the pool once (in your onEnable) and then just pass the pool around to allow other instances to use SQL connections
With alot of math 😉
isn't it just a raytrace
seems pretty straight forward
can raytrace detect sub pixel ?
actually the PlayerInteractAtEntityEvent already provides you a vector through getClickedPosition
see if that is accurate enough for you
EntityDeathEvent#getDrops - can i change the set of itemstacks?
mutating the list will mutate the drops if that is what you are asking
yep forgot the word - thanks
how is the connection instance null?
i thought this line returned a connection instance connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/logReader?autoReconnect=true&useSSL=false");
I mean, it is possible if the DriverManager.getConnection call errored
while you print the stack trace, it will continue your code after that
it did
Yea then the connection will simply not be set because the connection = ... call failed
and hence is null
Could not create connection to database server. Attempted reconnect 3 times. Giving up.
ah
lol
gotta solve that first... i think the problem is with my sql url
I think there is also a setDrops method
nope
most likely a paper thing
Nah i was using spigot when I was experimenting with mob drops probably remembered wrong
as lynx said it is just a mutable list
not like there would be much need for such a method if the list itself is just used
quick
.clear
.addAll
does the same ig
ye I mean probably better to have the field to the list final rather than mutating the list field since someone could drop in a list that breaks lsp
If i have 4 Locations which are corners to a square - is the only real way to work out if a location falls inside the "region" is to essentially check all x/z coords? or is there a handy dandy way i can use
🤔 yes you right
also 2 locs would be enough to check if something is contained between the 2 locs
if target.x > loc1.x && target.x > loc.z && target.x < loc2.x && target.z < loc2.z
something like that ig
to work out if it is outside
//set
@EventHandler(priority = EventPriority.MONITOR)
public void Place(BlockPlaceEvent event) {
PlayerPlaced.add(event.getBlockPlaced().getLocation());
this.getConfig().set("blocks." + event.getBlock().getType(), PlayerPlaced);
this.saveConfig();
}
//get
if (check) {
if (e.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
if (e.getBlock().getType().equals(Material.GRASS) || e.getBlock().getType().equals(Material.TALL_GRASS)) {
e.getBlock().breakNaturally();
} else {
e.setCancelled(true);
Material item = e.getBlock().getType();
e.getPlayer().getInventory().addItem(new ItemStack(item, 2));
e.getBlock().setType(Material.AIR);
}
}
if (getConfig().getLocation("blocks").equals(e.getBlock().getType())) {
e.setCancelled(true);
Material item = e.getBlock().getType();
e.getPlayer().getInventory().addItem(new ItemStack(item, 1));
e.getBlock().setType(Material.AIR);
}
}
else {
e.setCancelled(false);
}
``` The blocks aren't changing when I try and get them from the config, when a player places a block, it saves the location of the block to a config and if that block is equal to that area of the config then it only drops 1, everything else will drop 2 of the broken block
oh lol i thought you were gonna say "one that checks if it is outside"
?paste
lmao
guess the inverted logic of this is just that
https://paste.md-5.net/qazozefiji.cs
The blocks aren't changing when I try and get them from the config, when a player places a block, it saves the location of the block to a config and if that block is equal to that area of the config then it only drops 1, everything else will drop 2 of the broken block
mfw
if booleanVariable == True:
python ew
conclure
i think you have to remember
that the reason that i did shit like this
is cause it was the only lang i knew
oh fair
and had terrible teaching
I have to learn python rn lol
it should only be used for web dev
i forget the name
oh lol - the
-> list
shite
dont get me started on the lambdas 
having an issue with InventoryDragEvent where e.setCursor() does not actually change the cursor
tried the same with e.getWhoClicked().setItemOnCursor() and no difference
anyone else had experience with a similar issue?
that would be InventoryClickEvent
ah my bad
but with inventorydragevent its not deprecated
lemme have a look
works perfectly fine for click event but for drag it just doesnt
i have never really used this event
im trying to do things with custom brewing recipes which works mostly fine but its not working consistently because GUIs are so sensitive to making an inventory click event an inventory drag event if you just move your mouse a little bit, and its making my brewing go inconsistent and buggy
so sometimes you have to use both
myesu understand
then we got stuff like
def do(x: Union[type(lambda: None), str])
or smtng
lol
hey can anyone help plx
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!
actually i didnt word my issue properly, sorry about that. cursor setting works (kind of) but with this code it only works when you attempt to insert an item into a brewing stand that isn't supposed to go there. with items that do work for it the cursor is not changed. i cancelled the event just to make sure the custom insertion system is used, and doing so apparently set the event result to DENY. which then apparently makes it so cursors are not changed as a result of the event
i am
e.setResult(Event.Result.ALLOW) after cancelling the event fixed the issue
any idea
wdym like are you confused about the red part
yea
you're using a method that doesn't exist
how can i get the target server to display
concerning that this isn't cancelable,the player might already have the updated server
well it doesnt look like a serverswitchevent knows about the target server
see if https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/connection/ProxiedPlayer.html#getServer-- already returns the new server
what about a ServerConnectEvent
i think you're just using the wrong type of event
because ServerConnectEvent DOES have getTarget()
i guess that makes sense because switching to a new server does not necessarily imply the person connecting makes it to that server
i know but i dont want the message to run when the player joins the hub server on login is there a way to check that they are coming from another server and not loging in
please try if the proxied player's getServer returns the new one 😦
how do i add an element to List ?
myList.add(myElement);
List looks like this:```java
public class button {
public String name;
public int id;
public int x;
public int y;
public int x1;
public int y1;
}
public static List<button> buttons = null;```
why is your list null tho ?
initializes it ?
no lol
LOL
help with removing nearby armor stands
if (args[0].equals("remove")) {
for(Player all : Bukkit.getServer().getOnlinePlayers()){
Entity e = (Entity) all.getNearbyEntities(10, 10, 10);
if (e.getType() == EntityType.ARMOR_STAND) {
e.remove();
p.sendMessage(ChatAPI.color("&b&l(!) &fnearby leaderboards has been deleted."));
p.sendMessage(ChatAPI.color(e.getCustomName() + " removed."));
return true;
}
}
}```
code not works
getNearbyEntities does not return an entity
your IDE should already be screaming at you
it returns a List<Entity>
okay thx
what is the point of a StructureList
public class button {
public String name;
public int id;
public int x;
public int y;
public int x1;
public int y1;
}
what / how does it store
this is called structure isnt it ?
Object
A list can store any type of object
and use UpperCamelCase for class names
So
List<Button> buttons = new ArrayList<>();
is a list of Button Objects
the empty <> is just a Java feature that takes the generics from the type specified List<Button>
so new ArrayList<>() would just be new ArrayList<Button>(), essentially
type inference 😄
My mother always taught me to not Assume 
what if the List doesn't want its type guessed
could always go with
List<E> list = new MomsExplicitList<E>();
ok so how do i add an element to that array ?
what should element be for ```public class button {
public String name;
public int id;
public int x;
public int y;
public int x1;
public int y1;
}
public static List<button> buttons = new ArrayList<>();``` ?
well first of all you need to create an object of the class button
public class button {
public String name;
public int id;
public int x;
public int y;
public int x1;
public int y1;
}
I'd suggest creating a constructor
this should be that obj
thats not an object
thats a class
that being said classes can create objects
I'd strongly suggest learning the difference between the notion of a class and the notion of an object/instance
so that class isn't like struct in C ?
Hello, I'm having trouble finding a way to remove all swords in an inventory until there's only one left, could you help me?```
for (final ItemStack item : inventory.getContents()) {
if (item != null && item.getType().name().contains("SWORD")) {
inventory.remove(item);
System.out.println(item.getType().name());
}
} ```
anyways stargate, seeing u as coming from C I'd still recommend to read on a little about how java works
?learnjava might get you started with that
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.
whats the "not working" part
Well right now the code is removing all swords
I'd do this
boolean hasSword = false;
for (int i = 0; i < inventory.getSize(); i++) {
ItemStack item = inventory.getItem(i);
boolean isNotNull = item != null;
boolean isSword = item.getType().name().contains("SWORD");
if (isNotNull && isSword) {
if(!hasSword) {
hasSword = true;
continue;
}
inventory.setItem(i,null);
}
}
maybe?
I'll try it out, thanks a lot for the help.
👍
The issue im getting now it is telling me the server the player leaves not the one they are joining
can you please check if this code is right ? ```java
public class buttons {
public static int id = 0;
public static int x = 0;
public static int y = 0;
public static int x1 = 0;
public static int y1 = 0;
private static List<buttons> buttonsList = new ArrayList<>();
//constructor
private buttons(int id, int x, int y, int x1, int y1) {
this.id = id;
this.x = x;
this.y = y;
this.x1 = x1;
this.y1 = y1;
}
public static void addButton(int id, int x, int y, int x1, int y1) {
buttonsList.add(new buttons(1, 0, 0, 2, 3));
}
}```
looks alright I guess
thanks
conclure be lying
PascalCase the class name
oh I missed the static
the fact that the "class fields" are static shall be ignored
wth
lol
any idea on how to disable the conected to hub message when joining the server
replace it with an empty message?
@EventHandler
public void severconect(ServerConnectEvent event) {
ProxiedPlayer player = event.getPlayer();
ProxyServer.getInstance().broadcast(ChatColor.LIGHT_PURPLE + player.getDisplayName() + " has joined " + ChatColor.GREEN + event.getTarget().getName());
}
i want it to broadcast when someone joins the hub from another server
can we talk about "severconect"?
but not when they join the server
then you might not wanna use the ServerConnectEvent since that gets called when someone joins the server
well what event do i need cus when i use serverSwichEvent it broadcastes the server they where on and not the server they are going to
yes
never used Bungee
this might be a stupid question but what does static mean in java ?
accessible from anywhere
thanks
is there a way in server conectevent to check if theye are moveing servers
Don't use it
dont use what
It's usable anywhere but the only time you should ever use it is for getting a main instance or a final variable. Static methods/classes are considered a bad programming practice.
so how would one get a Method from a class to work in another class
Objects.
fair
Java is an object oriented language
but I am not
Well then you shouldn't be using java
i feel that wall is geting further than i am
static is not bad
its not used in the correct places sometimes
you can tell me bad practice as much as you want Ill still use it since its convenient
No but static abuse is
yes
i would personally use assert
"The concept of global variables being bad is Java propaganda." -A wise man.
I generally just avoid it whenever possible
HERE IS EXACTLY WHY YOU DO NOT USE ASSERT:
assert only works if a flag is set when running the program.
It's only intended for testing.
Lol
facts
tbh if my IDE asked me for my credit card number I would give it just to get it to remove the warning
"Pay to get rid of nullable warnings"
can i debug the pluigin while it is running (get varaiabble values) ?
Yes?
can any one help me plx
how ?
plz
Don't ask for help, ask your question
They did
where will sysout put the values ?
Oh
Console
server console ?
Yes
@hasty prawnwhat you mean they did
@humble heath It depends on what you're doing, and if you're using BungeeCord or Spigot.
So, whats your goal
bungee
and i have it announce when a player joins a server but i dont want it to announce saying they have joined the hub when they join the server
Then just don't broadcast when they join the Hub
but i want it to if they go to the hub say from towny
If you join Towny right now does it say "ArcaneLegend has joined Towny"
yes
Yeah, so if the server is the Hub server, don't broadcast, otherwise, broadcast.
i dont get how to check if they are joining the server or moveing from another server
assert even can affect your performance in come cases even when the jvm flag is disabled.
I only use it sometimes to make my IDE shut up if i know that a certain value wont be null and
it still tells me to null check for it.
I just suppress warnings
the issue with supressing warnings is that it would often supress the warnings in a far to large scope
you can do statement-level suppression in IDEs :p
how can i get my plugin to draw stuff on an empty map ?
You need to implement your own MapRenderer and apply it to a Map. Usually in the MapInitEvent
- that map is in an item frame
You can take a look here
https://www.spigotmc.org/threads/tutorial-maps.136533/
how would i communicate from discord to minecraft and vise versa, more specifically if i type a command in minecraft how would i make it so my bot sends a message to a channel containing information about the message
That's actually not true
Assertions are super useful as means to ensure that code is working the way it should be working. For instance,
ItemStack item = new ItemStack(Material.STONE);
ItemMeta meta = item.getItemMeta();
assert meta != null;
meta.setDisplayName("Hello");
item.setItemMeta(meta);```
Perfectly valid and appropriate use of assert because that should never return null for anything that isn't air
If it does, it's the fault of the implementation. Which is what assert is for. It's to denote developer fault
Also known as "fail fast principle"

Generally speaking you should be using assert on conditions that you know for certain should be true. If it's false, you know that either you or the implementation you're using fucked up
Delays in spigot should be done with the scheduler.
If you block with a while loop your server just crashes because your code is ran consecutively on
the main thread.
Me just using Objects::requireNonNull 
?scheduling

I hate the use of requireNonNull for a few reason. (1) If you're in Bukkit context, you have Preconditions which are objectively better and more flexible. (2) It throws an NPE anyways instead of an IllegalArgumentException
is an example
and how do i draw on an existing map ?
Guavas Precondions class is quite helpful for that. I think Apache has something similar. Assertions or smth
^
I just do it on instinct when I see nullable problems or smtng
Well that's mostly where I use assert for getItemMeta() calls. It's included in null access
If you assert it's not null, your IDE won't kill you for trying to use it lol
yeah I do it for getAttribute(GENERIC_MAX_HEALTH) when called on a player also
yup lol
Another great place to use it, yeah
please can someone tell me the placeholder api got a players name?
how can i draw on a map that is in an item frame ?
.
Would anyone happen to know why if I call LivingEntity#damage(), in EntityDamageEvent the event.getDamage() is significantly lower?
I assumed maybe damage() was pre-calculating armor/resistances, but it doesn't seem to be doing that either.
plae holder for a players name?
You should look at java wrappers for the discord API like JDA
what
Yes they have a placeholder for player names
%player_displayname%
https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/Placeholders#player
There has to be another listener that reduces the damage beforehand.
Maybe, lemme see if I can find it.
thanks for the help , i think i got it now
how do i stop players from rotating things in item frames ?
Try PlayerInteractAtEntityEvent
Entities i am spawning in are being despawned when the player moves too far from them. I have tried the .setPersistent and also adding chunk loading tickets before i spawn them and then removing after i spawn them but it doesn't work - the zombies always despawn. Any ideas ?
Try PlayerInteractEntityEvent
Narrowed it down to damage(double) vs damage(double, Entity)
The former deals the correct amount, the latter deals the reduced. There's no other plugins on the server, so nothing should be intercepting it.
Doesn't actually seem to matter what that entity is either, the reduced is the same no matter what. 
Weird. What version?
1.17.1
Let me check that...
For me it works as intended...
nvm i forgot about setRemoveWhenFarAway
Did you check for potion effects or attribute mods?
Really? Lemme update spigot and see if that does anything.
Wouldn't those apply to the regular damage too though?
I mean for the attacking entity.
Oh, right now I'm just grabbing a random entity from the world.
I got a Bee, a Creeper and an Enderman 
They all did the same damage
...
lol
...
is grabbing an entity not more lines 
They're both technically 1 line I guess
Still 
Yeah same thing even after updating to latest
@lost matrix Found it, it's because the DamageSource is set to EntityDamageSource (as opposed to Generic), which scales with Difficulty. It was on Easy so it was reduced because of that. 
hey, i'm making a kill system (top kills) using a database. A table named kills contains player username and their kills. Is there a way to sort kills (integers) from highest to lowest and get the player name with it ?
i tried searching on the internet how to sort by ASC or DESC, but did not find how to bind a table value to highest
i hope its understandable
so ive created the worlds, an overworld dimensionm, a nether dimension, and end dimension using WorldCreator. How would I go about making sure when a player enters a portal in the new overworld world ive created, that it links and takes them to the new nether world/end world ive created
so if a players enters a portal in a certain world, it teleports him to another world
use PlayerPortalEvent
yeah thats what i was thinking as well
You don't sort the table itself
was juts wondering if there was an easier way
and get the actual world name, and if one player enters a portal, and world name is X, teleport the plyer to world Y
Create an index on the table in the kills column
And then you can just do SELECT name, kills FROM users ORDER BY kills DESC LIMIT 10 or something
i'll try it. thanks a lot for helping
Why is Config#getFloat() not at thing?
i guess because double and float are similar enough its not considered necessary?
@waxen plinth
sorry for ping
thought you would kno
and you were active a sec ago
you're not entitled to answers
people ask questions and when people feel like it they answer
put a sysout immediately so that you know if it gets called
You can always just call getDouble and cast to float
I'm not 100% sure
But I know that I almost always use doubles over floats
yeah but what i want to know is why getFloatList is a thing
Maybe use my config manager
I actually ran into a similar issue recently
Someone got an error because they were storing a float in config and it was always loaded as a double
The fix was pretty simple but it's an interesting issue
I wonder how it makes the distinction between an int and a long, it's a similar ordeal
is there a way i can check if a list contains a value that isn't case sensitive? or is .contains() already not case sensitive?
