#help-development
1 messages ยท Page 15 of 1
or maybe it has changed, idk
what are you trying to achieve?
nothing. just wanted to check whether Bukkit.getWorlds().get(0) is always the default world
well how then
ohh
run your plugin on a server
probably, yeah
yes i have
and all works fine exept the onInteract event
typically, i beileve if you filter for the world type of OVERWORLD, it may be the first default world (Not sure about multiple oveworlds tho)
Did you register the event?
Yes
ok wait
it works now
but the arrow is left ckick block and air instead of right click block and air
but why lmao
how do I use this damned replace function ๐
method*
on discord?
the same as you would do in vim
nah
one sec
String emoji = ":smile:";
String emojilink = "APILINK";
if (message.contains(emoji)) {
event.setCancelled(true);
event.getMessage().replace(emoji, emojilink);
}
oops
what does message(String) do
included mixed code
event.setMessage(event.getMessage().replace("asd","foooooo"))
strings are immutable
you cannot just replace anything in a string and expect it to be applied to the actual string. String#replace returns a new string
icic
?paste
Time to suffer:
Exception: https://paste.md-5.net/vopatinace.bash
The code that fires the said exception
Is the first line in the screenshot, any reasons this packet doesnt exist? It exists on the protocol website, using protocol lib btw
oh nvm okay so guess protocol lib no worky on 1.19
Dev builds work
just download off git and compile?
My client and server is being spammed to hell rn lol
just running the plugin alone
nvm
Top of the spigot page :)
๐
ik i could barely hold it together too lol
debugging is attempting to know what place does your code bug (stop running), typically using print statements
Caused by: java.lang.IllegalArgumentException: Could not find packet for type SPAWN_ENTITY_LIVING
sadness i still get this error ๐ค
Any reason why it would delete the message? ๐
total client/server spam gone tho so thats a big plus though
Wait, do i need to depend on that ci jar too?
ahh so prolly packet name change
ggs
got i hate installing maven files, be back in 5 years 
gradle moment
They have a maven repo though
but website still shows them seperate
rip
i even linked it earlier and it said SpawnEntity lmfao
XD
and not for that dev build i dont think
or maybe they do
but imma try spawn entity, cause i even followed the packet structure for it 
LMAO
WTF
so this is why you dont use deprecated type ids

Lynx, where do you get the Mob Ids from? The wiki site actually goes to a dead link for it: https://wiki.vg/Protocol#Spawn_Entity
click "Mob Types"
that was only part i couldnt find anything for
Does anyone know a good api for usign RGBirdFlop? Because iridium is giving me quite a bit of trouble right now.
oh nvm
might not even need one
my bad
I have learnt java and I've managed to fix this, Thanks for the help!
(Not sarcasm)
How can i get 1 closest player within my radius of 10 blocks?
And how can i fix that it is not myself?
getNearbyEntities with a predicate
(Instanceof player check and not equal to player)
Thank you! I will try that :D
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I check from my location who is closest, but it still gives myself as closest player
show your code
Try it and see
I always get the closest player like this, or similar
private static @Nullable Player getNearestPlayer(@Nonnull final Player player) {
return player.getWorld().getPlayers().stream().filter(other -> player != other).sorted((o1, o2) -> (int) o1.getLocation().distanceSquared(o2.getLocation())).findFirst().orElse(null);
}
Entity target = getClosestEntity(p.getLocation(), 6);
if (target instanceof Player || target.getName() != p.getName()) {
p.sendMessage(Utils.colorize("&6Je bent nu &c" + target.getName() + " &6aan het zakkenrollen..."));
target.sendMessage(Utils.colorize("&6Je wordt nu door &c" + p.getName() + " &6gezakkenrold!"));
} else {
p.sendMessage(Utils.colorize("&cJe moet naast iemand staan om te zakkenrollen!"));
}
}
public static Entity getClosestEntity(Location center, double radius){
Entity closestEntity = null;
double closestDistance = 0.0;
for(Entity entity : center.getWorld().getEntities()){
double distance = entity.getLocation().distanceSquared(center);
if(closestEntity == null || distance < closestDistance){
closestDistance = distance;
closestEntity = entity;
}
}
return closestEntity;
}```
yikes
Why every entity
why are you doing all this manually
just get a stream of players in the same world, filter and sort it, done
That's going to kill your server quite quickly
Is there a better way of doing it then?
I literally sent you a oneliner above
Yeah both of us have recommended ways
Oh damn can i try that?
^
Thanks i will try it!
my dude is missing his beard ๐ฆ
Why not use Citizens
challenging myself
Thank you so much it works now!!
You need to send the skin layer meta data then
ez
ty ty
Does your NPC extend ServerPlayer?
yeah im using ServerPlayer
Ah not a packet npc
nah, still packets though
Util.sendPacket(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npcPlayer), players);
Util.sendPacket(new ClientboundAddPlayerPacket(npcPlayer), players);```
no need for a packet. In your NPC class just add this.getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);
oh sick thankyou
that will enable multi layer skins
so when you add them to the client it all gets sent correctly
Will the add packet take care of sending the meta data
Isn't that another packet? Or do I remember wrong
The ADD_PLAYER will add them, but he's already doing that. Without teh data set it only shows first layer of the skin
Alright
No clue why its not set by default, but who knows
yes, its a private field so only accessible in teh class which extends ServerPlayer
By chance is this open source
cause im working on the same exact thing rn lmfao
i mainly am just confused about the InfoPacket
spawn packets ez, but jesus the info one
you just have to pass through the ServerPlayer
Yeah working on that now, i found this guide: https://stackoverflow.com/questions/70634072/spawn-fake-player-with-minecraft
which is odd
finding spigot code on stack overflow lmao
yeah nms stuff sucks to figure out
i scoured spigot and then that shows up lmfoa
never any resources out there
``java
Yeah most i found were outdated asf
private static void showAll(Npc npc) {
ClientboundPlayerInfoPacket playerInfoAdd = new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npc);
ClientboundAddPlayerPacket playerSpawn = new ClientboundAddPlayerPacket(npc);
ClientboundRotateHeadPacket headRotation = new ClientboundRotateHeadPacket(npc, (byte) ((npc.getYHeadRot() * 256f) / 360f)); //
ClientboundPlayerInfoPacket playerInfoRemove = new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER);
for (Player player : Bukkit.getOnlinePlayers()) {
ServerGamePacketListenerImpl connection = ((ServerPlayer) NMSUtils.getServerPlayer(player)).connection;
connection.send(playerInfoAdd); // Inform client this Entity exists.
connection.send(playerSpawn); // Spawn this entity on the client.
connection.send(headRotation);
connection.send(playerInfoRemove); // Remove from servers tab list
}
}```
So extending SeverPlayer essentialls just handles the InfoPacket?
looks like a skin i made at the age of 12
hey dont diss my skin ๐
nostalgia kicks in
I assume skin is set when extending ServerPlayer?
or is there some method in the info packet?
I use a setSkin method in my extended class```java
public void setSkin(String[] skin) {
String texture = skin[0];
String signature = skin[1];
this.getGameProfile().getProperties().put("textures", new Property("textures", texture, signature));
// Enable the second layer of the ServerPlayer's skin
this.getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF);
}```
Whats the name of the skin site that gives you texture and sig again
why use an array as params lmao
oh Elgar while you're here
how do you handle interaction?
because afaik the event doesnt fire if i click my npc
I haven't checked interact events firing. I do have code for attacking them
Why arent they any dye items to chose from
What version are you on
1.8 iirc
Is that mojang or spigot remappings?
The last line enum does exist for me
Which is why it doesn't work
1.8.8
^
but the items are in the game
Back then you had to set data manually of a specific material
^
because in your outdated version, all dyes are ink sacs lol
1.8.8 was when they had sub ids
See that id
all Mojang
and how are they called lmao
yeah well
AHHH haha
use a proper MC version and you won't have to deal with this
had wrong Player import
?1.8 my mans
Too old! (Click the link to get the exact time)
Bro it's in that screenshot lmao
/**
* Gets the closest player in this world, or null if there is no player
*/
public static @Nullable Player getClosestPlayer(final @Nonnull Location location) {
oh
wrong paste lmao
thanks!
gonna use that
just google minecraft dye ids
XD
thx
No
so like this and ID is the certian id
no. new ItemStack(Material.INK_SAC). Then use setDurability(...) on that
ok
No
ok
that does not look like a valid short to me, lol
the color is only the 10 part
351 is the ink sac
They skipped the learning java part we told then 10 times yesterday
So they have no idea what they're doing
hi, i'm creating my first plugin and i follow a tutorial to implement Vault... but it didn't work. Somone can help me?
what does this ink sac thin have to do with java xD
The code you're writing isn't valid java
the fact that you have no idea that "351:10" is not a valid short
Could you send the code
?paste in here
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Ah right that exists
no thats obvcuis but i dont know how to put the id then
like
xd
?
Alex already awnsered what you need to do
shit wrong video
it was the one where I mistyped the same thing 12 times
This! โค๏ธ
Limited internet. What's in the video
i did it
Copilot?
Now send the link
there is the main class and the events class.. https://paste.md-5.net/onuvaqulaj.java
how can i put any dye in my inv/gui
yeah, it wrote a Comparator<Block> that sorts by distanceSquared to a given location
Nice
So what's not working with it
it didn't give me money
Did it send your messages
nop
you never set econ to anything not-null. Why didnt you tell us that you get console errors?
._.
public static Economy econ = null;
This is always null so getEconomy() is also null so it throws a NPE
In the .getTargetBlock() what are the args?
Actually any docs?
so how can i fix it?
declaration: package: org.bukkit.entity, interface: LivingEntity
Thank yoooouuu
Set the econ variable to something :)
why does this not work
ok so if i set it != null it will work?
Because why would it
because there is no constructor for ItemStack(Material, DyeColor)
?
you are setting the provider only to the local variable "econ"
set the field instead
i don't understand....๐
and how do i fix it
remove the word "Economy" in line 52, and then do ?learnjava lol
by learning java
You use the way we told you earlier + ^
oh shit
this worked??
first time?
nice, no im not spawning it in , cant make me
dont forget to add ! at the end
for a extra piece of candy
What is the transparent arg?
What does it do ???
materials that it ignores / "sees through"
It tells you
Oh I'm retarted
I fucking hate it when people keep asking the same questions and simply refuse to learn basic java, instead they decide to waste eversone's time with their ignorance
Talking to you is like talking to a wall. I'll just ignore you
I also blocked him lol
but in vault api descrition sy to set private static Economy econ = null;
they probably also tell you to change it to some useful value later on
That part it correct you just need to set the variable in setupEcon
Sorry to intrude, how did you set the NPC position when spawning into the world? I assume just moveTo(double double double) then sending the packet?
there is a function return with it but i also write it
Set teh position before you send teh packets
setPos before sending packet
doesn't the entity constructor already require to give a location?
like the AreaEffectCloud here?
nah ServerPlayer has a setPos function
Also i assume ClientboundEntityMove packet, is the packet used to manipulate the entity movements?
Trying to find the wiki.vg packet im trying to compare again uhhh
seems like this.getEntityData().set(Player.DATA_PLAYER_MODE_CUSTOMISATION, (byte) 0xFF); doesnt wanna work
yeah pretty sure
moveTo just does it for you
ClientBoundEntityMovePacket.Pos iirc
this packet
Is the specific one im wanting to use, and i assume clientboundentitymove is this?
.
ClientBoundEntityMove is abstract
Are you sure? Last i checked ServerPlayers dont have navigation
wiki.vg would be quite useful... if they'd actually use the proper packet names instead of random, made up names
so moveTo calls actually threw errors, or similar method did that cant remember
will take a look ty
Entity id, x movement, y movement, z movement, onGround
changes are relative right
Yes
yeah still trying to figure out the names lol
I think 4096 is one block
I just worked with this earlier :p
Yeah im changing from citizens to packet based npcs
hoping this way the npcs actually stay on theyre pathfinding path
how do i make custom entity follow player? btw im using remapped
zombie
setTarget(entity, false);
Where false = attacking the player while chasing
I think you need to get the entities navigator
getNavigator() iis
wait
lemme double check
oh yeah the chasing goal
yeah im trying to learn how to use goals but there are no remapped tutorials
how can i do this?
Uh I have a feeling your Java skills are lacking if you don't know how to set a field
I want to see the source code of LivingEntity$getLineOfSight where can i find it?
Going through bukkit or even spigot's repo i can only find the interfaces of LivingEntity, where's the implementation?
yep u'r right.....
CraftBukkit
CraftBukkit
CraftLivingEntity
oki thanks!
?learnjava
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.
Also just wondering, why is it done like that? What's the point of making an interface if there's only one implementation of it, why not directly coding the classes/implementation?
Because that's how APIs should be done
If someone decides to make a custom implentation like Glowstone there won't be a problem
By chance have you worked with spawning them in to (ServerPlayer with packets)?
you dont want to expose the internals. you only give the interface out to which the user can orient himself. and i dont mean javas interface here
how can i do that
honestly the whole concept of interface is a bit blurry to me because we could already do that by subclassing/extending implemented class...
Info packets work, but the player doesnt show up on the server, no errors either
hm ok
or more simple said, API is an interface by defintion
you interfere with the interface without knowing whats behind
Spawning what in?
oki^^
A fake ServerPlayer using the ClientboundAddPlayerPacket
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
it's in CraftLivingEntity
Imma guess it points to World#rayTrace
thank you!
can u write me a simple code to make work my plugin please? because i need this plugin as soon as possible ๐ after that i promise u i'll study more java...๐
it just uses NMS. Let's see what that does
?paste
it does some raytracing but it calls it "clip" lol
How can I launch custom Projectile?
Code --> https://paste.md-5.net/legihoxeha.java
I first of all tried extending the class as ThrownEgg
Error:
Mojang has some strange names
you must implement Projectile
or use NMS to launch it
also used Projectile but gave on that bcs of this
oh the npcs were spawning in
just halfway accross the fuckin map
right
well if I want to do it NMS way?
Please no "Update breaks everything"
Idk, look into NMS player for a launchProjectile method
Or look at what CraftPlayer calls for launchProjectile
you can only launch custom projectiles if they extend one of the existing projectile classes
otherwise it'll fail
is there a better way to have sync and async implementations of some db stuff instead of this?
i could also join the future but thats kinda resource expensive
How did you use this function?
I setPos but seems like the position does-
im so sorry
fucking
public void setLocation(Location loc){
entity.setPos(loc.getX(), loc.getY(), loc.getZ());
}```
thats it
entity being ServerPlayer
lmao
spawnIn -> spawnAt ๐
get() also will do the similar
also Bukkit Projectile has 1000 implement methods..
get() blocks until future compeletes, which would execute the future in sync
If you need code fast hire someone
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
also this move packets sick
still bald :/
B A L D
i need to make mine lock on the ground ๐
theyre just walking around in air LMAO
yeah seems setting their flight mode and game mode still makes them float
How long does a refund take?
why the heck do people use Arrays.deepEquals for normal arrays, ugh
they walk FAST tho 
what refund?
Very true
to look cool lol
quick question: are y'all a fan of final everything within an api which is not explicity meant to inherit, instantiate, do whatever with it?
depends
or is it just like a "fuck it, their fault"
From Spigot I bought something and it didn't work. And my friend said it would work I went and refunded
some things a user may want to change
i dont like when i wanna do something and an api limits me, so i dont limit othres
spigot normally doesn't have anything to do with refunds. just message the dev and ask for a refund
isnt that the same as join then?
especially if this is for pathetic api
ik get can throw an exception but uhh
yes but join() does something with the thread iirc
most likely
Hi guys, I'm trying to make a bed placing function with Loc of the Bed foot, and Blockface for direction.
I get the error : cast exception bed / block data ...
I'm on 1.19 version, can you help me ?
its just the minor things like dont instantiate pathimpl yourself f.e.
It's been a week the dev haven't answered
that's a really short error message.
[10:47:16] [Server thread/ERROR]: Error occurred while enabling Bedwars v1.0 (Is it up to date?)
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.type.Bed (org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData and org.bukkit.block.data.type.Bed are in unnamed module of loader java.net.URLClassLoader @5c29bfd)
then "report a problem" on paypal
that's good?
but like if i want to change a variable or something, at least make it non final
no
that way even if its not public i can ez hack into it with reflection
send the full error...
...
I did
Bed bedDataFoot = (Bed) block.getBlockData();
did you check instanceof?
That's the line
isnt it the blockstate you need ๐ค
then the block is not a bed
I have tried with multiple usages but without success..
hmm
no, bed extends BlockData
mye i see
and do instanceof
The block is a bed
I have set the block type to bed before
If I come here, It's because I haven't find solution
print out the block
with the one line code you sent, you arent checking if the block is actually a bed
Don't take me for a quiche please
lol
one of those people again
comes here, asks for help, provides no code, doesnt show an error message, gets angry when people have suggestions
block.setType(type);
BlockState state = block.getState();
System.out.println(state);
Bed bedDataFoot = (Bed) block.getBlockData(); // Le bed est un org.bukkit.block.data
bedDataFoot.setPart(Bed.Part.FOOT);
good luck fixing it yourself then
type is RED_BED
instanceof as i said ๐ฅบ
and what does it print now?
i cant..
just ?paste everything you have and get as response in your console
Yeah I'll just block him
otherwise you wont receive any help
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock cannot be cast to class org.bukkit.block.data.type.Bed (org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock and org.bukkit.block.data.type.Bed are in unnamed module of loader java.net.URLClassLoader @5c29bfd)
he's trolling lol
it's the fifth time that he refused to show the full error or code lol
Excuse me, I don't usually ask for help on discords ^^
you are casting the block instead of the block data
in MainBedwars line 22
erm
I meant
in BedwarsManager.java line 155
So I can't do bed placement without CraftBukkit?
Nope, i'm casting a blockData to the bed...
No, you are not
you dont
Show the code
Bed bedDataFoot = (Bed) block.getBlockData(); // Le bed est un org.bukkit.block.data
for the third time - bedwars manager line 155
stop casting the block to bed there
Alright i'm a bit confused, i'm making an inventory menu, something that's already been done a thousand times before
and yet i can't seem to prevent a player from moving items in and out of the inventory using the number slot keys
anyone knows the event fired for that?
doesnt seem to be
InventoryClickEvent
InventoryDragEvent
InventoryInteractEvent
InventoryMoveItemEvent
It's InventoryClickEvent
the error is not at this line,
the error is at this line
bedwars manager line 155
if you're sure of that i'll try and rewrite a few things because something isnt firing somewhere...
thanks for help me bro
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
too much weed
Drug is not a weed, plant is a meth. Can you grow weed, can, drug, plant??? YES. Can you weed drug? NO. ||Reference to Jeaney collects||
hmmm
does anyone know on how to hide this "authors" bar in intelliJ? D:
oh random reply
sry lol
ya click the name above the method again
of course ๐ i dont rlly like it either
I didn't even know you can show authors
is there non-vanilla enchantments?
well, i'm making a command to strip an ItemStack of their enchantments, and put it into a book, but I'd like it to only strip vanilla enchantments
you could probably getKey() and see if it contains "minecraft:" lol
unless the custom enchant is dumb and doesn't use it's own name
getKey().getKey() should be "minecraft"
right okay
thank you!
you're also like 50 builds out of date
dont really care, im just testing my plugin
anyone know why PacketType.Play.Client.USE_ENTITY on protocolLib calls 4 times for 1 entity lol
which packet is that?
ServerboundUseItemPacket?
it's once for each hand and maaaaaybe it also gets send once for block and once for air? no idea lol
Please don't discriminate them
hate crime on packets >:D
They don't deserve it
intellij crashed for no reason lol
?stash ?
assuming you want to see the craftbukkit internals
probably the mc dev plugin
rip lmao
lmao
Is the bot down?
?ping
Pong.
I don't think that command exists ?
EntityZombie is the spigot mappings name for the NMS zombie
oh uh
Nms are things that came from moksng right?
wondering anyone wants to code together?
idk coding alone is boring me lastly
(i code unique game-modes for my server)
not mini games a gamemodes
like DayZ (for example)
?services maybe
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Do you want to join a project or are you looking for people to join your project
he wants to code with his gf ๐ฅบ
nah not services not gonna pay for a hobbie
i can either join other people projects as well
just to improve my own skills
i will not pay someone to code with me its so funny
I mean, look at open source projects and contribute ?
FourteenBrush it was really not nice
yo guys, how can I change one trade of a villager?
nah i want to work on something unique
i dont mind to join anyone else project i would be happy
Have you worked with Minestom before? If so you can help me with that
sever software
no not really i have exprience with bukkit/spigot
but i might do some homework ;p seems to be pretty much the same thing
yeah mojang obsf their code
Im creating a community with friends I will dm dm you
It's much faster but it takes a bit of work to get something running. It's perfect for minigames or custom game modes
i see
They give us mappings
If obsf is obfuscation ;/
bumpy bumpy
check this vid out, this guy made all of this with minestom and no client side mods
https://www.youtube.com/watch?v=pbPkNASYz2g
https://www.youtube.com/watch?v=RthXDciwLH4
Yeah I know
oh haha
i see minestom look pretty dupe
kinda break the limits i guess
since in the first video to make an axe fly like this you would use armorstands that are invisable
Yeah you should join the Minestom discord and see what people have made
1.18.2 only
There is no reason to run 1.8
And don't say pvp. You can disable attack cooldown
Performance isn't that bad in modern versions
My phone can run 1.19 at 40 fps just fine
Samsung A51
modern phones are having better cpus then many non modern computers
True but if you're running a CPU that's older than Minecraft it's probably time to upgrade
i guess you got a good point
I have a 10 year old i5. I run 2 Minecraft instances, a server and Intellij without a problem
And at times a few chrome tabs together with that
i see i have an a gaming laptop with i7-10700k
and an rtx 2080
(laptop gpu)
but i kinda stick to the version due the players in my server
I got a GTX 960
how much vram?
2
I can run Apex Legends at lowest settings
That's probably the most intensive game I play
I do want to work a bit with Unreal Engine but it runs out of vram in an empty project
ah
i had a bad computer as well in the past
with an i3 and 4gb vram gpu
i got the new laptop only because apex legends
but i dont play it anymore oftenly i dont have any friends to play with ;c
my only friend is working in the military industry so i see him only in weekends
Apex is the most fun with friends
Have 900 hours now
Still suck at the game though
yeah when i played it for the first time
like a year ago
it felt so unusual futuristic shooter
was really fun
but my friends are losers once they die i dont want to play this game anymore
if you are from the EU we can play together โค๏ธ i always get teammates without mic ;c
just ordered a pc with rtx 3070 lmfao
'for school' myes
๐
yo guys, how can I change one trade of a villager?
setMerchantRecipe
Villager#setRecipes
does anyone know if i can set the output dir of the package command to some sftp destination?
404
!verify
Usage: !verify <forums username>
!verify EvanMclever
A private message has been sent to your SpigotMC.org account for verification!
or is there a better way to get the amount of all the messages by code?
lmao "waste less time with my wife and more into coding" ๐
doing config.getValues(true).size() - config.getValues(false).size(); basically now
i dont know i just dont feel like i want to watch tv with her or something
on my free time
i would like to waste less time with my wife lmao
so i m adding a new enchant, what chance should I keep it?
but in general it seems fine?
i hope today when i get home to see some wierd plugin ideas
Maybe reflect the linked hm and computeIfAbsent youโre extremely desperate, else kotlin with its extension functions 
smh i have no idea what im doing moment
Myeah I mean you could go with an adapter design if you wanna do it sophisticatedly
now both of us figuring out what an adapter design is ๐ฅฒ
How can you get the main server world (the world that people join on and thats specified in the server.properties)? I've read that Server.getWorlds().get(0) works, but im not entirely sure if thats always the case.
Well basically a wrapper Ig
ah a wrapper that does not directly return the wrapped values but does something with them?
More like you copy the methods interface of ConfigSec or whatever you wanna copy and then implement a class which wraps an original ConfigSec and delegates to it when you call the adapter methods
Theres no implemented method for it?
In addition since its your interface you could add whatever preferable methods you want
oh
bump
You could have your own locale abstractipn where you store all messages in a repo class, then it will be easy to determine the size with Map::size or sth
Else yeah believe that approach suffices
Weird that theres no implemeneted method for it but ill just use that ยฏ_(ใ)_/ยฏ
Thanks :D
currently having this stuff https://paste.md-5.net/xeduqamira.java
If importing jars from that folder you need to import teh bootstrap one
If using Maven, you should not be importing jars
Whatre ys tryin to do
Not in particular
Maven is simpler and building against spigot, its setup for maven
Both maven and gradle work, theyโre equally simple Id say
Use whatever you like the most
i'm currently having a lang.yml file with all the messages in, but the thing is that whenever i add new messages to the file in the jar, those dont appear in the runtime file
okay
so i tried to write the default messages to the runtime file if it wasnt present
Check for missing entries by key maybe and fallback to default ones and populate the file.
how do i create a villager that will give my enchant
I have the trading part setup but still cant figure out how to find that villager
should I use EntitySpawnEvent, or some event related to a villager profession being changed?
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
You used that jar right
how to check if a villager is a librarian?
why?
ty
Hey I have a weird question, are chunks meant to throw the chunk load even several times in a row and possibly even in the same tick?
and I mean the same chunk
because I'm having that issue
This is possible to unregister a craft in furnace ?
I want remove the Iron Pickaxe to Iron Nugget
That's not true, gradle is faster
What is false?
Speed does not imply simplicity gain
Nor malfunction
equally simple does not mean equal
Read again
But also
Saying gradle is faster is vague
It hugely depends on setup
I really invite you to read this
https://gradle.org/maven-vs-gradle/#:~:text=The biggest differences are Gradle's,files that changed when possible.
Tho yes it caches some stuff which make it fast, but you can configure maven to be parallel also in which it may be faster than gradle
Iโve already read that and Ive run some benchmarks of my own
Dont spread fud
Can someone help me on a plugin I bought a week ago doesn't work and I asked for a refund it doesn't say on the page no refund they said it in dms I need the refund back it doesn't work I already went to PayPal they haven't answer them at all.
This is a chat for devs
In that comparison gradle seems a lot faster, tho there are a lot of aspects to pay attention to
My reason for using Maven... I only code for Spigot (no forks). I know Maven, its simple and I want to play with NMS, which Spigot/specialsource makes so simple.
then wait for them to answer
i want to use nms so bad but still have no idea how to install it
like i know i have to use btools
anways time to boost rq
That's what I've been doing for the whole week
slay
What do you need help with exactly?
We can't help you
- Besides this is isnt the place for those discussions Akuma
Oh sorry >->
Requires an index paramter, how do i know the index of the last trade (the one on the very bottom)
How do I check when a user tries to enchant something using an anvil, do I need to hear for both InventoryClickEvent and InventoryDragEvent?
declaration: package: org.bukkit.event.inventory, class: PrepareAnvilEvent
there is this event
but it says this: "Called when an item is put in a slot for repair by an anvil."
for repair, but it maybe works for enchants too
there is also EnchantItemEvent
but thats for enchantment table
Thank you, Ill use PrepareAnvilEvent
i just realized that idk how to really use buildtools. i successfully ran it, so... what next? where do i put the files for it to be indexed by my ide? i really have no clue lol
are you just tryin to use the api?
i am pretty sure you can't
lemme try
but the proper way for nms is buildtools, i just don't know what to do now lol
Entity shooter = ((CraftEntity)p).getHandle();
WeaponBullet bullet = new WeaponBullet(shooter,p.getLocation(),speed, range,damage,headshotDamage);
float xRot = shooter.getXRot();
float yRot = shooter.getYRot();
bullet.shootFromRotation(shooter,xRot,yRot,0.0F,1.5F,0.0F);
Why does this, for me atleast, shoot most of the time somewhere off?
WeaponBullet:
https://paste.md-5.net/wevuderehu.java
Entity is nms
it works rn, but i am pretty sure that it's because i ran buildtools and it just worked?
Why are you not just using launchProjectile in Spigot?
i think you need to run the build tools even then
bcs for me atleast, it used local .m2 repos
nms projectile
it doesn't let me do that
why nms projectile?
yeah it seems like it actually puts it in my local repository, prolly detects it
oh
full controll of it and also bukkit projectiles require like a 10000 methods to be implemented
wdyfm 10000 methods to be implemented
Projectile projectile = World#launchProjectile or smth i don't remember
๐คฆโโ๏ธ
you can literally modify it to your fancy
Spigot Projectile you can launch any projectile and set the Item to have ti look like anything you want
well I wanted to just do WeaponBullet.shoot or smthing
and it would work fine
I didn't want to set each Bullet everytime I would like to shoot
Thats a simple wrapper method
nvm
soo no clues why it shoots sometimes wrongly
Can someone help me? I'm trying to create a ban command but target.setBanned(bool); doesn't work
do i need to import anything?
You could even create a Consumer to set all your projectile settings, then specify it in the launchProjectile
just a check but are u using
right and not target.setBanned(bool);
oh well
time to redo everything
bool i meant in true || false
it gives me an error
maybe should i import something for it to work?
i'm making the plugin for 1.16.5
it's not a thing i am pretty sure
it's like Bukkit.getBanList().addEntry() or smth
i don't thing Player#setBanned is a thing
i'll try this one then
Bukkit.getBanlist(Type.NAME).addBan(username, reason, expires, source);
i copied this from a thread, if it's outdated just check what it's like now
Variables:
- username: the username or IP-address if you are ip-banning (String)
- reason: String: the reason. (You can use ChatColor)
- expires: This is the Data (java.util.Data) insert 'null' to permanent ban
- source: The player's name who banned. Not really important. (Could also be 'console' or something like that)
whats the error
Cannot resolve method 'setBanned' in 'Player'
therefore Player doesn't contain setBanned
use this
@dense laurel this look usefull
seems that's working, i'll apply it
and work on an unban command then look through this
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/BanList.html#pardon(java.lang.String)
BanList#pardon(String target) is for unban
declaration: package: org.bukkit, interface: BanList
you might want to check BanList#isBanned just to fool-proof your plugin, idk if it would throw an exception if you'd try to unban a not banne dplayer
Does anyone know how to make intelliJ auto deploy my plugin to a different server, maybe smth like ssh into that vps and paste the file?
go to pom.xml
in <build> I think add
<outputDirectory>leading to /plugins/
or pls send me pom.xml build section
I'm not near PC rn
i found, Tools (intelliJ tab) -> Deployment
Hello, I need to know how can I set custom texture to a skullItem (item with skullMeta) with spigot 1.19 ?
profile field does not exists anymore
NMS stuff
there's plenty of util stuff or just code on net
imma send u what I used
Yep but they all use the "profile" profile field
okok thank you
are u using correct texture value?
for example I use mineskin.org
and use texture value for the skins
my method is the same as those that didn't work for u
Yes I tried a texture that works normally
eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTNlOGJiYzhkMTc0YWVjZDZiNDY4ODhmYTYzZjliYWRlMTRiMDQyZTVlMTcwNjMxMzlkNjdmOGUwMTYzYTM4In19fQ==
please code
try removing one =
please don't ask to be spoonfed
ask for pseudocode, for concept, never for code, unless you are REALLY struggling and will NEVER EVER resolve this by yourself
It's good it's fixed, It was indeed a problem in my code
entitydamagebyentity
and check if damager is holding rod
maybe not the best way
but will work I think
or there might br some rodhookevent or smthing
I did not ask for a code, Maybe I phrased my sentence wrong but I just thought that the "profile" field did not exist anymore (which surprised me) and if there is an alternative method since this new version
im using 1.18.1 and it works fine for me
but as you said later, it works and it was code problem
perhaps send your solution here for future souls not knowing what to do?
Exactly yep
' ' perhaps send your solution here for future souls not knowing what to do?
damn it doesn't work on phone
Texture head itemstack (kotlin)
private fun texturedHead(texture: String): ItemStack = ItemStack(Material.PLAYER_HEAD).apply {
itemMeta = (itemMeta as SkullMeta).also {
it.javaClass.getDeclaredField("profile").apply { isAccessible = true }[it] =
GameProfile(UUID.randomUUID(), null).apply {
properties.put("textures", Property("textures", texture))
}
}
}
and to find texture from PLAYER_HEAD itemstack :
private fun getTexture(skull: SkullMeta) = (skull.javaClass.getDeclaredField("profile")
.apply { isAccessible = true }[skull] as GameProfile).properties["textures"].iterator().next().value
Why using Kotlin for Minecraft plugins ?
(I've never used Kotlin, just wondering why it could be a good idea)
any1 here experienced with minimessage?
i cant figure out how i can add an item to text. where you hover over a word and can see an item tooltip
found this. but dont rlly understand what they mean with SNBT string
Cause Java is really obnoxious to some extent
anyone know how to make this work? getType() returns a Material which cant be used with endsWith
getType().name()
Watching Supernatural ๐
SNBT is your like {display:{Name:'{"text":"Hi"}'}}
can anyone in here teach me about scoreboards or link me to a guide I'm trying to get started with the basics of Spigots scoreboard API but its confusing me. I can't figure out the whole team thing
that looks cursed asf
I don't understand, why is the craftbukkit's github taken down by dmca
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
thx
What does a protected var do?
thx
You can also do a quick search on google
I mean we can help you but also google is your best friend
๐
well i found the class def not sure what the var was
Is there a way to get a skin texture from https://sessionserver.mojang.com/session/minecraft/profile/<UUID here> ?
yes, this is what i want
?unsigned=true
If you dont wanna use sig and just use value as base 64
otherwise value is the base64, and sig is well, the sig
so its unsigned then
you only need value
if you need it signed use ?unsigned=false
eg
yes but how can i get the contents from the site with a httplibrary or smth
its json
i never used such a library before
data.properties[0].value - to access it in javascript for example
Json is relatively standard
typically youd know json before learning http requests
i need the website
huh?
i know json

