#help-development
1 messages · Page 479 of 1
I bought someone last year a $100 mouse
they have services section too
oh
i love just looking at what people want for like nothing
yeah my most expensive purchases are 2 mice
roccat kain 122 and gmo-
xD
i'll take a look
though processing payments may turn out to be a bitch
which switches would u recommend?
reds
It was a gaming mouse that had some handy buttons, adjustable height and length for the back and adjustable weights
tbh i don't know anything about switches
that sounds
fancy
And it was all metal
especially if you live with people and are awake at night
Yes mechanicals are loud
if i was on my old keyboard my brother would come in telling me to shut up, there is 3 walls between us and he had headphones on
Lol
lol that is not a keyboard, that's a driller
a chance to get scammed is there
I use contracts for commissions and an escrow service
what's escrow? is it like an intermediate for money
The escrow service guarantees i get paid for the work. The contract is for the escrow service so they know what the rules are
Yea. Its a service that holds the money and prevents either side from scamming
cool, gotta have that in mind when I start doing services
As long as you hold up your end of the deal you get paid and the requestor cant pull the money back
i see, but how does it ensure that the money goes to the right person? (e.g. the developer if the commission is done)
If you dont hold up your end the requestor gets their money back
That is what the contract is for. The contract outlines the rules for either party and is what the escrow service uses to determine if you fulfilled the agreement
Is there an actual person inbetween or is it automated?
fuck
Its half and half. There needs to be a person that verifies
one wrong move with this sevrice and i'll be declared a foreign agent in my country
Lmao
Alright makes sense. Otherwise I'd be wondering what would prevent me as a developer to put in a random .jar instead of an actual plugin (or whatever the service was)
The downside of going contract route is that minors cant enter into contracts on their own. Which is fine with me because rarely have had any good experiences with minors paying for stuff
oh that's right
minors can't enter contracts
looks like i'm not doing helpchat commissions any time soon
it was fine for me but I was a minor myself back then
Well there is exceptions just i didnt encounter those often
Well as a trusted developer you can request the charge before delivery. Sure it's their risk but it's also their decision to work with you.
fair
Obviously you have to be ready to fix bugs/make slight adjustments if it isn't as requested after you delivered it. But that's what makes you the trusted developer
Yo, quick question. I have a plugin with generators. Basically, it saves their generators to a file, loads on join, and unloads on leave. The problem is if a player spam joins the server the file bugs, and ends up deleting all their stuff. How would i fix this?
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
You can't spam join a server
there is always a disconnect between joins
No code can't help further
any gradlers in chat
spit
dont you dare
use a caching mechanism so you don't immediately unload it instead wait a period of time to unload which is also more ideal because it gives time to ensure a proper save as well
before i get ?ask'd anyone know why gradle shadow minimize starts to remove the entire nms dir instead of keeping all of its contents, it keeps the nms dir but doesnt keep any of its children that are accessed by reflection
minimize() {
exclude("me/epic/spigotlib/nms/**")
}
``` thats what does it, changing it to include just removes everything from the jar
Cause it doesn't handle reflection
exclude should stop it from getting removed i would have guessed
We had that issue once before with mfnalex
Do you relocate or something like it?
yeah
Hmm ill try that
ill try without relocating rq
Yeah then use the pre-relocated name
i do use those
then try the post-relocated name
even without relocating still removes nms dir
or just try both
Ugh.
At worst don't use minimize
I really don't understand why one would ever touch it
make jar smaller
adventure is huge
adding both to minimize still removes nms dir
the format is great, would love if i could replicate it without the like 2mb it takes up
At worst just use the plugin.yml libraries feature
wont work
🤨
tried that for like 3 hours for them to say "doesnt work with the libraries feature because some random method doesnt exist"
with the earliest version that is on maven central that is like a patch version off it wont work
This is why you don’t support 1.17
At worst include adventure instead of excluding your nms dir
Though at that point we are playing whack-a-mole
i hve nothing better to do so why shouldnt i go and make my own minimessage esque formatting stuff
Because I don’t trust you to make an efficient parser
gradients are gonna fucking hurt but its better than shading 2 megabytes
:p
smh
its still gonna be 14
actuallyd
do i wanna spend 4 days on this
or do i drop 1.17 support
It’s not a competing standard if it sucks
Also, does anyone happen to know how to push outputs to a passive mekanism transport pipe programatically?
Probably not but doesn't hurt to ask anyways
You can use my parser I use (it sucks)
Worlds worst color parser
https://github.com/Y2K-Media-Creations/DustChat/blob/master/src/main/java/sh/miles/dustchat/color/ColorUtility.java
after that it is all going down
Anyone knows any spigot with this events: PotionEffectExpireEvent, PotionEffectRemoveEvent, EquipmentSetEvent?
Nvm just found one
without shading adventure my end plugin jars are 50kb, with shading they are 650kb
None of those are spigot events
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
hi can i ask craftbukkit 1.7.10 help here?
you can always ask. Don;t expect an answer though
💀. But sure we can try to help. I'm just not aware what was available back then
why CreatureSpawnEvent.getEntity() returns null when player uses spawn egg?
I never used that event. I usually use the CreatureSpawnEvent for LivingEntities. Is that available in 1.7? And do you get the same result?
are you sure that that event even exists?
i messed up
ok it works now, i used incorrect event sorry :/
(SpawnEntityEvent is from worldguard)
Yeah was about to say. But EntitySpawnEvent exists
smh - discord doesn't support the new markdown logic here either
yes but not in 1.7.10
These are 1.7.10 docs
it available only for bots and webhooks think
They ought to
strange
Nah, I've used them on a different server before
it does, for some reason not on this server though
the ss is from my test server with only me and 6 bots
not sure why it doesn't work here
oh nvm
misread your msg
Discord only does stuff incrementally
is there way to get real class from CustomProjectileEntity?
when coding custom items, can i make a new class file for each item? I tried but didnt work so it might have just been my bad code
like com.hbm.entity.projectile.EntityLaserBeam
import com.ultimatest.hardcore.Hardcore;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import java.util.UUID;
public class DeathListener implements Listener {
public void onPlayerDeath(PlayerDeathEvent e){
Player p = e.getEntity().getPlayer();
UUID playerUUID = p.getUniqueId();
Hardcore.getBannedPlayers().add(playerUUID);
}
}```
lmao
this doesnt work for some reason
it doesnt add the uuid to the arraylist
@EventHandler
any possible solutions
Also I wouldn't recommend you use single letter variable names
whatever readability argument you may have doesn't matter
here is something wrong
public void onPlayerDeath(PlayerDeathEvent event) {
Player player = event.getPlayer();
UUID playerId = player.getUniqueId();
// whatever
}
e
lol
lmao
getItem can return a null value
chill guys
The armorstand probably does not have anything on the head slot
welp fun time is over
oh god JAVA
rip
is it resource heavy to have each CommandExcutor also registered as an EventListener? i mean it would only put load @ onLoad right as i still need to hook the actual functions with the @EventHandler annotion right?
the purpose is to have events that are tied to a specific command are sorted better. e.g i have a plugin that manages ranks and permissions, adds a scoreboard team to the player for a prefix and then i want to hook a PlayerChatEvent to reformat the player chat
Hello! I am thinking moving from maven to gradle.. witch one is better?
maven op
for me...
don't believe the lies
certain bukkit versions may have the @NotNull
but it's still good to sanity check
Maven has more users (therefore you get help easier), gradle has less boilerplate - in the end it's personal preference
its nullable so reverse your test
fax
I am trying to shade all of the dependencies, but its not working for intellij idea (its working but I am dumb xd)
if generateRed().isSimilar(...```
personal preference
No, commands have a given syntax so there's the CommandExecutor interface
Should I reflect command map or still use CommandExecutor?
There are tons of events including custom ones which is why there's the Listener empty interface + @EventHandler for telling the code to detect your method and handle it
we love command maps for easy api’s
CommandExecutor is pretty low-effort
yea and also the EventListener interface. so i presume no its not resource heavy?
I'd only access the command map if I'd need to register custom commands with tab completion
by ur answrr
EventListener is a java interface
and it's just a tag
The process of parsing a class and mapping out event handlers is a bit heavy
It's much easier and effective to associate an interface and call the methods
I hate @fresh templetHandler :D
Instead of looping through the class' method and associating certain methods with certain events
Anyways gtg fr now
thanks discord for pinging someone
Hello, i have protocol questions
ClientboundPlayerInfoUpdatePacket.Action.REMOVE_PLAYER does not exist
ok ((CraftEntity) event.getEntity()).getHandle() works
how does the attack() method in spigot 1.15.2+ work?
or UPDATE_LISTED
nvm i found it in the craftbukkit source
I can't figure out what's the problem
did you guys patched the string dupe thing?
was it reported on jira
Hi im having an issues,
Math.round(iconsPage.size() / size);
the number for the division return 3.1111111...
but the math.round round it to 3 and not 4 so some item gets substituted, any solution for this?
round up? Math.ceil
math.ceil return a double and i need a int
cast it lol
or integer.parseInt
hi!
:3
oh, I solved it, I got error where ArmorStand is null
How can I compare entities?
if it equals
it always gives null
okay, wait
https://paste.md-5.net/zoyapiboce.cs - Data Class
https://paste.md-5.net/cunemohuwi.java - open GUI after clicking on Entity
https://paste.md-5.net/vexufeveyu.cpp - create Furnace Class
https://paste.md-5.net/iqinipokal.java - HeldEvent, if in player hand item, create and move armor stand
https://paste.md-5.net/edufowazav.java - if player clicked - create Furnance
that is my error now)
Okay, I'll try now. I just don’t understand why, if stand is stored in this object
Well, in general, the problem is not only this, it simply cannot compare entities, I will fix it now.
You should create area triggers which use spigots BoundingBox to define its bounds.
It already has methods to determine if a Location is inside the Box.
so i should use playermoveevent?
freejavalessons is back
You can use the PlayerMoveEvent.
However you need to be particularly thoughtful with it because it can get fired hundreds
if not thousands of times per second.
no , like this when a + y tell to the player "You Are +y" , is just example
you can not tell the player to move
i mean, you can ask him with message
but not force the player object to start moving
you can teleport him or use velocity to punch him to the direction you need
so my work is not possible ?
.
idk
what are you trying to achive
make player walk like NPC to the goal location?
not matter , i try with playermoveevent if is not worked is not problem so thanks for everyone for help
i'm currently trying to implement a sort of rocket launcher ability into my minigame, but the recoil is not working as intended. The pitch should change by a few degrees, and the way i've achieved that effect is by using https://www.spigotmc.org/threads/teleport-player-smoothly.317416/ which works nicely, but has the same issue if the player is moving, if they are moving or jumping, the teleport will not retain their velocity in a smooth way.
Is there any easy way to modify the direction they are looking without causing this
i also realised after that that resource is for a slightly different purpose so i might be doing things wrong
i just want to apply some sort of upward push on their yaw
You just want to create a pull up after someone shot a weapon but you need this pull up to be
done over several ticks?
it should happen relatively quickly, so like over the course of a few ticks
i previously wanted to give some sort of like
camera velocity
if that makes any sense
yeah and the only way i've found to modify someone's yaw is by setting it to a static value at a certain time, which makes it look overall jittery and the player physically stops moving whilst being teleported
public void interpolatedPullUp(Player player, double degrees, int ticks) {
double degreesPerTick = degrees / ticks;
BukkitScheduler scheduler = Bukkit.getScheduler();
for(int i = 0; i < ticks; i++) {
scheduler.runTaskLater(this, () -> pullUp(player, degreesPerTick), i); // "this" needs to be your plugin ofc
}
}
private void pullUp(Player player, double degrees) {
Location eyeLoc = player.getEyeLocation();
player.setRotation(eyeLoc.getYaw(), (float) (eyeLoc.getPitch() + degrees));
}
Try this and tell me the result.
ok so i have it on 2 degrees and it's flinging my camera around 45 degrees
not sure why i can't see a logic error
testing again without a scheduler
Try to calculate it to radians first...
private void pullUp(Player player, double degrees) {
Location eyeLoc = player.getEyeLocation();
float radians = (float) Math.toRadians(degrees);
player.setRotation(eyeLoc.getYaw(), eyeLoc.getPitch() + radians);
}
oh ill try that too
thanks 👍
getting this error
Player name = Bukkit.getPlayer((e.getCurrentItem().getItemMeta()).getDisplayName());
UUID uuid = name.getUniqueId();```
anyone willing to help pls;-;
lol
no clue why the pitch changed tho, might be that the eye location is stored from where the player previously was
"org.bukkit.entity.Player.getUniqueId()" because "name" is null
Your exception pretty much gives you the problem on a silver platter
ik
wait what
i saw that on the first glance
but i need solution
how can i make it so that it doesnt return null
it returns some data
Check if the player that was returned by Bukkit.getPlayer(...) is null
pitch is up/down
Thats what you wanted to change, right?
then
yeah it is but its not changing that, when i strafe or fly around its just making me look in all sorts of directoins
up down, left right, sometimes a 180 degree spin
tHeN
private void pullUp(Player player, double degrees) {
Location eyeLoc = player.getEyeLocation();
float radians = (float) Math.toRadians(degrees);
float yaw = (float) Math.toRadians(eyeLoc.getYaw());
player.setRotation(yaw, eyeLoc.getPitch() + radians);
}
Probably need to translate the yaw to radians as well?
hm it works when i stand still but whenever i move my camera goes flying
There is no then.
If the methods returns null the player is not on the server.
oh
nvm u aren't meant to convert either
k
ill do more testing
what if the player is on the server and it returns null
(thats what happened in the earlier error and code)
Then you have a broken version of Spigot.
Which is 99.9% not the case.
well
its happenin
Its not
Print out the displayname.
aight
Make sure to strip any colors
i mean it still shouldnt return null
even if there are colors
it should return smth
What should it return then
Why would it?
this is what came in console
when i printed the name
any thoughts bout it?
no thoughts?
i thought it meant the absence of something lol
Well yes
nice
But null is a keyword so its technically something
If you strip color from null then the result doesnt change.
You are simply checking an item which has no name.
how tf ur players returning null
no idea
Thats not the problem
We already identified the problem
spit it out
ItemMeta#getDisplayName() returns null -> The item you are checking has no name
ahhh i love opensource github projects, got my code on a nice big spoon
but how tf does it return null
why is it nameless
Because it has no name
if the player is in server
technically it should
What does player have to do with display name being null
What do you mean?
Did you add the players name on the ItemStack?
lemme check
hello, how add enderchest inventory player in menu?
kinda
should i try removing it
declaration: package: org.bukkit.entity, interface: HumanEntity
should i
You didnt even set the name on it. There is nothing to remove.
Add the players UUID in the Persistent Data Container of the ItemStack when opening the GUI.
Then on click you get the UUID from the PDC again and get the player of that UUID.
idk anything bout pdc
?pdc
we all know coll
can someone help me with this? ive posted a question yesterday and no one answered
unsafe location
probably
check your other plugins
they will mostly likely listen for unsafe teleports and teleport to the nearest safe location, maybe like essentials or something
It probably searches for a safe location to teleport
Hi , how to get player postion ?
player#getLocation
Player#getLocation()
sorry
but i set the blocks below and above the player to air, so it is safe
can you maybe force it?
Does it occur without other plugins
Might be from other plugins (essentials for example)
Try setting more blocks to air before teleporting
Can I do this?
No
Yes
?
mhm
so can you like force teleport them?
bruh i dont have esentrals
@sacred mountain
hmm
Only if no other plugins intervene. But generally you should be able to
teleport a player wherever.
i suggest you just look through the config files
but it would maybe only be bor bedrock players
theres not too many plugins there
yea, also the y choordinate is correct
so its not that
its a weird bug and i need it fixed rq
Try tping on a clean server. No other plugins.
Hi, two weeks i try to make one simple plugin, why did'nt work, i cant see any errors, just didnt work - https://pastebin.com/2UT8wiUU
you did not register the listener
it is quite possible the y is the same
public final class ObBlocker extends JavaPlugin implements Listener { i do
if the y does not change to the next whole number
it still points to the same block
so y 1.5 is still the same as y being 1.75
no you still have to register it.
PluginManager pm = this.getServer().getPluginManager();
pm.registerEvents(this, this);
inside onEnable() ?
yes
@serene sigil when it comes to teleporting and changing blocks it is generally best to not use floats as well and instead just integers
do the teleport 1 tick later. your block changes are not likely reflected in the world in the same tick.
that is also possible as well
also add 0.5 to both x and z coords you tp the player to
you are teleporting the very corner of a block
or just use ints....
ints would also be a block corner
0.5 is no guarantee to get the next whole number as they are using a range
or even the middle
they don't want a whole number in the teleport location, they want center of the block
you don't need the center, whole number works best but again they are using a range
ah you mean in the random? yes use ints for the randoms
but add 0.5 to x and z for the teleport location
spigot support thunder on a block event?
declaration: package: org.bukkit.event.weather, class: LightningStrikeEvent
ok ill try
like this?
yes, but use variable so you are not creating so many objects
you can use just runTask
it tries to do it the next tick
same but the y is 101 cuz thats the topest block
i need the objects
gtg for 10 min
brb
I mean multiple location objects
you only need 1
I don;t believe you are using spigot as it only alters the tp destination when using a portal
I was wondering, does anyone got a tiny tutorial on a custom command system, I'm working on an annotation based command api and I'm not sure how to fully register the commands
With the tab complete and stuff
command map
Yeah, but like how would I register each since each method would be their own arg, or should I just make it all 1 method ?
I wanna make it as readable as possible
depends on what you're looking for
basically you'd need to make 1 command class per "base" command and handle args manually
For example, my simplecommand system just has identifiers like command.whatever.* which is then converted to /command whatever <whatever>
Before reinventing the wheel: Does someone have some code which linearly interpolates the direction between two bukkit vectors?
(Within N steps)
Nvm i just realised that i dont need quaternion fkery for this.
I can simply interpolate each pitch and yaw for that.
surely it's just the application of a unit vector anyway
oh no origin
you are literally talking about just vectors
TotemUseEvent
Sorry bro😂
ok, then Player#getInventory. It has methods for set armor slots
you get an instance of that player
EntityRessurectEvent @quaint mantle
yeah
mhm
you enable legacy support, breaks a lot with the material enum
Also makes so it takes ages for the server to start up
Can add like a good minute to the startup time
damager is a block not a Material
bush.getType()
no
if (bush.getType() == Material...
does Entity#getLocation return a copy?
guys is there a way to cancel default mechanics like genericmovementspeed attribute modifiers when crouching or in powder snow
it says
not for me lol
even though it's a player as well lmao
whatever
i am tho
its possible it's changed in MC however unlikely. Hollow out a larget area to be certain
You could always tp into a block so I don;t belive anything has changed
im using 1.16.5
thats valid code but not valid logic
think about it
you're comparing the entity object to it's type
its never gonna equal that
you gotta call .getType() and compare that
then no MC definitely does not alter your TP unless it's through a portal block
its weird
try removing all ur other plugins add them back one by one
you have like 6 its not gonna take a long time
i am literally teleporting to that cord (even making room for the player) and it still wont work
my plugin
give the players head sky view
yeah
bruh then whats the problem
do it again
it'll work again
🤯
nevermind
probs your .equals on the string
try killer instanceof Player
and servant instanceof WitherSkeleton
HOWEVER, i found out something... so, basically ive made a 100x100x100"cube" that is made out of 10% air and 90% stone; one time i tped and it did work, so that would mean that the air was pre-generated and so it worked because there was space for the player
is your plugin the only one on the sevrer
because this narrows it down if it is
no, there is these:
as i said, restart without all of them
the last is mine
and if it works then add them back one by one
till it stops working
and then you know the plugin that's causing the issue
if it still happens on vanilla theres something in your code that you gotta figure out
im never calling it anything else
calling what
gayser
lmfao
gyser
real
it's how way to main class looks?
what does that mean
you sent a picture of your plugin yml
What's the classifier
structure is on the left
For nms spigot mappings
nothing
👍
just import spigot instead of spigot api and you have it
Uhhhh
fuck
its gayser
??
Lets say there's a code with 1.17 spigot nms
now it works lmao
so whats wrong with your plugin bro
And I want to just change to 1.19 using the same
u havent sent anything useful at all
Or is there a way I can run 1.17 spigot-map in 1.19
@sacred mountain what should i do??
If I have an entity and teleport it to a player in the PlayerMoveEvent it seems as if the entity is moved in front of the player, why is that?
can u just send the error
your error is in KoTHPlugin.java
@sacred mountain whaz should i do?
sadly you do
it should have the structure
src
- main
-- java
--- me.blahblah - resources
-- plugin.yml
check geyser config for settings on teleportation
i told you to check config files earlier
Entity teleportation issues
with spigot you cant iirc
Or send PlayerMovePacket.
Custom Biome Distribution using vanilla chunk generation
you need the structure i sent above.
copy that and it will work
i dont know how you have so many folders and so much code without once being able to run your plugin
copy this
?paste
look at my beautiful dumpster code i stole
i got no idea what it does
https://paste.md-5.net/xonuwufima.cs
cant really find anything
ima ask in gayser dc
but it have to wait for 10 min to send a message 😩
what is that bro
public Error 😭
thats a cursed method
what does it do
Does it even compile?
i'm definitely missing a couple variables
and the brackets arent even right
so like ion know hwere you got it from
no...
look at the image i sent you
please
pls is there anyone that knows how to update a plugin to 1.19.4 pls if you know dm me
Hello, currently I use mojang mappings for some plugins.
But sometimes I have to shade some dependencies inside the jar, but I really don't know how to do this here:
https://pastebin.com/TPvTTZ0u
Any ideas?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
src
-> main
---> java
-----> me.natty
---> resources
-----> plugin.yml
please look at it
i dont know how more obvious i can make it
What is the source version of the plugin`
1.13
you can't put your resources in the code section you have to always follow that structure
Oh should be easy then. Give me the source and I'll see what I can do
unless it's fully nms
can i dm you?
then itll be a pain in the ass
Yea
good job
sorry
yeah thatll work
put your plugin yml
in your resources
yes.?
yes.
getDataFolder() or whatever the method is
will return that resources folder
if you're using default yml config that is
yep
now just change plugin yml to match the class directory
for your main class
nvm you dont need to
keep that how it is
should be
main: me.matty.KoTHPlugin
i'm wondering if it is a tree algorithm
the self referencing variables are a bit odd
the rs object has an r field
theres some other variable nrLeaves
and the r and rs objects both have a field called nrLeaves
rs has a field called r that is an integer object
why are you naming stuff var for
r has a field called fnleaves that has another field called r AGAIN
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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
looks like some decompiled stuff lmao
still needs to learn java if they keep trying to check if something equals something that it never will be
that is a programmer issue
int a = 5;
int b = 7;
while (!a.equals(b)) {
System.out.println("A is not B");
} else {
System.out.println("A is B");
}
real
probably written by an AI there can't code
doesnt work
int doesnt have a equals method
like these cursed moments
all of these suck except for sololearn and maybe oracle
🎟️
idk about programmingbydoing but theres a 12 hour video on youtube that goes over everything
It returns your plugin folder inside of plugins
You can really get smth inside of your jar as File
i didnt find anything, can you help me? ive already made a post on the gayser dc
I've wasted two by mistake :c
does anyone know the name of the block break animation packet in nms for 1.19.4?
it does? sorry haven't done minecraft related stuff in a ahilwe
Why would it return the resources dir?
Especially if the plugin is installed on a different computer it is hard to figure out
yeah dunno mb
is there any conversion docs
anywhere
can't find anything
need an easy way to get a minecraft generic movement speed value from a m/s value
a minecraft block is 1 mtr cubed
send the error...
telling me it doesnt work is like the least helpful thing u can do
jar does not contain plugin.yml?
well thats interesting ,
does anyone know the name of the block break animation packet in nms for 1.19.4?
packet ID is 0x07
the java name you can google
what?
ok erm
why do you want teh block break animation packet? you can use teh Spigot API and send a block break anim
right ok and how exactly do you expect to use placeholderapi and more stuff without even the spigot api
do you have ur dependenceies
without maven
already
bruh
is this your plugin
because it seems like you just decompiled something and copy pasted it into a directory and tried to open it with an IDE
bruh
consider learning the basics of plugin making first
because it looks like you just want a plugin and are trying to just bash the code in a folder as quick as possible
at least learn how to import and structure the project properly
yeah that really isnt my problem i've already said what you need to do
learn how a plugin is structured and how to import your dependencies with maven
spigot have a whole tutorial on that i think
Can anyone review my code : )
if it's simple enough i'll help
with that attitude it wont work
go learn how to make it work
import your dependencies
Check dms
what is the nms packet name though?
ClientboundBlockDestructionPacket
thank you i have been looking for this for a while
btw spigot has an api for this
it's protocollib isn't it?
THc?
protocollib makes things easier but like i think spigot has methods for that
i did it without nms before i remember
How do I add custom textures to custom custom items
By using a resourcepack
But how do I apply it to a custom item
setCustomModelData() i think
requires an integer of up to 7 digits
can't start with 0
listen, as much as i want to help ur just asking me to do it for you basically, just go learn how to create a default project, and if you want to copy all the github code into ur project, do it after you have a working structure
Item models allow predicates. A predicate defines when a model should be applied to an item.
Example:
{
"parent": "item/generated",
"textures": {
"layer0": "item/iron_ingot"
},
"overrides": [
{"predicate": {"custom_model_data":1234567}, "model": "item/gold_ingot"},
{"predicate": {"custom_model_data":1234567}, "model": "item/custom_ingot"}
]
}
me waiting for the day they add predicates for overlays
overlays?
imagine custom overlays for pumpkin head model data
the possibilities
of guis, interfaces
etc
I mean you can already do some nice gui stuff by using some other magic.
But native support would be nice ofc
gib
is there some texture that extends over the gui border
to make it look like theres nothing there
or is that a mod
This is all vanilla
nah what please
can u show me anything
how do you do the blank slots
wtf
what magic is this
how is that vanilla
I mean you need a resourcepack ofc
well yes but
i'm guessing the whole backpack including icons is a gui animation
can u make custom textures depending on gui
is this a tolerable wrapper? ```java
public static void registerCommand(@NonNull JavaPlugin plugin, @NonNull String command, @NonNull CommandExecutor executor)
{
plugin.getCommand(command).setExecutor(executor);
if (executor instanceof Listener)
{
plugin.getServer().getPluginManager().registerEvents((Listener)executor, plugin);
}
}
yea
what
this is great and all for developers
didnt mean the nah
as long as you can draw lmao
i was tryna type somewhere else
yea to which xD
its fine theres nothing wrong with it i dont think
kk
i would just put it in the main class and just use 'this'
because you wont need that anywhere else
unless you're registering during runtime
which isn't exactly something i think ur meant to do
public class Utility
{
public static void registerCommand(@NonNull JavaPlugin plugin, @NonNull String command, @NonNull CommandExecutor executor)
{
plugin.getCommand(command).setExecutor(executor);
if (executor instanceof Listener)
{
plugin.getServer().getPluginManager().registerEvents((Listener)executor, plugin);
}
}
}
If your CommandExecutor is a Listener then you are doing something seriously wrong
public class CommandRank implements CommandExecutor, TabCompleter, Listener
{
@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event)
{
Bukkit.broadcastMessage("On Player Chat!");
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings)
{
Bukkit.broadcastMessage("On Command!");
return false;
}
@Override
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings)
{
Bukkit.broadcastMessage("On Tab Complete");
return null;
}
}
like that?
oops
wait
is commandexecutor
an interface
ya
You dont want to let your CommandExecutor also be a Listener
i would just register them individually and seperate them
how so?
theres no point making a custom class
Everything inherits from Object
just add a commands package and a listeners package idk
Single responsibility principle and separation of concerns.
You dont want a class to have multiple primary goals.
so if i have a feature that say manages permissions as im writing my own system, and this feature also needs to say monitor the player chat to reformat it, how would i seperate these properly?
im currently just trying to get everything set up before i start working on it
Create a manager class which manages your data and pass it to your Listener
Let me show you an example from a plugin of mine
This is the listener which drives my whole GUI library.
This class has only one goal: Listen for events and pass them to places where they are needed
so i create 2 classes and have them interact with each other
?
and register them independently
Yes. Usually you start with the logic in one class (your manager) without knowing from where it will be triggered.
Let me give you a concrete example.
and the utility function would look like this i presume
public static void registerCommand(@NonNull JavaPlugin plugin, @NonNull String command, @NonNull CommandExecutor executor, @Nullable Listener listener)
{
plugin.getCommand(command).setExecutor(executor);
if (listener != null)
{
plugin.getServer().getPluginManager().registerEvents((Listener)executor, plugin);
}
}
what are you doing here?
im doing trying to figure how im supposed to organize my source code for spigot
are you tryna do a GUI system?
hello! I want to move armorstands related to the player's direction. How do I calculate the correct x/z-direction based on the player direction + left/right?
Imagine you want to track blocks (simple example)
public class BlockDataManager {
private final Set<Block> trackedBlocks = new HashSet<>();
public void addTrackedBlock(Block block) {
trackedBlocks.add(block);
}
public void removeTrackedBlock(Block block) {
trackedBlocks.remove(block);
}
}
First thing you do is implement logic to track blocks.
You dont know the trigger (and you also shouldnt need to know it)
Now we decide: Placed blocks are tracked and brocken blocks are untracked
public class BlockTrackListener implements Listener {
private final BlockDataManager dataManager;
public BlockTrackListener(BlockDataManager dataManager) {
this.dataManager = dataManager;
}
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
dataManager.removeTrackedBlock(event.getBlock());
}
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
dataManager.addTrackedBlock(event.getBlock());
}
}
But later on we decide: I want to manually add tracked blocks through a command:
public class BlockCommand implements CommandExecutor {
private final BlockDataManager dataManager;
public BlockCommand(BlockDataManager dataManager) {
this.dataManager = dataManager;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!(sender instanceof Player player)) {
return true;
}
Block block = player.getTargetBlockExact(32);
dataManager.addTrackedBlock(block);
return true;
}
}
Then we can simply reuse the manager and track blocks manually by implementing a command which calls the managers methods
The same goes for when you want to expose an api for other plugins to track blocks in your plugin.
All you need to do is give them the BlockDataManager and boom, they can track blocks with their plugin
right so i create 3 classes for my example, one manager, one command class and one listener class which both hold a reference to the same manager
Right
and per javas way of handling things only when both class instances are GC'd the manager instance will get GC'd
The manager class implements the core logic.
Listeners and Commands are only used to trigger core logic. Not to implement too much logic themselves.
i.e when the plugin is unloaded
so basicly I want to know if I need to rotate x, x-, z or z- based on the direction
math
wow
xD idk man i forgot how to calculate the arc
xD
Vector playerDirection = player.getEyeLocation().getDirection();
or a wrapper that already does it for u
🤣
What do you want to move?
basicly a coordinate
if the player is for example looking into the Direction North, Left is z-(not really like that, just an example)
and Right would be z+
Location oldCoord = ...;
Vector playerDirection = player.getEyeLocation().getDirection();
Location newCoord = oldCoord.clone().add(playerDirection);
I do not want to use the actual direction, I want left/right of it
Or
Location oldCoord = ...;
double distance = ...;
Vector playerDirection = player.getEyeLocation().getDirection();
Location newCoord = oldCoord.clone().add(playerDirection.multiply(distance));
Vector playerDirection = player.getEyeLocation().getDirection();
Vector right = playerDirection.clone().rotateAroundZ(Math.PI / 2); // Rot +90°
Vector left = playerDirection.clone().rotateAroundZ(Math.PI / -2); // Rot -90°
Particles only spawn once and then disappear.
So you would schedule a repeated task which constantly spawns particles at the entities location.
then I have the vector, and add that Vector to the location? *blockamount
Yes. But you should multiply the vector by maybe 0.01 or else it will result in very big jumps.
ur drawing skills are amazing
i understood that x y z
and left = x- and right = x+
also a random p?
well the thing is that that will put out some weird stuff if you are looking in like a 40deg angle. It should kind of lock on the direction until it is like over 45deg
P=Player
yeah its the only subject I had a 4 at in school lol
yes
Italy is like 2h away from me
You need to calculate a vector from your feet towards the entities
and then slowly traverse it in N steps. After that you spawn particles
on each step until you reach the target.
A vector C from A to B is calculated using
C = B - A
Then clamp it to the nearest 45°
@lost matrix so just to see if i got it first my manager ```java
public class ManagerRank
{
public ManagerRank()
{
}
public void foo(@NonNull String str)
{
Bukkit.broadcastMessage(str);
}
}
then my command executorjava
public class CommandRank implements CommandExecutor, TabCompleter
{
private final ManagerRank m_manager;
public CommandRank(ManagerRank manager)
{
this.m_manager = manager;
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings)
{
m_manager.foo("On Command!");
return false;
}
@Override
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings)
{
m_manager.foo("On Tab Complete");
return null;
}
}
and then my event listenerjava
public class ListenerRank implements Listener
{
private final ManagerRank m_manager;
public ListenerRank(ManagerRank manager)
{
this.m_manager = manager;
}
@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event)
{
m_manager.foo("On Player Chat!");
}
}
france? switzerland? austria? slovenia? croatia? 2 hours away from algeria?
Italy is 140km away
Germany
guten tag together we make the bad guys killing palestinians evaporate
xD
- Naming conventions:
ManagerRank=>RankManager
m_manager=>rankManager
Other than that it looks right.
how would I do that?
Managers usually have mapped data in them.
For example you could have
private final Map<UUID, Rank> rankMap = new HashMap<>();
Which maps every players ID to a Rank.
Rank could be an enum like
public enum Rank {
USER,
VIP,
MODERATOR,
ADMIN
}
I do only have a direction and a vector in this example
You should be able to figure out how to clamp a value to the nearest Nth part.
Hint: You only need to check the yaw and clamp it to the nearest value in [0, 360] {45}
alright then
am i the only one that likes diarreha in here
Anyone knows how to turn in ChatColor this $ idk symbol to &?
actually rank creation will be performed at runtime
ill keep it as modular as possible
how to use it propeyly
Then Rank needs to be a class ofc
ill also disable the /op and /deop command and instead tie an attribute to the rank whether or not the bearer should have op
String coloredText = "&cThis is red";
String translated = ChatColor.translateAlternateColorCodes('&', coloredText);
But you can use any symbol you want
String coloredText = "~cThis is red";
String translated = ChatColor.translateAlternateColorCodes('~', coloredText);
Kinda weird, not gonna lie
:(
thanks
also id be ideal to have the prefix be displayed above the players head without having to use the scoreboard but i presume ill need to use packages to update the clients then.
thats something ill tackle later though
Im currently mounting players with TextDisplay entities via packets.
Its kind of tricky but you are no longer bound to limitations like name length.
Example for this
xD
then id still need to disable a players name though
which still requires packets
Mounting an entity hides its name automatically.
hmmm
Broo thats like in bedrock.
But yeah naming through scoreboard teams might be more reliable
Is a custom model id possible for a block? And if so would it persist if I were to place it and then rejoin the game?
nope
Is it possible to implement custom blocks with spigot?
btw @lost matrix im gonna make my plugin dependent on a .dll / .so, can i if the file is not found disable the plugin like this? ```java
@Override
public void onEnable()
{
if (!IniParser.Initialize("../libraries/")) this.setEnabled(false);
INIPARSER_MSG msg = new INIPARSER_MSG();
try (IniParser parser = new IniParser(msg))
{
if (msg.m_msg == INIPARSER_ERROR)
{
throw new NullPointerException("Failed to allocate memory for IniParser");
}
//...
}
catch (Exception e)
{
//...
}
ManagerRank rank = new ManagerRank();
Utility.registerCommand(this, "rank", new CommandRank(rank), new ListenerRank(rank));
}
wait theres something wrong. I gotta clamp the Vector, not the Angle?
so the direction fits to the right angle
I gotta round the vector I guess
guys what units is setWalkSpeed() in
because the genericmovementspeed attribute default is 0.10000...f and the base walkspeed is 0.2f
the spigot one is in the range -1 to 1 but from what m/s values
Could you please not call your classes in full caps
In java it is common to call classes e.g. IniParserMessage, with terms generally being fully spelled out
its coming from something else which is still work in progress
o ok
sec
https://hastebin.com/share/bujejutoku.cpp @warm mica
too many projects at once xD
Until you set billboard to center and it goes WEEEEEEEEEEEEEEEEEEEEEEEEEE
you import into IDE then the IDE will have a convert option
or you write teh pom manually before importing
No clue using InteliJ
how come every time I put my main constructor in another class I get an illegal argument exception because it's already initialized. I am trying to get a variable and config file should I just move that out of the main class and put it in another?
- You can only have 1 main constructor
- Spigot calls a plugin's onEnable on load, not main
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
is there way to get text item id from itemstack?
it not in 1.7.10
Lol
💀
Good luck

