#development
1 messages · Page 134 of 1
fixed it

Hello, im not sure is this right channel for ask one question. With plugin DeluxeMenu, i want this plugin connect with residence plug. And here is one problem. Res plugin have command where you need to write username. For exapme / res padd (name). Is it posible, to make what user press on button, and console asked him to write user name to chat. After you write a nickmame command made success. Is it posible, or need some extra plugin for that?
Hey, im trying to use plugin messaging to send a player to a server, and nothings happening. I have done this once before in another plugin, and just copied the code over. theres no errors, just nothing happens. I have registered it in my onEnable with this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");, and am using the below code to send them:
System.out.println(player.getName() + " : " + server);
try {
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
out.writeUTF("Connect");
out.writeUTF(server);
player.sendPluginMessage(ManhuntMinigamePlugin.getInstance(), "BungeeCord", b.toByteArray());
b.close();
out.close();
}
catch (Exception e) {
e.printStackTrace();
player.sendMessage(ChatColor.RED+"Error when trying to connect to "+server);
}
}```
thanks
Idk how to go about debugging this, I have verified the input player and server is correct, but there’s no errors printed in the console or the proxy console
Max BurnTime before animation burn animation breaks in furnaces?
98100 in 1.18, any place to find it for older versions?
is there a more readable way of writing val arrayType = object : TypeToken<ArrayList<T>>() {}.type
i tried val arrayType = TypeToken.getParameterized(ArrayList.class, T).type but it says "name expected" on , and "expecting an element on )
val arrayType = TypeToken.getParameterized(ArrayList::class.java, this.getValue()::class.java)
gross
idk if that even works
Kotlin moment
Well, you create an anonymous class, thats why it looks a bit weird
Same shit lol, but worse
anything neater? 😭
is bungee enabled in spigot.yml
I feel like something like this wouldn’t change much from version to version
seems that something is breaking about burn time when it's 40000
burn animation breaks, but it's still cooking items
yes
how do i make the citizens npc have my skin?
does anyone know why this is dropping like 3-4 stacks of nether stars
@EventHandler
public void mobDeath(EntityDeathEvent event) {
for (World Decepticon getWorlds()) {
for (Entity e : Decepticon.getEntities()) {
e = event.getEntity();
if (e instanceof Silverfish) {
e.getLocation().getWorld().dropItem(e.getLocation(), new ItemStack(Material.NETHER_STAR));
}
}
}
}
}```
well you are looping through all the entities in that world that are a Silverfish, not simply setting the drop to a silver fish.
Can you provide when it should drop a nether star? @lapis pilot.
Like is it only in specific world(s), etc.
always, 1 nether star
testing this
@EventHandler
public void mobDeath(EntityDeathEvent event) {
Entity entity = event.getEntity();
if (entity instanceof Silverfish) {
event.getDrops().add(new ItemStack (Material.NETHER_STAR));
}
}
}
This should work fine
Alright, and the code you provided should work fine, and hopefully I provided a explanation that you could understand regarding why it was dropping a large amount.
yes ty
Dunno if you figured this out but you're gonna need Denizen for that
Then there was a command like /npc mirrorskin or something that you had to run
That is of course if you want it to be different for each player, which is what I'm guessing
any1 knows how to make a player Invulnerable in 1.8.9
i used to do isinvulnerable
but apparently it aint a thing in older versions of spigot
why are you on older versions of spigot
cuz i wanna make a plugin for 1.8.9...
that's not the greatest idea, but you could try giving them a high resistance level
yea
i dont think that's gonna be effective
pretty sure after a certain point resistance makes you unkillable
you could also potentially cancel the damage event
o
thats a big brain moment
i'll just cancel the damage event
looks better to me
yeah, that's probably a good way to do it lol
np
Cancelling the damage event from a player is better then giving a player a high potion effect ;d
yep that's what I said a few seconds later haha
I saw it 👍🏻👍🏻
Server or client-sided?
I guess server sided, so that everyone sees the same skin of that npc
Dm ^
Just doing /npc skin <username> should work I think
Oh wait unless he wants to do it through the API or something
I think that he wants to do it with his plugin yea haha
what does
myMap[myKey]?.invoke(null) ?: return false
```do
.invoke(null) never seen this before
public Object invoke(Object obj, Object... args)
throws IllegalArgumentException, InvocationTargetException, NullPointerException, ExceptionInInitializerError, IllegalAccessException```
Invokes the underlying method represented by this Method object, on the specified object with the specified parameters. Individual parameters are automatically unwrapped to match primitive formal parameters, and both primitive and reference parameters are subject to method invocation conversions as necessary.
If the underlying method is static, then the specified obj argument is ignored. It may be null.
If the number of formal parameters required by the underlying method is 0, the supplied args array may be of length 0 or null.
If the underlying method is an instance method, it is invoked using dynamic method lookup as documented in The Java Language Specification, section 15.12.4.4; in particular, overriding based on the runtime type of the target object may occur.
If the underlying method is static, the class that declared the method is...
This description has been shortened as it was too long.
obj - the object the underlying method is invoked from
args - the arguments used for the method call
IllegalArgumentException - if the method is an instance method and the specified object argument is not an instance of the class or interface declaring the underlying method (or of a subclass or implementor thereof); if the number of actual and formal parameters differ; if an unwrapping conversion for primitive arguments fails; or if, after possible unwrapping, a parameter value cannot be converted to the corresponding formal parameter type by a method invocation conversion.
InvocationTargetException - if the underlying method throws an exception.
NullPointerException - if the specified object is null and the method is an instance method.
ExceptionInInitializerError - if the initialization provoked by this method fails.
IllegalAccessException - if this Method object is enforcing Java language access control and the underlying method is inaccessible.
the result of dispatching the method represented by this object on obj with parameters args
the first parameter is the object instance, and the varargs are the parameters of the method itself
@wheat carbon can we possible add some ` around parameters / exceptions? https://github.com/PiggyPiglet/DocDex/blob/393efbf8ad85c4bd34834c9cbe85942daa8f30b7/discord/src/main/java/me/piggypiglet/docdex/bot/embed/documentation/SimpleObjectSerializer.java#L89
IllegalArgumentException- if the method is an instance method and the specified object argument is not an instance of the class or interface declaring the underlying method (or of a subclass or implementor thereof); if the number of actual and formal parameters differ; if an unwrapping conversion for primitive arguments fails; or if, after possible unwrapping, a parameter value cannot be converted to the corresponding formal parameter type by a method invocation conversion.
InvocationTargetException- if the underlying method throws an exception.
Hey so I'm just curious if this would work? I'm trying to figure out mapping and flat mapping thru streams, but I'm not home right now and had a theory, and was wondering if you guys knew if this would work or not.
List<String> onlinePlayerNames = Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList());```
Does map return a new stream of the desired result?
Or do I still not understand what map does
a Stream doesn't really contain a result, it contains a description of how to transform the input
and the last step (terminal operation) does not return a stream but actually does the processing
Right so does the map part of the stream tell the stream to transform the result to a new type of object?
yes
Ah so then getting a list of all online player names would be done using exactly that
Rather than creating a list and manually populating it with something like a forEach or an enhanced for loop
That's what I'm avoiding here anyways
Extra boilerplate
well there are multiple ways of doing things, each with their pros and cons
Yes, in some cases it's better to use enhanced for instead of forearm
ForEach
Like when trying to assign variables within a loop that aren't effectively final
😜
I still have yet to find a reason to use while
Even when using an iterator my ide suggests just using an enhanced for
while (resultSet.next())
while (matcher.find())
while (iterator.hasNext())
I get that
But my ide almost always suggests that using an enhanced for is better
¯\_(ツ)_/¯
wait until you find use for do while
I do appreciate do while though
I don't think I ever used do while 🤣
Funny
do while is very useful in occasions where you'd want to apply something like an effect and then while the duration of a boolean is active keep updating that effect
That's the only time I've used it though
wont that have the same effect as a simple while?
Not unless you want it to trigger ONLY if the boolean is true
do while simply execute the code before checking the condition
In this case I want it to apply the effect
I used both in several situations, but that's rather super specific use cases
Then keep applying the effect if the boolean is active
like most looks can be covered with for
yup
oky
Anyone knows what this error is and how to fix it exactly? I'm new to using switch
https://i.imgur.com/qHt0qPP.png
sadly, you have to write it as multiple cases one under eachother, and the last one will have the return ..
case 0:
case 1:
// 2 3 4 5 6 7 8
case 9: return "&f" + profile.getLevel();```
uh
0 - 9 is the same as 10 - 19
which is the same as 20 - 29
that is what that's "complaining" about
16 I think?
how is that the same tf?
it's a math expression
0 - 9 is -9
10 - 19 is -9
oh
^ that - doesn't act like a range
so it calculates
I see
yeah
how to make a range like u said Gaby?
case 1, 2, 3...?
if you use java 16 you can do that, otherwise, this
an if is probably clearer
if I divide by 10 then levels from 0-9 won't be counted
?
Profile profile = ProfileManager.getProfile(player);
switch (level/10){
case 1: return "&f" + profile.getLevel();
case 2: return "&e" + profile.getLevel();
case 3: return "&a" + profile.getLevel();
case 4: return "&2" + profile.getLevel();
case 5: return "&3" + profile.getLevel();
case 6: return "&d" + profile.getLevel();
case 7: return "&b" + profile.getLevel();
case 8: return "&6" + profile.getLevel();
case 9: return "&9" + profile.getLevel();
case 10: return "&c" + profile.getLevel();
case 11: return "&4" + profile.getLevel();
case 12: return "&4&l" + profile.getLevel();```
where is case 0?
java.lang.NoSuchFieldError: SNOWBALL
at me.streakymask.Items.switcherballitem.createswitcherballitem(switcherballitem.java:16) ~[?:?]
at me.streakymask.Items.ItemHandler.init(ItemHandler.java:9) ~[?:?]
at me.streakymask.main.onEnable(main.java:24) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_331]
The line is ItemStack item = new ItemStack(Material.SNOW_BALL, 1);
But if i do it with EGG its fine and it works perfectly... what's the problem?
i just started learning so forgive me
Error says SNOWBALL you posted Material.SNOW_BALL so wrong line or you didn't send the code you have.
Sorry i sent it wrong i just tried with snow_ball
sorry i actually wrote SNOWBALL i just sent it wrong
if i write SNOW_BALL i get the error: Cannot resolve symbol 'SNOW_BALL'
Show updated code and point out line number. (.txt please)
public static final Material SNOW_BALL```
Yeah his depend is 1.18 but his server is 1.8 so I told him use Material.getMaterial
d;spigot Material#getMaterial
@Nullable
public static Material getMaterial(@NotNull String name)```
Attempts to get the Material with the given name.
This is a normal lookup, names must be the precise name they are given in the enum.
name - Name of the material to get
Material if found, or null
getMaterial only strips stuff like spaces I believe, and turn the string uppercase
@Nullable
public static Material getMaterial(@NotNull String name, boolean legacyName) {
if (legacyName) {
if (!name.startsWith(LEGACY_PREFIX)) {
name = LEGACY_PREFIX + name;
}
Material match = BY_NAME.get(name);
return Bukkit.getUnsafe().fromLegacy(match);
}
return BY_NAME.get(name);
}```
this is literally all it does
basically a replacement for Enum#valueOf
sigh
His issue is his plugin is compiled against spigot 1.18 so the Material enum doesn't have SNOW_BALL which he needs so he has to use Material.getMaterial("SNOW_BALL")

I spawn a custom projectile with a particle trail and I want to remove the particle trail once the projectile is picked up (it's an arrow). However, the particle stays even though I've picked up the arrow projectile. I can't figure out why. Here is my code, projectile class: https://paste.helpch.at/obemequmuf.java and particle spawner: https://paste.helpch.at/opahuvovot.cs. Sorry if I explained it poorly, don't know how to do it better : |
https://paste.md-5.net/visucubima.java this works™️ but im wanting to improve it since its shite
Hey Guys! Does anyone have experiences with ProtocolLib? I am trying to spawn packet-based ItemStack entity and I cannot find any way to do that... 😦
(ping me if you reply)
You want to spawn an armor stand holding the item I guess https://wiki.vg/Protocol#Spawn_Entity
it wouldnt actually help. I need to make the item visible to only one player
or I can just try to spawn an ItemStack and cancel the EntitySpawn Packet to other players
you are sending the packet to a certain player
yup ik, but how do I set the ItemStack info, etc...
I guess you have to send another packet afterwards https://wiki.vg/Protocol#Entity_Equipment
I'm getting this error. Any help? java Error: Could not find or load main class Caused by: java.lang.ClassNotFoundException:
This is the entire error nothing else.
because I believe you can not do that
I somehow need to convert that into ProtocolLib
Location loc = middle.clone().add(0,0.015*80+0.3,0);
OverridenEntityItem entityItem1 = new OverridenEntityItem(((CraftWorld) middle.getWorld()).getHandle(),loc.getX(),loc.getY(),loc.getZ());
entityItem1.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
entityItem1.setItemStack(CraftItemStack.asNMSCopy(new ItemStack(Material.DIAMOND)));
entityItem1.setCustomName(CraftChatMessage.fromStringOrNull("§bDiamond"));
entityItem1.setCustomNameVisible(true);
CraftItem craftItem1 = (CraftItem) entityItem1.getBukkitEntity();
craftItem1.setVelocity(new Vector(0,-0.1,0));
craftItem1.setGlowing(true);
sendPkt(new PacketPlayOutSpawnEntity(entityItem1));
sendPkt(new PacketPlayOutEntityMetadata(entityItem1.getId(), entityItem1.getDataWatcher(), true));
sendPkt(new PacketPlayOutEntityVelocity(craftItem1.getHandle()));
but you can try
yeah, this is where my plib knowledge ends 🤣 soz
I mean surely you can
how does the game do it if not lol
I Mean armor stands make it easier to animate. that's probably why
I dont need to animate it tho
Player target = Bukkit.getPlayer(args[0]);
if bukkit can't find a player by the argument, it is null
So... What's the problem?
I'm confused, I think someone deleted a message
yep
I want to get into developing Bedrock servers, and I'm unsure where to start. For Java, there is Paper and its forks, but I can't seem to find any examples of software like Nukkit or Cloudburst being used in the professional scene. I am looking to create effects that servers like CubeCraft, MineVille, The Hive (featured servers), etc have and I am looking for a robust and fast server software that allows me to pull this off.
mineplex uses java servers with their own protocol translation
How are they able to pull off Bedrock-specific features like giant NPCs and native GUIs?
When I join on Bedrock, it is a different server than MC Java. Different layout, different everything.
form guis are a part of bedrock but other than that (giant npcs etc.), texturepacks i guess
just like java
Form GUIs aren't supported on any existing Spigot fork
you may not noticed but you install the server's texturepack everytime you join the server
I understand that
But on Bedrock it's way more powerful
Can you go into detail? All the information I've been able to get in months is just that- foggy and no actual information.
yes because Java Edition client does not have Form GUIs but Bedrock Client does
So then why are there different servers for Bedrock and Java if they operate the same theoretically?
From the backend POV
They have different protocols
very different yeah
So why do they implement it with a Minecraft Java server if they can just write a Bedrock protocol server without a middle man?
Let's forget about Mineplex because it seems like that's the exception rather than the rule. What about other Bedrock featured servers?
same, texturepacks or whatever its called in bedrock
I don't see why any developer would intentionally add another layer to their software by using a server software that is meant for an entirely different game.
Are you 100% sure that all of the featured servers above use this method or are you just speculating?
I'm looking for a concrete answer
lot of the mechanics of the serverside are better in java and less glitchy
the bedrock server has a shit ton of bugs, I'm sure you've seen reddit videos of people like randomly dying from fall damage and stuff
so I presume it's better to run the mechanics, which are intended to be basically identical, on java, then just swap a few packets out at the proxy layer
Plus, they can make use of Java plugins and their Java developers much easier
So why are there pieces of software being developed in Go (DragonFly, etc) and Java (Nukkit, Cloudburst) if nobody is professionally using them?
I mean I'm sure there are a few smaller servers using them
But yeah they don't have the vast ecosystem behind them that spigot does, and I also am not aware of any bstats stuff for bedrock so we don't really have a way to track
So you think that, for example, custom items (custom texture, custom item names & namespace) are handled at the proxy level between the client and proxy, and not really between the proxy and backend?
if you look at the wiki.vg, there's more than three pieces of software being developed to replace the Notchain server on Java lol
nukkit is still stuck using 1.16 features
nah, custom items are just resource pack stuff
same as Java pretty sure
it doesnt support 1.17 and above features
Cloudburst is their new software
I think the only notable difference is form guis
tbh the form guis look quite ugly
How do you suppose this is pulled off? Just packets?
yeah
I mean yeah presumably
Chest GUIs look much worse with glass panes
Yea, they are too big and spaced out
You gotta scroll for an hour to get anything
they really dont
I dunno I quite like the look of glass pane guis
In bedrock
Yea I do to
and especially if you get deep into resource pack stuff, you can basically retexture the entire chest GUI to look different
thats cause bedrock supports 3 and 6 row inventories
they dont suport 1,2,4,5 row chest inventories
which is dumb tbh
Yea, idk why they are relive features like that from bedrock, like when they added chest gui why don’t they just add it the same way in Java
in bedrock, glass is not flat
I want to like bedrock since it’s so much faster but they are making it hard
microtransactions, bugs galore, and no modding ecosystem is what stops me
but this.
Java just has years of backing, solid modding support, and okay performance if you can instance properly
Here's what I'm talking about- no packet translation or retexturing
Yea
oh lol that's awkward
I wonder what antvenom has to say about bedrock. he made a video recently complaining about the people that reposted the aether mod or rather a copy for a price.
yeah but that's why you use resource packs like in java. instead of glass pane
oh man the aether is such a throwback
i remember being like 12 years old and wanting to do it so bad, I built a portal and obviously it didn't work lmao
So, do you suggest I develop a fully Minecraft Java network, and use something like Geyser to proxy?
yeah but some people copied that mod and a few others and made into a survival map. it wasn't even a dimenstion it was a pregenerated map lmao
It actually looks a lot worse if you're on mobile or something. The GUIs open on the side of your screen horizontally and its just terrible
I would do fully Java honestly
and he mentioned he has a whole video to complain about bedrock edition incoming
bedrock players are a whole different breed
but they pay Star
and just supporting all that shit makes any new feature kinda weird
thats ugly af
that's the whole point of bedrock
^ and there are tons of them
money generation
Do you have any useful/informative articles or videos on how to develop texture packs for Bedrock that don't interfere with Java players?
but I suppose we are also a serious roleplay 18+ kinda vibe
imagine having a successful minecraft server tho
a better idea is to not have anything in the inventory instead of having panes on bedrock
^
In what way is bedrock "faster" than Java? When ever I play it, it's slow af the movement is weird. When you alt tab it kicks you from servers its all around a shitty version lol
I mean its more lightweight than java edition that's for sure
yes. from what I've heard redstone is also a pain
you can place repeaters underwater tho
oh and snow layers are affected by gravity (?????), they don't pop off when you break the block underneath
those are the two things I remember about it from when I played it
I just love microsoft's blog post for differences between bedrock and java edition :))) https://i.imgur.com/Zezibrr.png
Lets not forget that HiveMC went to bedrock and closed the java servers xd
According to them it was a lot cheaper to run the servers in bedrock and they had more customization
Like the builtin menus you can do etc
You can make custom guis in Java to. (Ever since they added resources packs)
Actually for longer then bedrock.
is not the same thing =/
true
IDK people have gotten really creative lately.
True
... Bedrock forces the resource pack upon joining.
All featured servers still use packs tho
But they only have to load once a change has been made
if there's a universal injector that can let client and server more fancy...
I think bedrock doesn't even let you join if you have resource packs disabled, where as java gives a prompt.
yeah. lately you can force them to accept. but you still get the prompt
Yeah bedrock doesn't give a prompt it just starts downloading.

Quite a noob here, i'm trying to create my first plugin just saying hello world in chat when running a cmd. it gives me no error on load, i can use the commands only that nothing then happens, what would be the best way to send you my code?
?paste
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
idk if that also is important:
[16:54:45] [Server thread/WARN]: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
[16:54:48] [Server thread/WARN]: Legacy plugin HelloWorld v1.0 does not specify an api-version.
[16:54:48] [Server thread/INFO]: [HelloWorld] Loading HelloWorld v1.0
trying all with java 11 installed if that matters
is that the error or what is it?
so i tryed playing around a bit more, idk what i did, now it doesn't want to really load anymore, but instead says: Could not load 'plugins\HelloWorld.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.irongaming.helloworld.Main;'
Can you share your plugin.yml
name: HelloWorld
version: '1.0'
author: Irongaming
main: me.irongaming.helloworld.Main;
commands:
helloworld:
description: Says "Hello World"
aliases: [hw,hellow]
permissions:
helloworld.command:
description: Unlocks "Hello World"
default: op
main would be:
package me.irongaming.helloworld;
import org.bukkit.plugin.java.JavaPlugin;
import me.irongaming.helloworld.command.HelloWorldCommand;
public class Main extends JavaPlugin {
//@Override
public void onenable() {
new HelloWorldCommand(this);
}
}
remove the semicolon at the end of the main: me.irongaming...
that was what i had before, there nothing then happened on cmdr execution
and now it's not working altogether lol
the main entry in the plugin.yml does not take a semicolon at the end
it's just the package name + main class name
following a tutorial and the guy has it there and it is still working for him
well don't lol. try and remove it
it definitely does not contain it
alright plugin loaded now, but nothing comes if i write /hw
it accepts the command but does nothing
I'm op on the server so that shouldn't be the issue
do aliases automatically register if you put them in plugin.yml?
i tryed full cmd also doesn't work
idk how that works lol. that's the problem when you use matt's lib. you don't have to deal with all this stuff :))
nothing happened here
nvm
a
.
having a bit more of a look at the tutorial, eclipse auto correct seems to have changed my @override in the main to a comment, but if i remove the // it says The method onenable() of type Main must override or implement a supertype method
capitalization matters, it's onEnable
and yeah that should be the issue looking at it closely
Can someone help me out with this?
https://imgur.com/a/rIsDxYN
forEach(line -> code here);
how do i call in my own method?
is it just private Object method;
like i have this countdown method
and i want when the countdown to end to call this method i have to assign spawn points
Method or variable?
Or are you talking about reflection method? If so it should be Method not Object
@craggy zealot
wrong copy and paste my bad
I meant to say can you elaborate
Send code please.
did you ever get to fix this issue? i still got it
how do i change the java version in my pom
<java.version>8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>```
i need java 16 becuase when i try to add it to jitpack
it says this
class file has wrong version 61.0, should be 52.0
it says that when my java version is 8 and not 16
can anyone help on what i should do
<java.version>8</java.version>
=>
<java.version>16</java.version>
oh
try going to your project structure, going to the specific maven module and changing the language level there/making sure you have java 16 downloaded
it says there is no java 16
do you have a jdk 16 downloaded?
yes
thats what i use
for the project structure
i do this right
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>```
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Build tool exit code: 0```
see
idk what to do
gradle
🤣
down bad for repeatable builds and a build tool made in the modern era? lmao
big words dont know what they mean
then suffer
gradle is fucking easier lmao
and more complete
so if it's using hikaricp you need to close statement,resultset if there is one and the connection yoU're using, if not using hikari just close statement and resultset
How could i close a statement?
i got this rn
if(!(playerExists(p.getUniqueId().toString()))) {
try {
PreparedStatement ps = hikari.getConnection().prepareStatement("INSERT INTO bounties (UUID,BOUNTY) VALUES (?,?)");
ps.setString(1, p.getUniqueId().toString());
ps.setInt(2, amount);
ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}else{
try {
PreparedStatement ps = hikari.getConnection().prepareStatement("UPDATE bounties SET BOUNTY=? WHERE UUID=?");
ps.setInt(1, amount + getBounty(p.getUniqueId().toString()));
ps.setString(2, p.getUniqueId().toString());
ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
}```
PreparedStatement#close()
so just ps.close() ?
wait
Connection connection = ps.getConnection();
ps.close()
connection.close()
add this at the end of your 2 statement
so i just add that after the 2 statements?
for both
public void addBounty(Player p, int amount) {
if(!(playerExists(p.getUniqueId().toString()))) {
try {
PreparedStatement ps = hikari.getConnection().prepareStatement("INSERT INTO bounties (UUID,BOUNTY) VALUES (?,?)");
ps.setString(1, p.getUniqueId().toString());
ps.setInt(2, amount);
ps.executeUpdate();
Connection connection = ps.getConnection();
ps.close()
connection.close()
} catch (SQLException e) {
e.printStackTrace();
}
}else{
try {
PreparedStatement ps = hikari.getConnection().prepareStatement("UPDATE bounties SET BOUNTY=? WHERE UUID=?");
ps.setInt(1, amount + getBounty(p.getUniqueId().toString()));
ps.setString(2, p.getUniqueId().toString());
ps.executeUpdate();
Connection connection = ps.getConnection();
ps.close()
connection.close()
} catch (SQLException e) {
e.printStackTrace();
}
}
}```
can someone help me out whats the problem 🤔
https://pastebin.com/b5QsMjzA
how should i fix it
Do you also maybe know why after exactly 10 times (using this code) this code stops working and gives a HikariPool timeout?
try {
PreparedStatement ps = hikari.getConnection().prepareStatement("SELECT BOUNTY FROM bounties WHERE UUID=?");
ps.setString(1, playerUUID);
ResultSet rs = ps.executeQuery();
return rs.getInt("BOUNTY");
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}```
https://paste.helpch.at/ojewuqerih.cs is how the console looks like
Connection is not available, request timed out after 30001ms.
that wouldn't close the statement/connection on error correctly. That's why try-with-resources exists
Lol it would
Actually it's for the error not to happen
the error is caused because the pool limit is full
the reason it's full it's because you don't close connection so they just stay inactive but existing
if an error occurs before you call the close methods, the close methods won't be called
that's the issue
and there are several reasons why errors could occur
Ok ? but that's not the problem Razer encounter
You need to do same as I showed you
well your solution is insufficient
public int getBounty(String playerUUID) {
try {
PreparedStatement ps = hikari.getConnection().prepareStatement("SELECT BOUNTY FROM bounties WHERE UUID=?");
ps.setString(1, playerUUID);
ResultSet rs = ps.executeQuery();
int bounty = rs.getInt("BOUNTY");
Connection connection = ps.getConnection();
rs.close
ps.close()
connection.close()
return bounty;
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}```
then propose yours, at least mine is functional
already said, try-with-resources
I mean there shouldn't be any mysql error in production so mine would still work.
but yes using a finally stat is better
public int getBounty(String playerUUID) {
try (Connection connection = hikari.getConnection();
PreparedStatement ps = connection.prepareStatement("SELECT BOUNTY FROM bounties WHERE UUID=?")) {
ps.setString(1, playerUUID);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
int bounty = rs.getInt("BOUNTY");
return bounty;
}
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}
something like that, ResultSet doesn't need to be closed according to the documentation
I don't think resultset close it self but if you tell so
d; ResultSet
public interface ResultSet
extends Wrapper, AutoCloseable```
ResultSet has 10 fields, 94 methods, 2 extensions, 2 super interfaces, and 7 sub interfaces.
A table of data representing a database result set, which is usually generated by executing a statement that queries the database.
A ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. The next method moves the cursor to the next row, and because it returns false when there are no more rows in the ResultSet object, it can be used in a while loop to iterate through the result set.
A default ResultSet object is not updatable and has a cursor that moves forward only. Thus, you can iterate through it only once and only from the first row to the last row. It is possible to produce ResultSet objects that are scrollable and/or updatable. The following code fragment, in which con is a valid Connection object, illustrates how to make a result set that is scrollable and insensitive to updates by others, and that is updatable. See ResultSet fields...
This description has been shortened as it was too long.
1.1
it's closed when the statement is closed, that part is cut off here sadly
idk what i did wrong but after changing some things this code stopped working:
hikari = new HikariDataSource(); <---- THIS IS THE LINE THE ERROR REFERS TO
hikari.setDriverClassName("org.sqlite.JDBC");
hikari.setJdbcUrl("jdbc:sqlite:plugins/" + MTBounties.getInstance().getDataFolder().getName() + "/data.db");
}```
error: https://paste.helpch.at/mijosamaku.css
anyone that knows a possible solution?
you changed something about your setup
you should shade and relocate hikari I guess
do i need to shade for hikari?
interesting
What did you want to tell with that?
absolutely demolished
Main.java*
how could i shade in maven?
i have only done it with gradle shadowjar before
why are you using maven is the question
especially if you know what gradle is and how to use it
But anyway, look into the maven-shade-plugin
because i have been trying to use hikaricp voor weeks and i couldnt get it right so i was going to try maven
i was doing exacly what my friend was doing but it wasnt working for me, but he was on maven
so i was gonna try it
i dont like maven
but i had to try
What was the issue with gradle?
database locked, hikaripool warns after 10 times etc
same on maven tho
i am just to lazy to turn it back to gradle
gradlew init
what is that?
that sounds like a config issue rather than an issue with the build tool
this is the right import right? implementation 'com.zaxxer:HikariCP:5.0.1'
seems like its not
Looks like you need java 11 for 5.0.1
do you know the version for java 8?
4.0.3
ty
console is still crying about something https://paste.helpch.at/cabenivuyi.cs
clean build
but if i use clean build it isnt shaded
clean package or whatevee
what do i have to see with the clean package?
The 'clean' command will create a fresh jar
i just get this
Do clean + your build command

still same error
Didn't know you were British
:kek:
compiled it's Main.class
shush alex you literally use gradle

legend has it he went quiet
Mf 🤣
wys my g
Any ideas why this might be happening: https://paste.helpch.at/xukeqiyube.php
Part of the code it's happening (specifically line 5 in this case): https://paste.helpch.at/koduxegoko.cs
json.getFileData().insert("gens." + loc, serialManager.toString(cache.getGenerators().get(location)));
most likely this is the problem
if you need the key and the value, then iterate over entrySet()
wait wdym
oh ok
nvm
ty
anyone know what i need to do for this my scorebord team isnt updating right its setting the same name as i gave it
for lets say the game time how do i give it a new updated version of the name?
without hard coding it
in
im so confused to how to do this
@craggy zealot Send your actual code
Any idea how to disable residence creation on region spawn/any region?
May I ask why the Maven does not work or where I can find it currently?
You're going to have to be a bit more specific than that, what is "it"?
change http to https, as the error says
ok, thanks
Hello, I have a question. I'm making a JFrame and drawing my items as usual, but when I launch it, it doesn't show any items, but when I minimize it and then pull it up again, it shows every item. I've done a lot of googling and none of the solutions have worked for me.
I'm trying to make an item not get destroyed by lava or fire. I have this, https://paste.helpch.at/anuyucetiq.cs, but it does not work. I register the event properly but it isn't cancelled
Trying to disable dropping items with specific name, but no working... any suggestions?
public void onDropItem(PlayerDropItemEvent e) {
Player p = e.getPlayer();
if (e.getItemDrop().getItemStack().hasItemMeta()) {
if(e.getItemDrop().getItemStack().getItemMeta().getDisplayName() == "§b§ltest") {
e.setCancelled(true);
p.sendMessage("§cНидей хвърля пари уе ;(");
}
}
}
yes, dont use §
I don't think cancelling the event from a different function will work.
still can drop
Hey, im currently on 1.12.2 and im trying to turn on redstone lamps but I can't figure out how.
nms
I've searched on spigot like everywhere 
i! think you can do this with nms blockstates
In the API they are separate items it looks like
BlockState.update(true, false).
yeah but setting it to ON doesn't turn it on.
yeah but when you place them it turns off bcz update
Ill try states.
that's why you need the block state
for (Block block : blocks) {
block.setType(Material.REDSTONE_LAMP_OFF);
block.getState().update(true, false);
}
This doesn't seem to work.
block.getState().setType(Material.REDSTONE_LAMP_OFF);
block.getState().update(true, false);```
Like this, I feel really dumb rn 😅
getState returns a "snapshot" of the block each time you call it
put it in a variable, set the type, then update it
BlockState state = block.getState();
state.update(true, false);
I put it this way is this correct?
I dont' really know how these blockstates work 😅
BlockState state = block.getState();
state.setType(Material.REDSTONE_LAMP_ON);
state.update(true, false);```
Doesn't work.
someone?
have you tried debugging?
Use ChatColor.stripColor (I think) to remove the colors from the item meta and just compare without any colors. try using .equals as well
Actually that's probably a terrible idea lol
You shouldn't use item names for comparison really
is there any way to disable it, i dont really want to disable the item from dropping
you can't use == for Strings, use .equals or, better yet, .contains
Done it like this, and still not working, am i doing something wrong?
public void onDropItem(PlayerDropItemEvent e) {
Player p = e.getPlayer();
if (e.getItemDrop().getItemStack().hasItemMeta()) {
if(e.getItemDrop().getItemStack().getItemMeta().getDisplayName().contains("&b<esting")) {
e.setCancelled(true);
p.sendMessage("&cНидей хвърля пари уе ;(");
}
}
}
Not sure how the colors work with that
Paper's displayName method returns a Component, which is much easier to check, if that's an option
is there any other way disable dropping named items excluding the not finished way above
try adding a print
to debug
oh wait
ik the issue
&b&l this isn't translated into the color codes
thats literally the characters &b&l
PDC is a better method of storing data on items, if you want, here's a tutorial: https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/
PDC = PersistentDataContainer
So if I was hypothetically looking to have someone rewrite Minecraft's leaf decay system for me, how much would a fair base price be?
Would require forking paper
(i do have an actual usecase for this if you were planning on asking 🤣)
I guess it depends on what you want to change?
Currently, leaves use blockstates to decay (https://minecraft.fandom.com/wiki/Leaves), I need them to not use blockstates
I believe a friend said the data could be stored inside of the chunk via PDCs
Might be wrong, not really a developer myself
PDC's are only attached to certain blocks and entities. I don't think leaves are in that list.
You can store PDC in the chunk though
Pretty sure that's how this API works https://github.com/JEFF-Media-GbR/CustomBlockData
Ah ok.
Getting this error, but couldn't find wheres the problem:
im trying to store an itemstack in a hashmap, but whenever i recall the data in another method it changes the material to AIR, why?
method one:
hashmap.put(player.getUniqueId(), player.getInventory().getItemInMainHand());
method two:
player.getInventory().addItem(hasmap.get(player.getUniqueId()));
i would assume this is because the mainhand is air
the only thing that changes is material
what are you doing in the method when you add the item to the hashmap?
ohhhhhh
hasmap.put(player.getUniqueId(), player.getInventory().getItemInMainHand());
player.getInventory().getItemInMainHand().setAmount(0);```
thats probably why, im changing the amount and nothing else
change the amount on the next tick
wouldnt that give them the item back tho?
no?
you could also try hasmap.put(player.getUniqueId(), player.getInventory().getItemInMainHand().clone());
or just Bukkit.getScheduler().runTask(yourplugininstancehere,()-> player.getInventory().getItemInMainHand().setAmount(0));
i believe thats correct
this worked
im assuming the reason why it wasnt working is because when you added the itemstack to the map, it doesnt create a copy, just creates a reference of that itemstack.
oh
so when you made a change to that itemstack, the reference itemstack instead the hashmap was updated aswell
or atleast thats how i believe maps and stuff work
yeah thats what i thought was happening
i believe the way to not have it update is to use the setItemInMainHand() and set it as a new air itemstack
tho im not entirely sure if thats how it works or not
oh would that still be better to do anyways?
gunna take a guess and say replace "%max%" with '%max%'
since stuff inside single quotes are classed as char, and inside double quotes speech marks or whatever are classed as strings
actually ignore me thats wrong, double quotes are correct
hmm
actually i see the issue now, you need to encase that int with a String.valueOf();
put String.valueOf( just before getConfig().getInt(...
and then the extra closing bracket
dont change "%max%", i was wrong.
delete msgs so less confusion
except edit the one where u replied to their msg (so that they know u replied to them)
(Discord.js v13) I cant find a way to set/change the banner of a guild, anyone that knows how i could do this?
What tf happened here lol 😂
no.. you will get timed out
okk.
Question, so im creating a world when i run a command with the name for example x and i have a command to tp to the center of said world. So i get the world by doing Bukkit.getWorld(x) and it works fine, but if i reload it doesnt work. It looks like if i sout Bukkit.getWorlds() before i reload the world is in it, after it is not. How do i add it back to that list?
Wait i think im in the wrong channel...
if you reload what exactly? the server? first of all you shouldn't. you should restart instead. but anyways I'm fairly certain worlds don't stay loaded by default. you either have to load it every time its unloaded or you have to declare it in bukkit.yml
you're in the right channel
oh, well restart the server yes
that's why when you use plugins like Multiverse, if you remove the plugins, the worlds won't load anymore even tho their files still exist
so is there a way i can make sure it loads?
Hello guys, I simply made a plug-in that allows you to create a custom name, gender and age and puts them in the config (and then giving value to the placeholder). I added a command that allows you to reset the values of this player and re-entering them requires the "setup" resetting the data in the config. The problem is that the data remains old and the placeholder does not update except with a /reload confirm. Can you help me?
PlaceholderExpansion class: https://paste.md-5.net/otunadiyet.java
(Command codesnippet)
if(args[0].equalsIgnoreCase("removePlayer") && sender.hasPermission("identity.removePlayer")) {
if(main.getConfig().isConfigurationSection("data") && main.getConfig().getConfigurationSection("data").contains(args[1])) {
main.getConfig().set("data." + args[1], null);
main.saveConfig();```
blitz I belive in you
I mean that's not something related to PAPI. At least I doubt it. Don't you have to reload after you save the config?
reload what
the config. with JavaPlugin#reloadConfig
I might be wrong. I haven't used the bukkit yaml config in a while
mind sending the entire command class? in a paste bin
A member of staff has requested I move your pastebin.com paste to our paste.helpch.at!
ugh. this is how you reload? https://i.imgur.com/Tm0YnFX.png
yeah, just refreshing variables and hashmaps with new values
but no
look at the removePlayer
you might want to make this just 1 request https://i.imgur.com/qXHYZdj.png
I'm just in the removeplayer deleting the config portion containing the date anyway but not changing the placeholder.
anyways. I forgot how the bukkit config works. Can't really help you. It for some reason doesn't reload correctly. or something like that.
but in your file is it changed?
sure
like if you open the config file after you use removePlayer
and your placeholders still return stuff? like player name etc.?
you’ll solve this bugghything too, I believe in you C:
Why is this giving me a null exception at line 31?
https://pastebin.com/Dg9G2NKX - Code
https://pastebin.com/yVF3cw5c - Error
Can you show where you're creating the MenuHandler? bcz its saying that plugin is null. which means you
you're most likely passing null instead of the plugin instance when you create it
The menu handler is a sub class its meant to be opening a gui menu from the main class here plugin.openArmourStandMenu(p); line 30
This is the main https://pastebin.com/geePBdN6
lol I just noticed https://i.imgur.com/3J9wMaR.png
lol but isnt that how its meant to be?
no. you need to pass the plugin instance there
public MenuHandler(ArmorStandGui plugin) {
this.plugin = plugin;
}```
and then you create the menu handler you pass the instance in the constructor
Oh yeah im dumb i forgot about that..
After i did that this happened
https://i.imgur.com/a/GkhrM6I

put this inside the constructor
new MenuHandler(this)
ah i see
Dependency Injection
Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
Read more here: https://en.m.wikipedia.org/wiki/Dependency_injection
Dependency Injection in Java:
https://paste.helpch.at/yijawupoju.java
Dependency Injection in Kotlin:
https://paste.helpch.at/esogakutod.kt
if you do not understand dependency injection I recommend you read this 
Hey, im trying to do cooldown. But everytime I call getCooldown() it's always 2147483647. I set the cooldown to 10 secs.
Hey
im getting an Error with this Code:
public class Countdown {
public static int time;
public void startCountdown(int time)
{
this.time = time;
int Ticks = time*20;
new BukkitRunnable() {
@Override
public void run() {
Bukkit.getOnlinePlayers().forEach(player -> {
player.setLevel(time);
player.setExp(time / 15);
});
if (time == 0) {
cancel();
return;
}
time--;
}
}.runTaskTimerAsynchronously(Main.instance, 0, 20);
}
}
It says in Intelij when I hover over time
"Variable 'time' is accessed from within inner class, needs to be final or effectively final"
You can only use variables that don’t change after initialization inside of lambdas
It should let you make the variable effectively final
Btw please don’t do that async
That’s not safe to do async and you lose performance doing simple tasks async
I kinda want to make a Countdown that I can use everywhere but this prob. isnt the way to do it
like just a simple ansynchron Countdown that returns the value it is at every second
You can also use an atomic integer
in getCooldown have it return return Math.toIntExact(Math.round(((cooldowns.get(player) - System.currentTimeMillis())/1000)));
whuths that
they want it to return the cooldown in seconds
which integer would suffice
basically you were doing (cooldowns.get(player) - System.currentTimeMillis()/1000)
when you should be doing ((cooldowns.get(player) - System.currentTimeMillis())/1000)
I fixed it by doing:
public int getCooldown(Player player) {
UUID uuid = player.getUniqueId();
return (int) ((cooldowns.get(uuid) - System.currentTimeMillis()) / 1000L);
}
Yeah that’s fine
It work's so im not complaning 😂
you missed the brackets, so you were basically doing cooldown - (currentTime/1000) instead of (cooldown - currentTime)/1000
welp, I found another way 😂
you fixed your mistake in the new one aswell as removing the unneeded rounding at the same time :)
Thanks for the help anyways!
How can I lower the Experience for the Countdown?
So like when it time goes down the XP in the EXP Bar goes down slowly too?
got it 🙂
how can I reset the hit delay?
any ideas why this error appears
You have two constructors, only one of them is initializing the map
I get this error error: cannot access EnumDirection when try use 1.18.2 and try access nms
https://paste.helpch.at/ricahakuxo.java Is only a test plugin to try out different things 🙂
lol, remove it same issue
is no issue if i use 1.16.5 insted i think is something with java 17 update i have always problems after that update.
Any idea why selenium throws this when the element is literally on a screen and I have a WebDriverWait for that button? 🥲
Exception in thread "main" org.openqa.selenium.ElementNotInteractableException: Element <button class="btn btn-primary js-accept gtm_h76e8zjgoo btn-block"> could not be scrolled into view
new WebDriverWait(driver, Duration.ofSeconds(10))
.until(ExpectedConditions.elementToBeClickable(xpath("//div[contains(@class, 'gdpr-cookie-banner')]//button[1]"))).click();```
Changed to ExpectedConditions#visibilityOfElementLocated, I tried that before though xD
idk why but for some reason my hashmap isnt working, i have been looking at it for an hour but cant find a solution.
So basicly i am trying to make a scoreboard, but when i add the player to the hashmap (on join) it still returns that its empty
anyone that could help me with this?
This is my main: https://paste.razerstorm.be/apepohesuy.java
This is the Scoreboard task: https://paste.razerstorm.be/yitejomomu.java
This is the join listener code: https://paste.razerstorm.be/iqucaxasol.java
for one, HashMap isn't thread safe
Any particular reason you're running that runnable async?
Does it cause unbearable lag?
without async it gives the same results
well you have two different maps
for(Player player : boards.keySet()) {
if(player == null) continue;
FastBoard board = boards.get(player);
what's that...
one in MNLobby and one in ScoreBoardTask
a for loop
thanks
Hi guys, I'm trying to make chat mention thing, which method should be faster? 2nd?
IF I put this e.getHand() != EquipmentSlot.HAND in a playerinteractevent, shouldn't it only work once?
cause rn, my event is still being triggered twice
well they are fundamentally different?
Guys, Is it possible to refresh a Placeholder? Because when I change the text in the config and save, it doesn't changes automatically and I need a /reload
Already tried by JavaPlugin#reloadConfig();
and basically both variants are wrong
depends on which functionality you actually want
the mentioned player will see same message but instead of username will be @username (in different color)
the indexOf approach is probably okay, but I wouldn't do toCharArray and you need to validate the index
and you also want to check for , and . (or everything that isn't alphanumeric) instead of just checking for spaces
Hi
Hi, i'm trying to use bukkit channeling to send a player from server to server in a proxy
I have tried many things but i don't get why it doesn't works
Pastebin main class:
https://paste.helpch.at/ridapijawa.java
Pastebin command class:
https://paste.helpch.at/oyateruger.java
Error i get with this code
@buoyant haven you forgot the error
bump
what placeholder?
If you mean placeholders by PlaceholderAPI, the plugin displaying the placeholder has to update it
how can I update it?
depends but if the plugin uses PAPI it should automatically update
what plugin?
my plugin
show code where ur displaying the placeholder text
the config is cached, it won't automatically update the file contents
you could look into File Watchers if you want automatic reloading
are you using /papi parse me %Identity_name% to test?
or just make a reload command that calls reloadConfig
and do u have this
yea, I've got the old value from this
already have it
well are you using it?
make sure you're not saving right before reloading
sure, i'm using reloadConfig everywhere
no but
/** * Saving data into config by Person class (Schema) objects * @param playerName Player name * @param main Main */ public void saveInConfig(String playerName, Identity main) { Person person = personHashMap.get(playerName); if(person.name != null) main.getConfig().set("data." + playerName + ".name", person.getName()); if(person.gender != null) main.getConfig().set("data." + playerName + ".gender", person.getGender()); if(person.age != 0) main.getConfig().set("data." + playerName + ".age", person.getAge()); main.saveConfig(); main.reloadConfig(); }
if you reload, does the placeholder update?
no I've not tested with the cmd
you have to test with the cmd
would probably be a good idea to test that lmao
this will just save the old values
- the
person
yea
i dont think the reloadConfig there would do anything
it doesn't no
unless the config somehow changes in the nanoseconds between the invocations
bro I just want to get data.Player.name with %identity_name% just that
you have to tell spigot to reload the config then
It won't reload by itself
you also can't reload it after saving the old data since there's nothing to reload (the new data is rewritten over)
you have to tell spigot to reload the config then
this can be done with a/identity reloadcommand for example
which would call JavaPlugin#reloadConfig
I would like the placeholder to update after the setup though
what setup?
I made 3 inventories where in each of these asks you respectively age name and gender. At the end of setup save the data in the config and should put them in the placeholder
that's my best phrase ever
idk how to explain better than that
well ok that makes sense
so now your issue is that you want the data from the setup to be in the placeholder?
not reloading data from you modifying the config?
nono that's not the problem
the problem is that the placeholder isn't updated after I change or reset the data of a player
after the player "re-finish" the setup, the placeholder val still the older
do you change or reset via changing the file or using the code
code
like that
} else if(args.length == 2) { if(args[0].equalsIgnoreCase("removePlayer") && sender.hasPermission("identity.removePlayer")) { if(main.getConfig().isConfigurationSection("data") && main.getConfig().getConfigurationSection("data").contains(args[1])) { main.getConfig().set("data." + args[1], null); main.saveConfig(); main.reloadConfig();
try removing the reload
that's not the problem, the config is working well, I can see that by opening
the placeholder value does not update either at the removal of the player or at the end of the setup except with a reload of the plugin/server

ah yes
that bug is back
why. cant. I. fucking. change. floats values with just doing instance.float
what
wdym
remember a while ago I was having a problem with changing a float value from other class? its back
my guess is that you're using entirely different instances of the same class
other than that I can't really think of anything else
you can check instances by attaching IJ's debugger and list all of the class's instances, I know you can do that
or using the identity hash code if you're lazy enough to attach a debugger
but debugger be cool, you can see much more
Hey;
I want to make that if I rightclick with my Netherite Hoe that it "shoots" particles out
This is what ive got so far
@EventHandler
public void onShoot(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_AIR) {
Player p = event.getPlayer();
if (p.getItemInHand().getType() == Material.NETHERITE_HOE) {
}
}
}
@NotNull
Location getEyeLocation()```
Get a Location detailing the current eye position of the living entity.
a location at the eyes of the living entity
Isn't EntityDropItemEvent called when a player drops an item? I get output in the console when a chicken lays an egg, but not when I drop an item?
everytime an Item gets dropped by anything xD
theres PlayerDropItemEvent i think
yes
I mean, I read that. But I don't get anything
there is
That is deprecated tho
public class PlayerDropItemEvent
extends PlayerEvent
implements Cancellable```
PlayerDropItemEvent has 1 all implementations, 6 methods, 1 implementations, and 1 extensions.
Thrown when a player drops an item from their inventory
it is?
don't see why it would be
Wait, so EntityDropItemEvent is for entities, and PlayerDropItemEvent is for players
I must have confused it with some other event ig
https://api.extendedclip.com/expansions/groopi/
Hello, I made PlaceholderAPI Javascript alternative because Javascript expansion doesn't work in Java 15.
Could staff please verify my expansion?
well a player is an entity. so entitydropitemevent is not limited to just player but all entities
the playerdropitemevent is basically a smaller event that is called just when the entity is a player
Where should I ask staff to verify my expansion?
the javascript expansion does work in java 15+ actually. it has 2 engines built in. I will verify when I have some free time tho.
Thanks 🙂
might take a while
It shouldn't take too long because it only has less than 10 classes
All it does is to download groovy runtime and call evaluate method
yeah. just busy with some other stuff currently.
Okay. thank you anyways
But, huh, wat. I have this code:
public class ItemDropListener implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
public void onItemDrop(EntityDropItemEvent event) {
System.out.println("Drop " + event.getItemDrop().getItemStack().getType());
}
}```
And it does nothing when I drop an item.
The only output I get is when chickens lay eggs for some reason?
hmm. I guess maybe it isn't called for players since they have their own event
not sure
Yeah, might be ig. Imma try a player event as well
Yup, that was it. EntityDropItemEvent does not include players
Just remembered, I was thinking of PlayerPickupItemEvent which is deprecated :>
How can I shoot an Arrow?
or like how do I define the Arrow
Arrow arrow = new Arrow();
p.launchProjectile(arrow), p.getEyeLocation().getDirection());
``` this doesnt work
Arrow arrow = p.launchProjectile(Arrow.class, p.getEyeLocation().getDirection());
I mean yea, that's giving you errors already
but as frosty said, yours wouldn't work bcz you also close the launchProjectile method to soon. but also it doesn't take an object as first parameter
you can then use the arrow to set potion data, custom effects, knockback strenght and all the other stuff
If i want to only speed it up, what velocity do i Set it to?
like I want to to be instant
can i make the Arrow Invisable?
like I want to "Simulate" an arrow and make it has a Particle trail so it seems like youre shooting particles
you might be able to do so with packets but I don't think this is possible with the spigot API.
Well you would need to track the arrow so why not just calculate your own trajectory?

you'd probably have more chances just calculating it and spawning the particles yourself
Cuz thats high level java skills that I dont have xD
Oh well then
more like math. but not high.
^^^
Why did it reply???
huh?
LMAO. you have the opposite problem I have. sometimes it just doesn't reply when I want it to reply
It replied when I put the up arrows
xD
I've had that too lol
you on mobile? maybe a mobile thing? or maybe not the official discord client?
No clue. But yeah I'm on mobile
do not admit to using non official clients btw. you will get banned.
Nah I don't use anything but discord
ClaasCode, just follow this https://www.spigotmc.org/threads/vectors-application-of-velocity-physics.180332/
not follow
read.
o.O
Or if you don't care for realism, for every 0.10 blocks decrease the y by .1 or more.
i think im loosing my mind
wait on spawnParticle isnt there a way to specify the velocity?
I dont get it o.O
how do I get the block the Player is looking at? (at any distance)
you can't really get it at any distance. you have to specify a max distance. also specifying high distances might be a problem with lag.
so like 25 block?
nah. you can give it like 100 blocks or so just fine. talking about thousands of blocks here
Wait do I even need to block the Player is looking at?
like
I cant get the Solution in my Head o.O
so rn I can't think either but you probably only need the vector you get from player.getLocation().getDirection(). this basically shows you the direction a player is looking
So I have like my Location (Players EyeLocation) and then I need to loop the Spawning Particle thing depending on where the Player is looking to
and then you can just move like 0.10 blocks or so in that direction and spawn a new particle
xD
Ye
But like
i just dont know how to apply the x, y and z correctly (offsets)
so it actually always goes into the right direction
cannot access net.md_5.bungee.api.chat.BaseComponent
Any clue as to why I'm getting this error when doing sender.sendMessage()
Using paper
This is when compiling
Seems like it's one of the dependencies causing it
what is sender in this case?
Show the whole line. sender.sendMessage(String) shouldn't be the cause.
That is the whole line
I changed the scope to provided on the dependency (dont know why it wasnt on that) and it fixed it
Odd
Like a plugin dependency, not paper
👍
by default in maven its not provided.
its like compile or whatever
No I meant I assumed what I had copy pasted already had the scope defined
Silly me
ah
can someone tell me why in da hell it says that the uuid at .getLocation(uuid) is a Location and not a Path?
Code:
public static HashMap<UUID, String[]> users = new HashMap<>();
private static Config cfg;
@Override
public void onEnable() {
getConfig().options().copyDefaults();
saveDefaultConfig();
cfg = new Config("players.yml", getDataFolder());
for (String uuid: Main.getCfg().getConfiguration().getKeys(false)) {
users.put(uuid, Main.getCfg().getConfiguration().getLocation(uuid));
}
}
what?
it's used for setting a Location
then getting that Location
Im kinda Confused since I used that Config Util for Bukkit Locations and now idfk know if it means Location for the thing in the YAML File or bukkit location
wouldn't getConfiguration() return a YamlConfiguration
if so, then it's a bukkit location
not sure what u mean by "for the thing in the YAML File"
huh
like
it does
I think im trying to do it wrong way
can someone explain me how I save user with Stats in a YML file
like i want to use it as Database
There is no predefined methods for that…serialize your data and store it manually
i made it 🙂
switch enum or 8 else if statements comparing enum?
🤢
I have a ProtocalLib question for anyone who can answer. Does anyone know why this might not be working?
new PacketAdapter(PitSim.INSTANCE, PacketType.Play.Server.NAMED_SOUND_EFFECT) {
@Override
public void onPacketSending(PacketEvent event) {
String soundName = event.getPacket().getStrings().read(0);
Bukkit.broadcastMessage(soundName);
if(soundName.equals("mob.villager.idle")) {
Bukkit.broadcastMessage(".");
event.setCancelled(true);
}
}
});```
It broadcasts both the right name and the period
I've even checked event.isCanceled() and it returns true
Yet I still hear the noise
try replacing the sound
just saying
what about writting and invalid sound name
¯_(ツ)_/¯
not all packets are cancellable
im sure you can set the volume of the sound to 0
PacketEvents can cancel all packets
Both 1.8 and 2.0 versions of it
Although Protocollib should be able to cancel any packet too unless it’s written in a really weird way
Hello! I'm trying to play the block breaking animation using packets but it seems that Packet55BlockBreakAnimation is deprecated?
Hello. Im just messing around with packets and I cant figure out how can I make the particle rotate with the player, for example if the particle is 1 block behind the player always.
is there a way to just add Permission to user no matter what perm system
vault
how do i create a round system for my minigame
im creating a zombies minigame
and when the players kill all the zombies
a new round starts how can i do that?
keep track of which zombies they have to kill
I believe every entity will have a uuid
I just counted zombies left in the region. But cj's option is better.
why /g claim is not working
if i set true the worldguard hook then reload
the plugin got error
Yes, im already using the scheduler to make it always visible, this is not what I was asking. I asked for the equasion to calculate the position of the particle to make it appear always BEHIND the player (for example behind half a block). First read the request properly before pasting random shit.
Anyone got a plugin that I can create a gui in game and put it into a class
what do you mean by "put it in a class"
So put create it into a config
hi,
i have som issus with my plugins when i open the inventory "core chest" the first tim everthing work but the second time that not working help pls
https://paste.helpch.at/jezurolifa.php
i have no error bcz i check if ins't null
so ma question is why the first time its work but not the other
thx
pls
Debugging is your way...set printable messages after each line and check where it got stuck
do you need it for plugins like deluxemenus?
nah complete custom plugin i just need a base too work from
Yes
isaw something on here a while ago but cant remember what it was called
i know but the things its the code don't work bcz :
List<?> inventory_content_list = plugin.core_upgrade.getConfig().getList(player_clan_name + ".chest_upgrade.content");
return null after 1 check so you relly think debuggin msg work ?
we can't really help you if you flat out refuse to debug
asking for help without you wanting to help yourself is pointless
print every single thing at every single step, the entire config, each section of the config, player clan name, ...
ok

