#help-development
1 messages ยท Page 229 of 1
we dont question it
Me:
ModuleAPI module = new ModuleLibrary().getAPI();
nLibrary library = (nLibrary) module.getModule("nLibrary");
YamlFile scoreboard = library.getFiles().newYaml("config.yml").default(true).path(new File(getDataFolder(), "providers").build();
ConfigSection section = scoreboard.getSection("Scoreboard.Lines");
yeah no
In even more illness hahaha
the logic is a bit wonky
Wonky?
How would be that to impriove it
Hi, I got problem with mcrealistic plugin I got a file and it's not rendering
For none protrqmmi y quedtio.n please use #help-server
is there a way to use custom heads? Like letters on a head?
Only setti g them to a player
Discord is really shity the se and laggy when I type
but how do big servers give u menus with heads? I mean there is no way that every player keeps their skin
nice that u told me this NOW
Lmao i only trying to help and u swear
public ItemBuilder skullTexture(String texture) {
if (!(this.meta instanceof SkullMeta)) {
return this;
} else {
PlayerProfile profile = Bukkit.createPlayerProfile(UUID.nameUUIDFromBytes(texture.getBytes()));
PlayerTextures textures = profile.getTextures();
try {
textures.setSkin(new URL("http://textures.minecraft.net/texture/" + texture));
} catch (MalformedURLException var5) {
var5.printStackTrace();
}
profile.setTextures(textures);
((SkullMeta)this.meta).setOwnerProfile(profile);
return this;
}
}
relative concept
i want help from other ppl that are not you xdd i know that we know us :)
wait fr
This is o ly apply to newer versions
just change it to your usecase
Epic
yo
There is a problem with that api
im in 1.19.2 everythings fine
I have used it and when you more than 100 request in less than 1m their shity eat litle block you
what is an ItemBuilder tho? Just a quick short answer pls
custom thing
i can either give you the entire file or i can edit it for external use
Mojang texture has a lovely shity rate limit and if you more than 100 request in less than 1m they block you
that's... the whole point of the return
i just found it online and didnt really look at it lul
could i ... have it?
yeah
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
+1
Doesnt look tho you mostly so that and they are not always the same player
could u just send me the code of the part that makes the texture on a head? Bcs i already have my own itembuilder
ah ye
might be a bit wrong since i cant test it
PlayerProfile profile = Bukkit.createPlayerProfile(UUID.nameUUIDFromBytes(texture.getBytes()));
PlayerTextures textures = profile.getTextures();
try {
textures.setSkin(new URL("http://textures.minecraft.net/texture/" + texture));
} catch (MalformedURLException e) {
e.printStackTrace();
}
profile.setTextures(textures);
skullMeta.setOwnerProfile(profile);
item.setItemMeta(skullmeta);
thats not even a sentence and i understood it more than any sentence ive read
I was laughing because of what he said cuz he use that command for diff ppl all the time. I mean its simple dont want to help usut ignore the message dont disturb pfff
I mean pff its like saying in tired
I dont know how you use it english tho
I use pff as complaning tho
Translated by https://www.deepl.com/translator
this is a public discord and you are just going to have to learn that everyone has their opinion and facts. Seems you have been doing a lot of complaining as of late though ๐คจ
I mean idk why is to understand tha if you dont to help just ignore the message instead of being annoying
Because you are just disturbing while someone if getting hleped
I dont think you would like to be asking for help and someone come just to distufb
Ik that but is in the one who is helping๐
Hi Iโm trying to make an item that places a block and later creates an explosion at that block. I can get the location of the block when placed but canโt figure out a good way to keep track of these blocks
Does the tracking need to be persistent?
Cause if it doesn't need to be then you just need to use a HashMap
Would I have to use a database if I wanted it to be persistent?
No
How would I make it persistent?
Json
Ok. I don't think that's really necessary for my project
This might be a stupid question but how would I do this with a hashmap?
Uhm you just add the block to the hashmap(or only an ArrayList, depending on what you are doing)
I think I got it
Or if you mean that the block should explode like 10 seconds later, just use a timer
I'll just use the player uuid as the key and block position for value right
Idk what you are doing soo
I have a sword that creates a block and the next time I right click with the sword the block explodes
easiest way would be to to use PDC
?pdc
(Means if the player drops the sword to another player, does it need to have the same blocks?)
I thought I couldn't do that for blocoks
chunks have pdc, which contain blocks
My suggestion to my question to you: if no, use a HashMap. If yes, use NBT)
Alf, why not just use NBT on the sword lol
nbt needs nms iirc and that just pointless
nms isn't needed for this. That is just introducing unnecessary complexity
Its hella easy to use NBTTags
^^
10x easier to use them than PDC imo
that is your opinion, but that means now instead of a plugin that is version independent, it is now version dependent and the compiling has to be different to depend on the necessary jars
nms doesn't have an api, where as PDC does
Yeah fair but not fair =(
I do not have a single medium sized project without nms lol
nms made coding fun for me again
Hello noobs
Hello
Where is Nuker
Yes
nms is nice
I think I got one project or two that don't use NMS
but they rely on other plugins of mine that use NMS so

I only do complicated things so I never do not use nms lol
mans tryna flex
Lol
What do you mean by using NMS?
Well, can I flex with my fallingblocks? I guess so
net.minecraft.sever
but also inclding everything in net.minecraft
NMS is where you directly invoke methods and such in the server code as opposed to using the API. I will say you can do a lot more that way, but you can also do a lot more wrong that way too. Also, there is generally no documentation for most things and even there was that documentation ends up being outdated within a version or two because method names and classes change between MC versions.
Jeez frost
(With the second part frostalf is basicly saying that often nobody can help you and you have to read the actual minecraft-code to find things)
Ah ok. What things can you not do using the API?
NBT for example
there's something called pinging people
Querz/NBT on github, NBT-API are all apis that work
Anything regarding packets and fake blocks/entities, as well as more general block and entity logic can be answered by me
I don't know anything about custom biomes but I'm good enough at the rest
Basicly everything that is not intended to be done
lol
Lets not forget about Packets for nms
well it isn't that is not intended to be done, just not everything can be a feature as the more things included into the API, the more code there is to maintain implementation wise
I'm writing a full nms course
and well it all breaks and needs to be fixed by hand between versions lol
That has information tiers
So you can learn about nms packets, go deeper into tcp if you want
Overriding internals is also a lot of fun
might help to learn TCP first
before messing with packets, but most seem to like learning the opposite way
and then wonder why they have problems they can't seem to understand ๐
Lmao
@wet breach I would personally mark the course to be only for advanced devs, newbies might try and fail miserably
No one wants to learn about tcp headers if all you're looking for is a simple sendPacket method
My objective is to have a basic tier for most developers
while true, it would be beneficial later down the road and even elsewhere outside of the game lol
like it would stop people from thinking that making it packet only would save on bandwidth when they don't realize all packets are padded out anyways to be the max size ๐
Yeah that
Can I store a UUID in PDC or do I have to convert it to a string?
not natively but it is very straight forward to write your own PDT for that
I'm new to Java so I have no idea how to do that lol
I believe the javadocs even have an example ๐
AP CS Question
declaration: package: org.bukkit.persistence, interface: PersistentDataType
Make a custom one
Pdc is strong af
And configurable
After coding for a while without testing everything is broken now XD
oh nevermind
I ended up just doing .toString() when comparing the UUIDs :P
You can do that in that way either
I mean, generally you'd want to use Object#equals - at worst (due to nullabillity) you'd use Objects#equals.
So either uuid1.equals(uuid2) or Objects.equals(uuid1, uuid2)
is there an event to see if an item was blown up?
I realized the way I made it won't work. Currently when the player right clicks with the sword it checks if the hashmap has the player's UUID as a key. If it does, then it creates an explosion at that block. if it doesn't, it creates a new falling block which gets added to the hashmap after it turns into a block. The problem is I can only keep track of one block at a time so if the player creates a new bomb before the last one becomes a block, they now have an extra block that doesn't behave as a bomb.
I need to store each block with the player's uuid and I don't know how to do that with a list
Tablist Sorting
https://paste.md-5.net/xequyujagi.cs my brain is refusing the let me see why this is A) running giveOrDropItem more than once and B) why the drop swapping isnt working on every drop (I have GRASS swapped to PINK_BANNER to test it but its giving me both)
you can also do UUID.fromString()
to get the UUID objects back
Oh ok thanks
you are using .equals on a string. Need to do == instead
all of them?
in general if you are wanting to compare the contents of an object and not if the objects are the same yes
I'd not do that given that while the enum type string are interned, the configuration section's strings are unlikely to be interned
Unless snakeyaml interns strings, but that is a dangerous assumption to do
guys wtf i have in my plugin yml my command: commands: and as a sub thingy i have yes:\n description: something here now... my plugin tells me that he cant find the yes plugin: java.lang.NullPointerException: null [...]
at de.fluffy.stonekid.modules.administration.commands.VoteYesCommand.<init>(VoteYesCommand.java:24)
But my code: Objects.requireNonNull(instance.getCommand("yes")).setExecutor(this);
?paste the full file
aighht
(plugin.yml and VoteYesCommand.java)
error code: https://paste.md-5.net/leyexodife.log
I'd move the contents of the constructor to the onEnable method
also #setExecutor includes tab completer
they are
i created a module system
oh right lol, I am blind
Don't create an instance of the class that extends JavaPlugin
tf why
i.e stop doing new RazerPlugin
i didnt? (ignore this (: )
replying to a different person lol
Well that's why I didn't reply to you ๐
maybe 2 plugins with the same package name
im dump :)
cause im making my plugin and someone asked me to make a plugin
using the same test server
This error seems like to happen when I click too fast
You did.
at me.frandma.razerplugin.RazerPlugin.<init>(RazerPlugin.java:6) ~[RazerPlugin-1.0.jar:?]
at me.frandma.razerplugin.RazerPlugin.onEnable(RazerPlugin.java:10) ~[RazerPlugin-1.0.jar:?]
Reading stacktraces is an important skill here in java world
How can I make it not null?
Well I certainly don't like it, but it ought to be enough
At worst you'll see me doing a PR titled "Migrate to DataInput/OutputStream" in the future, but that is rather unlikely
In your else if you're checking if it's not null or something using that thing, but if the first one fails that means it IS null, so the second one is probably where you're getting that NPE.
it doesnt make any sense
am i not able to use /yes?
or something
i mean its litterally in the plugin.yml
well no I tried every possible ways
Just change it to event.getCurrentItem() == null || other thing
Wait
I am also tired so probably not best for me to help either right now lol
Yeah, it was very untypical of you to suggest using == on Strings
Use guard clauses, makes it way easier.
if(event.getCurrentItem() == null) return;
if(event.getCurrentItem().getType == Material.AIR) return;
event.setCancelled(true);
The error only happens if I click the item too fast
Are you sure that it isn't caused by you clicking outside the inventory?
but if I click too fast it just gives this error, still works fine tho
You'd still would like to use item != null && item.whatever() though, otherwise it is guaranteed to throw
okay guys the thing: You cant use a command called yes idk why
Or use guard clauses because that is superior
ah okay
&& is basically fail-fast, that is the right-hand-expression will never get executed if the left-hand-expression yields false
with .equals on the string comparing, it swaps the item but still gives me the item im breaking and the swapped item and also triggers the giveOrDropItem more than once somehow. different amount of times for different blocks, GRASS 6 all 1 amounts, GRASS_BLOCK (which has fortune) four 1 amounts and a 12 (only the 12 should run)
separate your check for null from the rest
Could you post the entire plugin.yml?
if you make the null check its own check without the others, it shouldn't try to evaluate the rest of it
if it is null
like this?
well they don't all need to be separated, just the null check
Should be == not !=
Yeah that's right
now it should solve your clicking to fast throwing NPE's
whoa it worked... I suppose
and you also learned why combining checks together might not always be a good thing since they will all get evaluated even if the first fails ๐
someone else suggested me that XD
well, then they didn't know the caveat of doing so either
Code running methods more than it should, cant figure out why
Storing block locations
uh, have you worked with bitwise operators and I/O Streams before?
name classes with UpperCamelCase
hi! someone could advise me a good ORM for spigot with my pgsql database?
Well I guess It'd be enough experience for a little excursion:
public class MyContainer {
public String name;
public long x;
public long y;
public long u;
public World world;
}
can easily be stored by doing
try(DataOutputStream dos = new DataOutputStream(Files.newOutputStream(this.getDataFolder().toPath().resolve("myFile.txt")))) {
for (MyContainer m : myList) {
dos.writeByte(1);
dos.writeUTF(m.name);
dos.writeLong(m.x);
dos.writeLong(m.y);
dos.writeLong(m.z);
dos.writeLong(m.world.getUID().getMostSignificantBits());
dos.writeLong(m.world.getUID().getLeastSignificantBits());
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Reading would be equally easy:
try (DataInputStream din = new DataInputStream(Files.newInputStream(this.getDataFolder().toPath().resolve("myFile.txt")))) {
while (din.readByte() == 1) {
MyContainer m = new MyContainer();
m.name = din.readUTF();
m.x = din.readLong();
m.x = din.readLong();
m.x = din.readLong();
m.world = Bukkit.getWorld(new UUID(din.readLong(), din.readLong());
myList.add(m);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Now, you can do it in a more rational way, but to be frank I do not know the more rational way. ByteBuffers are everything to me
public void onBlockClick(PlayerInteractEvent e) {
if (e.getAction() != Action.RIGHT_CLICK_BLOCK) {
return;
}
Bukkit.broadcastMessage("clicked");``` im right clicking blocks and nothing is happening, yes its registered
?jd-s
ok so guys, I got the packet https://wiki.vg/Protocol#Set_Entity_Velocity I need to send to update. What do you guys think is the best opportunity to choose all target players that should receive it?
or should I just spam it to every player?
(please notice that I am sending it every single tick for every single fallingblock)
Right clicking as in being near enough to the block that it wouldn't register as punching air?
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
At first one would want to get it to register at all
I've been trying to use NMS and I am looking at many tutorials. All of them have objects and things that my plugin doesn't recognize... does anyone know how I can get this to work?
Have you ran build tools and does the dep say "spigot-api"
no I have not ran buildtools and dep is this
ok
I removed the -api and I got that error
also I have looked at that website many times and I dont see where I can get it for my plugin... can you tell me how
I looked up tutorials on how to get it on a plugin too and they were getting it to make servers
Run buildtools
Bukkit.broadcastMessage(key);``` why is it only broadcasting 1 key my config looks like this
```counter: 2
1-id:
location:
==: org.bukkit.Location
world: world
x: -85.0
y: 67.0
z: -719.0
pitch: 0.0
yaw: 0.0```
it only broadcasts "counter"
return true;
}``` and the 2 locations are the exact same and its not returning true
Huh
just asking, are plugins meant for april fools/cursed plugins allowed on spigot? (website)
How can I detect when a player damages a falling block?
Hello
where is your question ๐
Otw m8 waitttt
Why does every time I write /land commands it's print out /land. I'm scrathing my head off, because I've check all my player.sendMessage but none return command name
๐
can you show the code for that command ?
[deleted] ty
Yea so
when you return false, bukkit believes the command was not successful
and prints the usage message
you always return false -> always the usage message
bump
can someone reply to this? its a small question and i kinda ned to know
pretty sure any form of plugin is allowed as long as it follows the guideline
the concept and ability it provides shouldn't matter ?
it says no trolls or pranks but ig that is breaking the server
I mean, mark the plugin as that
currentley i have 1 that kicks everyone who moves not like a bot
and one that just kicks anything that moves
๐who would download that
I presume that is fine as long as you properly state that ?
at least that is how I'd interpret it
i'd second this
i just wanted to verify that
bump
have you checked the api ref?
Btw thanks @eternal night !
yes
just checking that the 1.15 bukkit api works on spigot bukkit paper and bungee 1.19 etc?
bukkit is literally not maintained ๐
and im guessing there is a more up to date spigot api
the fork/whatever you want to call it that spigot has from it is
spigot-api is as low as you realistically get
bukkit api is just, please don't ๐
thats what i get from 11 year old tutorials
rip ๐ญ
11???????
yea
they are using eclipse and jetbrains just came out
no

cuz theres this really great course on Udemy that is constantly updated
lmfao
๐
yea don't buy courses on this 
oh wait u mean spigot api cources
even buying courses is a bad idea
self taught js is....
hard
im trying to self teach spigot
yes
im talking about syntax
and
basic java
like the docs dont help me bc i know nothing about java
and how to structure things
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.
js != java
ive tried all of those
doesnt really help
i need 1-on-1 instruction basically
๐
Docs? Never heard of that
.
but im solving my problem
then go to college
wait what? https://cdn.hostshibe.com/i/0mw22
Which you should learn before spigot
i didnt ๐ญ
im learning java rn
in school
but i tried to do soigot
without full java knowledge
and its really hard
tbh if you can learn to read errors
its not that hard
its not brainfuck for gods sake
it can be ๐ฅฑ
<<<<<++-+++--...>>[]
a bit of brainfuck code
can someone just send me the subscribe to event line rq
i keep forgetting it
My friend, you need to code everyday. Learn the basics first master it a bit and then you can learn API.
If you master one thing transition to another going to be easy, I'd say I've master Unity 3D framework but it's a struggle for me for years to master it.
Now just 5 days a go I dive into Spigot and I can read docs cleanly and I'd say that I've not using java that much but I master C# so the transition is easier
push your self to create a somewhere complex console program and learn programming fundemental then dive into API
Yes, do console program first before you dive into API
yea
ty
for(int z = (int) e.getBlockPlaced().getZ() - 11; z <= (int) e.getBlockPlaced().getZ() + 11; z++) {
e.getBlock().getWorld().getBlockAt(x, e.getBlock().getY() - 1, z).setType(Material.RED_WOOL);
}
}``` how would i make this make a border around a center location? rn it makes a square
https://cdn.hostshibe.com/i/jbdu5 how can i fix this?
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.
oooohhhhhh
im coming from the bukkit api mb
Intellisense is not intelligence you can't rely on Intellij's error handling to blindly walk your way through coding 
ik
Doesn't matter java conventions are the same
https://cdn.hostshibe.com/i/re77z is there any way i can downgrade to 1.18.2?
change the api-version in your plugin.yml
sorry im blind
ty for helping
no problem ๐
please do that by api
^
?
also, no slashes in console
oh yea
you can clear a players inventory using the API ?
you can also add an item stack to a players inventory using the API
just executing commands is not how you develop plugins
e.g.
@EventHandler
public void on(final PlayerJoinEvent event) {
event.getPlayer().getInventory().clear();
}
public void on ๐
reads nice, leave me aloneeeee
Yh.. wth is on
I mean, what additional information is provided by a different method name
onPlayerJoin(final PlayerJoinEvent event) ?
Loads, easy to read, better organisation
what
public void onJoin(PlayerJoinEvent event)
public class hitEvent implements Listener {
@EventHandler
public void onHit(EntityDamageByEntityEvent e) {
if (e.getEntity() instanceof Player && e.getDamager() instanceof Player) {
Player targetEntity = (Player) e.getEntity();
Player player = (Player) e.getDamager();
}
}
}
``` any way to change the knocback amount?
the fact that I have to write a method in the first place is already annoying, I don't want a large method name ๐
โonJoinโ isnโt large
yea but onJoin communicates nothing to me
conventions where
that I don't already know from the method signature
But on does?
literally 0
I see a method annotated with the EventHandler annotation and I see the event type
smh we cant convince him
onJoin adds nothing, I can directly see this is called on joining
whats a location class value
wdym?
If you worked for a company you would be told to name methods properly, itโs standard practice
im thinking about ClassValue<Location> now
you'd be surprised, I do work for a comapny xD
not funny
Very surprised
Please don't do that in your company , previouse dev really hit me hard with that type of names ๐ฅฒ
you can serialize a location yes
theres even a FileConfiguration::getLocation
what lol
same argument goes for overloaded method names then
if the only identifier you think is valid is the name of the method
instead of its entire signature
my teacher programmer told me i was doing a good job 
what's the best way to print colored messages in Console?
that is a completely personal opinion
Itโs standard practice idk why youโre trying to argue about it lol
with ConsoleCommandSender it generates strange symbols in the log files
Bukkit.getCommandSender().sendMessage(ChatColor.RED + "boo")
no reason to send colored messages in console too
as far as I know this will print some strange symbols in the log file
I need them for some formatting
just asking on addItem() how do i set the item and make it send 500?
what is your opinion on methods like WeekFields.of
of what
check the param type ๐
looks ugly tho
almost like the parameter type is part of the method signature and actively contributes to the method identification
and i put that in addItem() right?
hi guys how do I fix the movement predictions of my custom fallingblocks? The client keeps predicting trash and therefore it looks weird
I have already tried sending PacketPlayOutEntityVelocity packets every tick but the issue remains
public class hitEvent implements Listener {
@EventHandler
public void changeHitKnockback(EntityDamageByEntityEvent event) {
if (event.getEntity() instanceof Player && event.getDamager() instanceof Player) {
Player targetEntity = (Player) event.getEntity();
Player player = (Player) event.getDamager();
}
}
}
``` Okay imma drop this one again any way to change knock back amount on hit so for ex. when player x hits player y. player y gets moved 4 blocks. anyway to 50% the knock back amount so player y moves only 2 blocks away
where naming conventions
they will forget you too
well, too bad this is nothing serious i just need to chnage knockback and im done w this plugin
Can we get an Amen to this 
nobody cares whether its serious or not
just use the right naming conventions
smh should use copilot for css, it knows it better than me
Get added to the Copilot lawsuit 
๐ฅ
no more stackoverflow

damn its smart too
i seriously doubt that
5head bot for sure
I guess if you infringe a shit load of copyright and licences you get smart 
how would i get an entitys name?
so for ex:
Entity name = event.getEntity().<getName()?>
are you referring to the custom name ?
nope, like sheep!
that is the entity type
yea
from there you are off with some more or less fun choices
while the server bundles the english translations
I don't think spigot exposes them
ahhh alright tysm!
how to code claims plugin?
//push
uhm
thats rather vague
I can't tell if they are joking or not
like
when you claim land
to prevent someone griefing it
Use a database and store the data in it. When someone breaks a block check a cache of current claims to see if the block is within one and the current permissions applied
no offense but why would u wnna code a custom one? there is like a billion out there already and a good way to do it is store a player's name somewhere check for blockBreak using an even Listener pass the breakers name through an if statement if it returns false replace the block back, i would also add a health penalty
abstract class with static final values for the default types id guess
wouldnt abstract class be better for like namespaced key and shit
and built in methods
hm ?
like storing the namespaced key
so the impl doesnt have to do that
because its common to all materials
its a server side impl
yeah
I don't see how that matters then
either you do it in the API or in the server
which, if possible, always server
oh yeah
How can i fix a written book showing *invalid book tag*
in this code
private void givePlayerBook(String mcUUID){
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
BookMeta bookMeta = (BookMeta) book.getItemMeta();
bookMeta.setAuthor("tr3xxx_");
bookMeta.setTitle("Blank");
bookMeta.addPage("test");
Bukkit.getPlayer(UUID.fromString(mcUUID)).getInventory().addItem(book);
Bukkit.getPlayer(UUID.fromString(mcUUID)).openBook(book);
}
is there anyway to make a player jump?
oh shit i forgot i had this horendouss pfp on
would this send a console command Main.getInstance().getServer().getConsoleSender().sendRawMessage(command);
can you make a zombie sneak with packets?
use dispatch command and as sender use consoleSender
use Bukkit#dispatchCommand
CommandSender?
mongodb 
fancy scoreboard without flickering finally
?
will that work
does right clicking shields trigger playerarmswing
does PlayerInventory#getContents() returns everything with armor and offhand and this shit?
velocity
yes
i think
it does with armor
i forgot with offhand
cool
thanks thats very nice
very very convenient
can i get an inventory of a double chest just with one chest?
can i cast 1 block to a double chest?
lol
like this?
why not
tell me :o
huh
so just getBlock()?
im confused
so i cast the block to a chest
and then get the doublechest from the holder?
you told me? wtf
thats what i said...
yes?
yes?

dont be rude
?jd-s
for myself
anyway to move the ballFiring event to the onPlayerMove event (ill fix the naming eventually )
public class doubleJump implements Listener {
@EventHandler
public void onPlayerMove(PlayerMoveEvent e) {
Player player = e.getPlayer();
Vector velocity = player.getVelocity();
// Check if the player is moving "up"
if (velocity.getY() > 0) {
// Default jump velocity
double jumpVelocity = 0.42F; // Default jump velocity
//check if player has potion effect of jump
for (PotionEffect effect : player.getActivePotionEffects()) {
if (effect.getType().equals(PotionEffectType.JUMP))
jumpVelocity += (float) (effect.getAmplifier() + 1) * 0.1F;
}
// Check if player is not on ladder a\nd if jump velocity calculated is equals to player Y velocity
if ((player.getLocation().getBlock().getType() != Material.LADDER) && (Double.compare(velocity.getY(), jumpVelocity) == 0))
player.sendMessage("You jumped");
}
}
@EventHandler
public void ballFiring(PlayerInteractEvent event) {
Player player = event.getPlayer();
Action action = event.getAction();
if ((action == Action.PHYSICAL) || (event.getItem() == null) || (event.getItem().getType() == Material.STICK)) return;
}
}
is there a way to make survival player float at a certain altitude but also able to walk and jump like theres ground
lemme try repeated tp and see if it stutters
i recently did a fully reset of my pc with all files configuration
etc
i was wondering if there was any tutorials out there
on how to setup your workspace again
so intelliji
making it look nice
installing all the spigot stuff
all the java
just setting up the environment
if anybody knows of a tutorial for this
the giant's hitbox is non existent in the upper body
is bounding box the thing ur supposed to use to make custom hitboxes
Hello, does anyone know in what class does spigot handle players messages and commands?
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
https://discord.com/channels/690411863766466590/1044264003846815834 Someone look at this please and confirm im not crazy
how do I do this?
?bt
anyone know how iโd make a assist system without a hashmap<uuid list<uuid>> ?
it tells me how to make a server with buildtools not a plugin with it
he told me to get buildtools for my plugin im making to use nms ;-;
I'd assume you don't
yes
you could make another class to handle the List<UUID>
Its actually pretty simple
i guess
You can probs get away with some PDC shit
like mark a player in their PDC
wait
and after some time remove it
Why are you obsessed with not using a hashmap lol
isn't pdc a map aswell?
I'd personally make use of a Queue
Think it makes a bit of sense here
ah
Map of queues that is
So like
Alr
Yes, though the smarter idea would be to hide that Queue<UUID> behind an object
^ this, but a Queue
remove target
you want to use a map rather than looping over a list
and comparing target
its faster
Can I cast somehow a PlayerInteractEvent to a PlayerInteractEntityEvent?
I mean depends
It's the only fast way
I mean not quite
you could use a Long2ObjectHashMap
or how was the fastutil impl called
I mean
I wish they'd implement that shit in mc ๐
MSPT--
@worldly ingotuhh could u help me
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
ah
I see
ty
Does someone know how to cast PlayerInteractEvent to PlayerInteractEntityEvent?
an event is an event. If you want a particular event listen to that event
^
Uh then maybe ask detailed
I programmed a compass which has the ability when I rightclick it, that I get teleported to a spot. My problem is now that if I rightclick a citizens mob on the one world which has the ability to teleport me to another world, it teleports me back
Ignore cancelled events
If compass in hand and aiming at npc cancel
If the citizens isn't cancelling the event that's probably a bug on them
uh how can i do this with aiming to the npc?
If event.iscancelled return
The method isCancelled() from the type PlayerInteractEvent is deprecated should I ignore this?
Paper???
yup
in paper it is xd
xDD
read teh depreciation, it tells you
mfw ignoreCancelled = true is being neglected 
it just tells me that there are now 2 methods: useInteractedBlock() and one for useItemInHand()
ah idc bout deprecated
it works so I'm fine with it :P
ty for your help โค๏ธ
How can I use NMS? Every time I try to do what tutorials say, my plugin doesn't recognize many of the objects.
What's the difference between the title and name of an inventory?
You need to compile the Spigot server jar and use it instead of just the Spigot API
into my plugin?
ok, where can I find the dependency to copy/paste
You can't just download it, that's illegal
bruh
you need to build it with build tools
Build tools spigot version ur using than remove -api from the spigot dependency
Make sure u use --remapped
so I make a buildtools server then remove -api form spigot dependency?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
omg
I've looked at this website a million times trying to get this answer already
it tells me how to make a server
I already have a server
It tells you how to use BuildTools if you would actually read it
I am trying to make it in my plugin to not have errors
๐คฆ๐ฝโโ๏ธoh boy buddy
Gimme a minute
Your in above your head already but gimme a sec
okay...
also I want to make it where u can have mining fatigue but ur arm doesnt move so slow
That's client-sided, there's nothing you can do about that
yea but hypixel does it
Uh, no
yes
Where
in skyblock dungeon hub
๐คฆโโ๏ธ
Here's nms have fun no one here can really help you with this stuff so you best beable to be independent
That's adventure mode
with flags dynamically set
but very slowly
That's possible in adventure mode
So you can break them and they get replaced?
You can't give people miner fatigue and have it not render for the player, the client handles the arm slowdown
so if u have mining fatigue in adventure mode where you can break blocks somehow ur arm doesnt move slowly
You can not stop the player arm from moving slower without modifying the client
Which Dungeons hub?
go to skyblock in hypixel
then walk to nether portal in cave behind spawn
actually, you may have mining fatigue 1
but even with pickaxes it doesnt break
maybe they change the block hardness
No they probably just cancelled the interact event lol
Manipulating block damage event maybe
Yea they are just manipulating block damage event lol
wait you do have mining fatigue
yep ig u cant anymore
wtf
thats what I said
yeah no clue
but negative stops you from breaking anything and doesn't cause the slowdown effect
You can change the toughness of a block with a plugin?
Maybe this? https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockDamageEvent.html as Y2K mentions.
Nope
Dang really?
I saw a spigot thread where someone said they did
my modifying packets
ye
That's hacky but true ig
You could do pretty much anything by modifying packets
So it is not easy then?
Ni
but yeah, pretty sure this is negative mining fatigue
You need nms
nms is what?
or ProtocolLib if you don't want to hate yourself
what
It's just objectively easier
Not really?
tru
Remapped hell yea
public class Callback<T> {
private final List<Consumer<T>> consumers = new ArrayList<>();
private T result;
private boolean results = false;
/**
* Ideally this method should be called from the main thread.
*
* @param result Result that is being proviaded to the callback.
*/
public synchronized void setResult(T result) {
if (this.hasResults())
throw new IllegalStateException("Callback already has a result");
this.result = result;
this.results = true;
if (this.consumers.size() == 0)
return;
for (Consumer<T> consumer : this.consumers) {
consumer.accept(result);
}
this.consumers.clear();
}
public synchronized boolean hasResults() {
return this.results;
}
public T getResult() {
return result;
}
public static <T> Callback<T> withResult(T result) {
Callback<T> callback = new Callback<>();
callback.setResult(result);
return callback;
}
public synchronized void whenComplete(Consumer<T> consumer) {
if (this.hasResults())
consumer.accept(this.result);
else
this.consumers.add(consumer);
}
}
Should these methods be synchronized
It's copy paste between versions 90% of the time and it's super easy to multi module
If you were to edit the toughness of a block would it be every block of that type in a world for every player or could you make it only certain blocks in an area and only to certain players?
Well if you remap methods to be more than a, b, c, d, etc then I guess it would be
i'm not sure if i understand synchronized correctly
You can do both
Yea remapped is actually mojangs named
It's all of the methods properly mapped
Mojang Remapped is like the best thing
Yarn >>> Mojmaps
You even ever used mojang mappings
yes and they made me want to die
I don't mind yarn but mojang names make a lot of sense lol
private final File file = plugin.getDataFolder();
^ How would I do this without getting null?
plugin is this.plugin
They name things pretty randomly sometimes
createFile?
I've only modded a few times tbh so not an expert with yarn mappings lol
Now to never go to Dungeons again
I meant Mojang does
Yea I know
I already answered you
meh
I believe in yoh
Unhandled exception: java.io.IOException
Damn feels bad idk
I liked yarn, but the maintainers used to love fucking with compat (dk if thats still the case)
Maybe yoh don't have write perms
like changing mappings at random (causing incompat on dev side)
@river oracle I dont really understand your answer, here is my code though. https://paste.md-5.net/pexibazice.java
^
Static moment???
oh
Lmao
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Anyway, anyone know this?
InventoryView#getTitle is the only way to get title iirc
Also wtf
What is that
If any of that is null ur in trouble you don't even need to check as unless something fucks up with this it'd be completely irreversible
Your plugin is as good as broken
It works with that.
yea
Intellij can be so stupid with its nitpicks sometimes lol
VSC ๐ช
I'm just hugr vscode Fan
https://paste.md-5.net/xogicoceso.bash
Anyone know what happend? I'm confused..
Don't mind me
oh thats my translatealternatecolorcodes thing
I just want it to make a yml file idk why it's so difficult
it shouldve been as easy as getconfig.save
so replace save with createnewfile?
file.createNewFile(file);?
Its erroring
You said change homes
Ohhh alr
Result of 'File.createNewFile()' is ignored
What exactly is an NMS class?
Net.Minecraft.Server
How would I save it? Same way I did before?
How's that
Done ;D
sendHome lovely method
Still another error ๐
but i dont think that the commandexecutor is the right one to handle all of that
as well as you might wanna make your variables private final
yeah and if your player updates their home the plugin wont notice it
https://paste.md-5.net/isuhefuyaf.bash
Why isn't my console giving me any helpful error?
I like to have one class per command
it is java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "msg" is null
How do I fix that?
ahem
java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "msg" is null```
yeah, thats correct, but the homes handling should be done in a different class
HomeRepository
I'll put it in a different class later
f.e.
๐
https://github.com/EthanGarey/BetterServer
Homes.java
Repository seems about right since it holds, manages, adds or aborts the whatever it is about
nah
https://github.com/EthanGarey/BetterServer/blob/master/src/main/java/BetterServer/Main.java#L52
https://github.com/EthanGarey/BetterServer/blob/master/src/main/java/BetterServer/commands/Homes.java
i always make use of the repository pattern
keeps me away from managers
and does what i need it to do
alr
tf is a plugwoman
plugman but better
I use it for localhosts
both shit then probably
it actually registers the commands of new plugins
just reload normally
unlike plugman
godcipher takes too long plugwomen is instant
too long
what toaster are you playing on
My Samsung toaster
what about your samsung toaster
Samsung roaster
wifi kettle
Does the "sendTitle" method have to be deprecated?
on paper probably
Yeah nvm it keeps erroring ima just remake /home again
"The method sendTitle(String, String) from the type Player is deprecated"
check the docs
there is an alternative
use the other one
?jd-s
With that one you need to include int values?
Thank you
hey
https://paste.md-5.net/eforucanip.java
How would I convert "File homesfile" to a yaml configuration?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
how would i go about calling a custom sound with Player#playSound(...)
buildtools+?
buildtools+?
buildtools+? Opt me in!
damn he edited it now it's just buildtools ๐ฆ
sad
How can I use a Tab Completer in a bungeecord plugin? I found this constructor,
TabCompleteEventโ(Connection sender, Connection receiver, String cursor, List<String> suggestions)
but I do not no what to do with it.
i found this thread https://www.spigotmc.org/threads/bungeecord-command-tab-completion.392866/
public class FooBar implements TabExecutor {
looks like i cant read lol
what should the implements/extends be... I was using extends TargetedEvent implements Cancelable according to https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/event/TabCompleteEvent.html but it seems to give me an error
anyone?
read the thread on the message im replying to
wow i'm finally useful
Thats not how this works.
If you want to listen to a tabcompleteevent, you need a class which extends Listener and register it as an event listener.
thst class needs a public, notstatic method with a singpe argument - TabCompleteEvent.
Then it will get called whenever someone tabcompletes something (mostly pre brigardier)
yep
how can I make it tabcomplete for different commands
soo... uhh, like this?
public class helpCompleater implements Listener {
public void helpCompleater(TabCompleteEvent event) {}
@EventHandler
public void onTabComplete(TabCompleteEvent event) {
helpCompleater(event);
}
}
Compleater?
chill I typed it wrong when I made the class
Completer
ik ;-;
twice?
ehhh