#help-development
1 messages Ā· Page 997 of 1
But I swear I have never had a doctor do anything but give me a diagnoses
That may not be true, the head injury I wasn't even awake for a couple days so who knows about that one... I do however have another story where the doctor just came in and said "glue" if you can guess where that is going
There was no work needed to be done, stitches, surgery, etc... I was just put into a medically induced, and woke up couple days later
So for all my medical experiences, I've only had a doctor tell me what the problem is and nothing else lol
I think the issue is that I always try to yap when I wake up and end up saying stupid shit š¦
nurses do, do a lot of work, but operations and such are usually left up to the doctors.
Oh yeah I knew that, like I said I think I just say shit in a rather stupid way
But then again, I've never had an experience where the doctor really did anything
Damnit I filled the chat with my issues again D:, pretty please if you'd be so kind ā¤ļø
?
Take a look at the way I get rid of the display entity in that class
I cache all my active entities, when they are done doing what I want, then they simply get removed from mem and despawned
My point being, instead of using an event to handle the cleanup, you should have cleanup implemented yourself
^ not in all cases, but in this particular one I think 160k display entities has something to do with not handling the ones you dont need anymore :p
ah
so i basically cache all text displays and respawn them if they aint alive
also does Entity#isAlive return false if the entity's chunk is unloaded
If you NEED to keep them spawned
i NEED
Then keep in mem sure
and i want a good answer
We all do D:
i cant even find the 160k display entities
We figured out these were your entities?
I meant are the 160k entities coming from your plugin?
If so then you've gotta do something about the cleanup, and also with the caching, you should be able to keep new entities from spawning given you're only keeping track of your display entities... as to not let 160k random ones get spawned
kek
help
You could write a quick patch plugin that removes all entities in that chunk
gg
i need em tho but ok
how would i even get the entities there
i spent forever spawning all of them, i shouldnt kill all text display i should only kill the ones at that chunk
Your plugin shoudl spawn them as needed. you shoudl not be relying on them staying alive
i manually spawned them tho
Each hologram from that plugin is only alive for about 3 seconds
my plugin stops them from dying
Then it's removed forever
?
you can spawn them again when the chunk loads
on 160k entities?
That's the beauty of code
:-:
if persistence is false they don;t get saved so are removed when teh chunk unloads
im just gonna yoink all entities in that chunk
wait is a text display a tile entity or an entity
entity
or use the /kill command
yall should be jealous from how unlaggy my server is
You've got me beat by 20,000 ms
best thing about windows is that it reports your application as frozen, even though its simply blocking the main thread (ik this is an issue on mc)
well ye how else would it differentiate
#gptApplicationFreezingModel
minecraft:kill @e[type=text_display]?
why do all ai models respond with "oh sorry youre indeed right " when you ask for extra details on an issue?
Don't take this the wrong way because I mean no harm by it:
?tas
cough
/tp @e ~ ~ ~
Nice
i should make a hologram system
The system I've got for that damage holograms plugin might help
essential suffers killing just afew entities and minecraft killed 164k entities in like 10 seconds
I'm trying to reach that level of optimizations D:
whats the best GUI api rn?
whats the most popular ones
idk
What is the best programming language?
C# is the pest of all languages
welcome to C, the safest programming language ever
icba making a hologram plugin, does dh support text displays
Welcome to python, the fastest language ever
I mean... they're not that bad man
they aint but if it bugs im screwed
i have one but it uses armor stands and buggy af
Can we gather some hate for JS?
i wish display entities were living entities like armor stands
just cancel death event and it never dies
fuck JS
I mean thereās no best gui api rn
I don't think a text display can ever die if you set persistence to true... unless you remove it yourself
imagine having dynamic variable types like js, fuck js
i dont trust myself
interpreted language, pathetic
how do I load in a building asynchronously?
how do u load in a building?
i have a hashmap with all the blocks and locations
use scheduler for async stuff
Why not use world edit
You can't place blocks async. There are some hacks to place blocks faster though. But you should still split it into a task if it's too many
fair enough i guess
Then you can do it sync, that's np
you could do stage building system, where it builds in stages
just loop
That'll help performance
yeah but heres the problem
i want to place that building at different locations right
so how do i save the locations correctly
i cant just save the current loc
uh
did i explain that correctly?
If your locations need to be persistent then prolly flat file
like all the block locations are relative to the current location
You could just save it in mem but that introduces the risk of server crashes and what that entails for your plugin
Stage building could also be expanded to support these kinda things, ie: server crashes but your plugin saved the stage it was on, when it comes back up resumes from it's stage
then don't store the location but just the offset
and calculate it by using the current location + offset
how do i save offsets
Well define save
Should it only be saved for that process? Or is it a location you'll be reusing? If it needs to be persistent then I'd say just put it in a flat file and grab it whenever you need
Otherwise you could just save the offset in memory
Rather caching in mem*
Hmm
I wonder if you could define your structure / building with an offset and just store that, rather than the individual offsets of each block
idk man its too late rn either way so im probably gonna head out
No worries man haha
bump š
Got any metrics?
I do not, I'm quite sure it's related to the temperature system however (the radius calculations for heat sources)
I'm sorta in the middle of switching to even based temp updates (anytime the temp should change is when the event will be called)
does Entity#isAlive return false if the chunk is unloaded?
if it's not persistent
.
I'd assume they would if its true
I'm not 100% sure but I feel like the issue comes from these functions
hologram system or caching all text displays?
I feel like you'd be doing both, in the sense that you dont want all text displays cached with your plugin
Ie: your system handles your holograms
i don't want text displays dying at all (unless they aren't persistent) in my server so it doesn't make sense to make a hologram system if basically all text displays in my server are holograms
I just meant in the sense if other plugins use text displays you might run into issues by caching all of them
i can add an identifier in the PDC or smth to identify unkillable text displays
Ig it depends how many holograms you want active at any given time
like 7
Point is include a method that can handle the cleanup either individually or in bulk
ie: removeTextDisplays method
can someone tell me what im doing wrong 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.
just set them to not persist, then spawn them in the chunk load event. You don;t have to bother about tracking or removing them
are they stationary?
i dont trust myself with /kill
i might do /killall all for any reason
spawn them, setPersistent(false) and do nothing else
oh
When the chunk is derenderd, the holograms are automatically despawned
if you want to kep them there if a player returns you can track the chunk you spawned them in and respawn on chunk load
i would do that if i want to make a hologram system
Why not just do it the first way you said, the function will still recreate them on chunk load so this just seems like extra work
what kind of concurrency is introduced to solve minecraft's single threaded nature in spigot API?
Doesnāt exist
Nor will be in the future
oh, so schedulers are really more of an illusion?
Schedulers are corutines
Async scheduler canāt even do spigot api
Schedulers in spigot api are not coroutines
the game has its own clock just, we can shove runnables into some queue where we specify delay and interval for when the game clock should run our specific runnable, there is also some multithreaded stuff (like actual multithreading where memory visibility and synchronization becomes important)
I'm just worried that I might overhead the game with schedulers too much when doing things like damage over time or cooldowns and such
You can always keep a global scheduler for that
eh I dont think you need to care too much abt it, unless u actually experience lag, or have a reasonable functional requirement to adhere by
But honestly the game is already doing a ton of work each tick, a little more probably won't make a huge difference
yeah and in worst case scenario, u may wna implement some work distribution algorithm that can split x amount of work into several ticks
that is the right mindset
people like to make everything asynchronous
and just cause they don't see any results in TPS (duh)
they think everything's fine
XD
it's like shoving the dirt under the rug
it's still there
Can anybody hear listen to touch tone dialing and tell me what is the number
wdym by "wrong", whats not working?
how possible is it to make the pattern on a shield an image
I need a plugin that when the card is inserted in the ATM, the bank account can be opened and only then, can someone help me? who can help me send me sms in dm
Nah banner patterns arenāt data driven yet
I have a boss which I display the health of with /boss. I save an instance of the LivingEntity by reference in the class. The issue is once the chunk unloads and a player comes back to the boss and reloads the chunks the boss is no longer the same LivingEntity instance therefore /boss will always display the health of the boss before it unloaded. How can I fix this to keep it up to date?
im not getting an error or anything it just doesnt work and was wondering if i typed it out wrong or something
Add a pdc tag to it and use the EntitiesLoadEvent
Or keep track of its uuid and use the same event
Iām using 1.8 for this project š¦
So during chunk load check if entities contains my bosses uuid and if so update the references
?
Yes
Can I spawn particles that appear only to specific player?
yep, you can use the spawnParticle method on Player
the one in World will broadcast the particles to nearby players
Hello I need someone with experience with plugins to tell me what a plugin is called just by appearance
So Player#spawnParticle will spawn it to player, but World#spawnParticle will spawn it to all players?
Hey, just a quick question for those who know the newer versions: How do I change the scale of a block display entity? Like how do I stretch it into the x Direction for example?
Yes
Edit the transformation and change the scale vector
gracias
Okay
what is it supposed to do?
Wait how do I edit the transformation?
on right click it spawns a cobweb on the players feet
Is there any better way to create on click events than invisible armor stands? I essentially want to make portal with particles and make it clickable to travel and its the only thing I can think of
playerinteractevent
nvm got it. thanks!
I was confused for a sec bc there was no .setScale but only getScale
Yeah itās mutable
All the transformation components are
are they not? I know for a fact the game does have patterns defined in json files and the registry is networked synchronised
I can't find anything in the wiki about data packs supporting that tho
this is so weird lol
Mojang is a silly goose sometimes
am stuck, trying to see when fishhook lands in lava and maintain it there in a bobbing effect, but somehow this ain't working? :|.. do I need to bounce it higher, or create a task and repeat it? assumed it would repeat itself.
@EventHandler
public void onHookBurn(EntityDamageEvent event) {
Entity entity = event.getEntity();
if(event.getCause() == EntityDamageEvent.DamageCause.LAVA) {
testProject.getLogger().info("EntityDamageEvent fired");
if (entity instanceof TextDisplay display) {
if (display.isInsideVehicle() && display.getVehicle() instanceof FishHook fishHook) {
event.setCancelled(true);
fishHook.setFireTicks(0);
fishHook.setVisualFire(false);
Vector v = fishHook.getVelocity();
fishHook.setVelocity(new Vector(v.getX() / 4, 0.05, v.getZ() / 4));
testProject.getLogger().info("bounce...");
}
}
}
}```
I know I am using textdisplay, tried with fishhook first, same result.
Neither of those entities take damage as far as I'm aware
Only living entities can, which neither of them are
hmm, could use a strider or something, sec
trying
yea this way aint working...
any suggestions to a different way of doing this? I could just make a task, but seem a bit intesive
Hi everyone! I've been looking to hire a developer to help with some plugin configuration on my new server. Between work and family, I just don't have the time to figure some of this stuff out. Would appreciate anyone who can point me in the direction of someone who can help š
okay it seems to be a 1.20.5 addition :kek: data packs can now indeed load custom patterns
Tried that forum, I can't post anything because my account has "insufficient privileges to post here"
you can look up the posts from devs offering their services and contact them
there was another link, uh
?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/
probably linked in there :^)

You're telling me you didn't see the best new addition to the game?
so figured a way to make the hook float in lava, but it aint pretty and resource friendly. (this code is for testing, don't hate).
public class HookTester implements Listener {
private final TestProject testProject;
private BukkitTask bobbingTask;
public HookTester(TestProject testProject) {
this.testProject = testProject;
}
@EventHandler
public void onCast(PlayerFishEvent event) {
if (event.getState() == PlayerFishEvent.State.FISHING) {
FishHook fishHook = event.getHook();
bobbingTask = new BukkitRunnable() {
@Override
public void run() {
if (fishHook.isValid()) {
if (isHookInLava(fishHook)) {
bobHook(fishHook);
}
} else {
cancel();
}
}
}.runTaskTimer(testProject, 0L, 0L);
} else if (event.getState() == PlayerFishEvent.State.REEL_IN) {
if (bobbingTask != null && !bobbingTask.isCancelled()) {
bobbingTask.cancel();
testProject.getLogger().info("Bobbing task cancelled.");
}
}
}
private void bobHook(FishHook fishHook) {
Location hookLocation = fishHook.getLocation();
Block block = hookLocation.getBlock();
if (block.getType() == Material.LAVA || block.getRelative(0, 1, 0).getType() == Material.LAVA) {
fishHook.setGravity(false);
fishHook.setFireTicks(0);
fishHook.setVisualFire(false);
Vector vector = fishHook.getVelocity();
fishHook.setVelocity(vector.setY(.15));
testProject.getLogger().info("Hook bobs above lava.");
}
}
}```
If you want use it on your world, download the resource and data pack below (they might take a while to load) and run "/function bad_apple:get_player" to obtain an egg that places the banners.
RESOURCE: https://www.mediafire.com/file/yppqll8v2waj3th/bad-apple-RP-v1-0-1a.zip/file
DATA: https://www.mediafire.com/file/pivplby6x6a4v93/bad-apple-DP-...
I hate that I can't find a better way >.<
oh god
Some people have way too much free time
I wish I could be a professional shitposter
Wait thatās awesome
And they can go on shields too
Mojang be on that data driven train again
Cmon Mojang you know whatās next
Blocks plz
How about villager trades
fuckin hell
if it has some mode of display, bad apple will be played on it
Iāve seen it on sheep and trapdoors
Ive seen it on the fileexplorer
does anyone know of a bukkit event for when a player enters or leaves a dimension? ex: going from overworld to nether via nether portal
Yea
its called PlayerChangeWorldEvent
afaik
No
PlayerEnterPortalEvent
declaration: package: org.bukkit.event.player, class: PlayerChangedWorldEvent
declaration: package: org.bukkit.event.player, class: PlayerPortalEvent
oh cool thank you!
@vast ledge do you also happen to know how to get the coordinates of where the player was when they left the dimension?
If you're using the PlayerPortalEvent, you can just do player.getLocation(), thats the previouse location, then you'd have to wait a second, and the get location again for the output location
I want to use PlayerChangeWorldEvent() so I can track when they just teleport to another dimension as well
I tried p.getLocation() but it just gave me the location of them after they went through the portal
fo rthat one, use #getFrom()
doesnāt that return the world though?
im not at pc anymore right now but I think it just returns the world the player came from not the coordinates in the world they came from
Yea, then i dont know :(
alr thanks for the help
?jd-s
Speaking of, did you ever look at those couple classes?
are you fucking kidding me mr maple syrup? the best addition that was ever made to the game are obviously goat horns
the ability to play bad apple on 3x2 is unmatched
hmm, you only ever use runTaskTimer?
There are a couple that are just runTask, but most are async as well, I wasn't really sure how much of a difference it made but either way it's still causing my test server to run 20,000ms behind
wait
me when I leave the debugger attached and forget the game is running
god damnit
yea maybe u switch it to just another runTaskTimer, altho nested callbacks can be a hell to deal with
š„²
I 100% forgot all events run main thread kek
the applyColdEffect is truly async tho, or well dispatched in a separate thread pool
Odd
wth is a cold effect?
runTaskTimerAsynchronously
when you fall in snow
I have a couple of those I'm pretty sure
It makes the edges of your screen go white
you FREEZE to death
Usually is from powdered snow
god bless leather boots
xD
ah relatable. Everything below 20°C is perma death for me anyway
Yeah I am kinda unaware of proper threading techniques lol
yea well in short:
runTask
runTaskLater
runTaskTimer
these run on the server thread, so no volatile, no ConcurrentHashMap etc needed
and the ones with -Asynchronously suffix do not run on the server thread, and thus additional proper thread safety may be needed
Gotcha
yea, also in general, Thread.sleep is usually sth u rarely (im lying) see used in a production ready program, well in spigot/bukkit
I'm not sure where to put the emitTemp method now... The point is to have event driven updates for the temp system but the display part I need the temp increments to go 1c by 1c (reason for the thread.sleep)
why not substitute the while loop + thread sleep with another runTaskTimer?
generally speaking you should never really see a sleep call, but rather use a scheduler to run the thing later in time
it will take care of all the nasty details for you :>
Hmm
The issue I now see is that the calculation methods will be called for every time I need to run the task which is kinda heavy
So perhaps another structure redesign is in my midst
well its a bit heavy, but definitely lighter than that sleep(1_000L);
Yeah well perhaps if I didn't forget the events run on main thread lol
conclube, how come that you explain something in an easy way without 20 magic words lol
tbh, im kinda sleep deprived rn
sooo
;)
To be fair I had already known the most of that, but apparently I just like to block the main thread
So do you think it'd be fine to do taskTimer every second? (for the temp calculations)
worth a try
hello :)
for my plugin i want my custom items to glow without having an enchant, how would i do that?
this is what i have for the displayname
but when i tried to add lore and make the item glow it caused like 11 errors
tested my custom 2 weapons plugin, and neither of them are functional
trial and error
How can I fix the jumpy movement while sitting on an armorstand
There is always a side it refuses them to look in
Arrows allowed full range except despawn
1.20.5 has enchantment glint override
Hey choco wanna know the daily stupid?
.
Anyone know about the sitting on armor stands?
Rotate the armor stand
Make it face a different way
If you mean the player body facing the wrong way: rotate the armor stand
When player is turning around certain directions are glitchy
Do you need them to turn in 360° at all time ?
looks like bad math
Ideally I donāt want it so if they choose to turn around while sitting certain directions have weird movements
While on an arrow it does not cause this behavior
and whats the issue with using an arrow?
ah it despawns
you would have to check in the projectile hit event and if its your arrow cancel the event
looks like the Spigot API needs to add a setLife() for Projectile entities
oh nm, it has it
@cursive kite ^ set that to zero every 30 seconds or so
um, can't set to zero. One then
Arrows are despawned after 1200 ticks
For this project I am using 1.8 :p
Uhh, that will not work I think ?
I don't exactly know what that method does, but I think it just does not send the entity to the client.
Meaning a client would not know what to sit on.
?1.8
Too old! (Click the link to get the exact time)
if you can;t set it invisible setItem to somethign tiny
Well.. despite resetting the ticks the player still gets dismounted
Player is shown standing but if they try to walk away it teleports them back to the sitting location (standing) until they properly dismount (shift)
hypixel at its peak prob had more players than all of 1.8+ servers combined
client auto despawns arrow when it should not
Hm what else can i try ive been googling for alternatives for this project
update
server doesn;t so insists player is still a passenger, so teleports them back
I understand this is an old version but this is what i am doing for my project...
what exactly are you trying to do with the player sitting?
Just cosmetic feature
then figure something else for cosmetics
:l
idk how arrow sitting looks like, but you can try having the armor stand a player is sitting on rotate with the player
dunno if it will look the same, but the wierd teleporting thing should be gone
yep, the player is jerking on the stand as it wants you to face forwards
forward arc
should i use a different enitty
I bet all (living) entities have the same facing thing
Can you make minecarts invis? lol
RP needed
rp?
resourcepack
hmm
It's a kinda weird hack where you make all minecarts invisible and give the ones you want to be visible a custom model for the display thing that minecarts have for some reason
Slime also has the movement glitch š¢
no way around that with a living entity then
Everything beside that dang arrow lol
To move it off-grid you'd probably have to make it ride a different entity, but that's no that bad
well -
Else you have to use an armorStand and set its facing to the players direction every move
Hey guys, does anyone know the the EntityDismountEvent is deprecated and what to use instead?
Not deprecated
Seems to only be when facing backwards on the stand, so i guess ill just check the stair facing and ensure they can atleast look forward normally
could be a weird requirement ?
Wont the player be sitting off the stair then lol
read the docs, its in a different package now
Despite armor stand being set a small it makes the passenger sit as default height :/
just go with the AS and align it to the stair.
that way you don;t need to mess with anything and the not being able to face backwards will make sense.
what version ?
1.20
they call it null in hypixel so i just call it null, plus its easier š¤·āāļø
create RP with broken model
idk of any way for new version
is there a way to do it with spigot
thats a cute armor stand
you really do not like listening to people, do you
What are you on about... I do not want to create a RP
This is an older version : (
Just make the armorsstand normal size (cause in 1.8 the hitbox does not changed based on the armorstand size...)
position it under the stair
set it invisible
can i make a giant in minecraft wear a command block (and make it visible)
BlockFace facing = stairBlock.getFace(stairBlock.getRelative(BlockFace.DOWN));
switch (facing) {
case SOUTH:
return 0;
case WEST:
return 90;
case NORTH:
return 180;
case EAST:
return -90;
default:
return 0;
}
Is this good math
remove case SOUTH:
return switch (facing) {
case WEST -> 90
case NORTH -> 180
case EAST -> -90
default -> 0
}```
it won't scale as a helmet
not gonna work with 1.8
Hello, someone know how is made this ? I know that he is using custom fonts. But as we can see he can chat + see action bar messages + clickable buttons (prob inventory?). And he is riding something it must have have something to do with that
For some reason it is returning 0.0 for each facing stair
just an inventory, while listening to command completion by the looks of it
guessing mount is just to stop moving while in the inv
can't be in inventory and open chat
can do with a Text display
even the chat input?
thats the tab complete
riding is probably for the cursor, might be the thing with riding and spectating ?
every character you type fires tab complete, you copy that onto a text display
looks cool but would be really finnicky
Oh OK i learnt that yes it was display entities and the player is teleported elsewhere
wheres the vid from anyway
Helpchat
That type of UI is done by overlaying the entire screen with a texture from a resource pack
What is the mycelium partile called in the particle enum?
To detect button you listen for the punch and then calculate the relative position that they were punching
And then map that on to the screen
cant find what
seems that ItemFlag.HIDE_POTION_EFFECTS is gone with 1.20.5, what replaced it?
he gave you the javadoc link
declaration: package: org.bukkit.inventory, enum: ItemFlag
Yes I can see it in the docs but not in IntelliJ
random question, what version are you using ?
are you importing the right Particle class
org.bukkit.Keyed right?
um
wot
org.bukkit.Particle right
1.20.4
can confirm tho, just tested
same here in 1.20.4
it just doesn't exist for some reason
well they did change a lot of names in 1.20.6
yeah its not dang
who tf named that
wait this is a really cool idea
think they were kinda drunk ngl
they honestly changed the naming convention way too late
town aura
its such a pain in the ass to account for with plugins that need to be backward compatible
wtf does taht even mean
its nice that its more consistent now but it shoulda been done years back
massive job + not enough contributors
Thanks!!!!
How hard would it be to port my 1.19 plugin to the latest version? (and how would I go about it?)
Depends. What systems does the plugin use, how large is it etc
Simply change the version then remove errors
it looks like an inventory rather
Ok, shouldn't be too bad then- thanks š
An inventory is a ui
yeah but he said that you would calculate where the player hit for clicks
but it's just an item
^
you could do it with display entities and hidden (AI disabled) slimes.
oh god
every time i spawn a giant it just disappears after some time, why?
is there any replacement to PotionType.UNCRAFTABLE in 1.20.5+?
peaceful?
no
how long is "some time"?
i found setRemoveWhenFarAway
like a minute
even if you stood near it?
Null
oh you can just enter null? sick
no
If you are moving away from teh giant and it despawns setPersistence(true)
not everything no, some parameters will need to be not null
it's persistent, setRemoveWhenFarAway is the issue cuz it's true
can u set the view range of any entity or only display entities
wait view range doesnt even work on display blocks..
Can't open chat with GUI
Only display entities
Crops crop = new Crops(CropState.MEDIUM);
BlockState state = plant.getState();
state.setData(crop);
state.update(true, false);```
Hey, Crops is deprecated in 1.20.2 and when i execute this it wont work and crops break.
Someone knows the right version for 1.20.2?
are you under a rock... thats from 1.12
the right thing is whatever BlockData is listed in the documentation for the block you care about
I want to change cropstate of Potatoes
getBlockData
Alright thank you :D
.
i set the view range to -1000000 and theres no difference
and before u say it bugs at negative, i set it to 0.1 and still no difference
Itās a multiplier to the clients entity view distance
What
cuz if ur abit far it just looks like a display block floating
im using display blocks as a "head" for a giant
like this
Canāt you just put an actual block on its head
it doesnt scale
a normal helmet scales
but a block doesn't
im gonna try making the block display a passenger to the giant
that's 1.20.6
and itll prob do the same thing
wtf
now the giant disappears after the display block
it tripled the view range for the giant
what's a safe way to implement global constants to use around different classes?
if they are really constants then a Static class is fine
public final class Constants {
private Constants() {}
public static final double PI = 3.14;
}```
What was org.bukkit.Material replaced with?
nothing
they seem to do some clientside changes on 1.20.5/6 intentially or not, but now any item with custom enchantment that is registered on the server, but not on client will insta kick the player. Not sure if this can be fixed at all, therefore no way to update the plugin
How are enchantments registered on the client side?
but like each item is still in the Material enum
yes
idk why it says Material doesn't exist then, same with Sound
clear caches and restart
nope...
nope. don't send custom enchantments to the client
I got an error from getDisguiseAPI
if (plugin instanceof LibsDisguises) {
LibsDisguises libsDisguises = (LibsDisguises) plugin;
// Utilizza i metodi di LibsDisguises per applicare la texture al giocatore
libsDisguises.getDisguiseAPI().setPlayerSkin(player, texture, signature);
} else {
player.sendMessage("Il plugin LibsDisguises non ĆØ stato trovato.");
}
}```
yeah its a list of types of damage that I want to implement
so it would be List<String>
so that I can iterate through it without need of creating one for each class that I need it in
I was thinking about adding parser too
for colors
Why not enum instead of string
can you iterate through enum?
yes
creating one in each class?
would it be better to put such enum in separate file or like inside same file as my main plugin class?
seperate
when I want to iterate through that List<String> I wouldn't like to have to declare it in each class that needs it
You need to learn what static means
its redundant
if something is static I dont need to create object of it to access it, right?
that example I gave would be accessible from ANY other class using Constants.PI;
a single instance accessible from anywhere
isnt that singleton?
or does singleton need to be passed but returns just that one instance?
yes and no, as you are not actually instancing the class
Why if i do the build tool in 1.19 i can see the src and in 1.8.8 no?
if you want to iterate then an Enum is better for you. It should be its own class
read yoru build logs
Update IntelliJ to 2024.1.1
1.21 fixes that for you, in fact it makes registrating custom enchantments easier
Ok I'll try that, thx
when does 1.21 come
(once again, hoping for in-built datapack support)
You mean for plugins? one dayā¢ļø
should be within the next 1-3 months based on previous releases
hopefully
nobody else creating an interface for constants?
if people wanna be stupid, let them be stupid
interfaces for constants are super nice, you could implement the interface in a place where you use it a lot and shorten the references a bit
nah, lock everything down. Prevent everything you don;t want
in kotlin you have objects, not as java.lang.Object but as object Something { /* declarations */ } which makes a singleton to compare it in java terms
so you could do Constants.X and no way you could ever instantiate X
anyways that was the lesson kotlin for today
im now wondering if im actually correct
you are
that's only for const afaik
i believe a companion object creates a singleton
me love objects
Yeah, that is only for const
If u want it to compile to static, u have to add @JvmStatic annotation
difference between:
PacketPlayOutRelEntityMove
PacketPlayOutEntityLook
I need NPC's body to move in given yaw (converted ofc)
I don't know which packet handles it tho
rel but you need to calculate the values. it's an x/y/z offset from the current location
Basically it's the vector you want them to move in, normalized and multiply by how far you want them to move (up to 8 blocks)
I got an error on getDisguiseAPI
private void applyTexture(Player player, String texture, String signature) {
if (plugin instanceof LibsDisguises) {
LibsDisguises libsDisguises = (LibsDisguises) plugin;
// Utilizza i metodi di LibsDisguises per applicare la texture al giocatore
libsDisguises.getDisguiseAPI().setPlayerSkin(player, texture, signature);
} else {
player.sendMessage("Il plugin LibsDisguises non ĆØ stato trovato.");
}
}```
This type of error
I don't understand what's the problem
What error? You are just postign code
ah ok
but idk why
wowo their wiki is so rubbish
yeah...
well it looks liek DisguiseAPI is a static access
so no plugin.getDisguiseAPI
just DisguiseAPI.
for everything else it's LibsDisguises.getInstance()
Which event can I use if I want to check if any entity is moving no matter which type it has?
there is no move event for entities
show the error
see if ur using an updated api
mm
lol
How can I prevent a spider from jumping then?
you can check the coord
pointless
he wants to prevent it jumping so checking its location will not help
There is no event for mob moving.
Only way to prevent it is modifying the AI so it can't jump
maybe setVelocity?
Still not. No way to detect when it jumps
unless you are going to set its velocity every tick on every spider
then spiders will not be able to climb either
use nearby entities
How can use spawn particle only for exact player? Cause when I use spawn mob_appearance elder guardian spawn for all player's nearby
p.getWorld().spawnParticle(Particle.MOB_APPEARANCE, location, 1);
he wants to detect or prevent the jump?
prevent
you can;t prevent it without being able to know when it jumps
which can;t be detected without lots of load on your server
Modifying the AI is the only suitable method
@vague swallow why do you want to prevent the spider jump?
good question
because when you try to hit them, they jump thus dodging the attack
mm
but all the spiders won't move
what? of course they will
so whats wrong with change the velocity
Tell me how you are going to tell teh difference between a spider jumping and one climing a block?
my question still stands, how are you going to differentiate between a jump and climbing a block?
can I stop this from happening when I am teleporting between worlds?
just don't move too quickly
not easily
im literally cross dimensionally teleporting
how does it even move too quickly
does it just not care about the world or what
yeah, it sees movement past 8 blocks in a tick and you get spam
jeez
how does regular minecraft teleports fix that then
like going through portals
entity#isClimbing
the moved too quickly is a spigot thing
so every tick you are going to search for all spiders near a player, then if they are not climbing you are going to zero their Y velocity
yes but moving through a nether portal doesnt spam my console
even though its functionally the same thing
its just use the EntityDamageByEntityEvent
check if the players hits a spider
and then?
oh wait it only happens if I am already in the world
then set the spider velocity
So the player hits a spider, but its not moving yet so theres no velocity to zero out
it doesn;t start to move until after the damage event has finished
š¤Ø
can someone help?
spawn the particle on the player instead of the world
do p.spawnParticle(Particle.MOB_APPEARANCE, location, 1); instead
np :D
you can configure these messages in the spigot.yml file
turn them off or on
Does recipe exact choice work with items that have custom attribute modifiers?
It should be valid for any change in the nbt data
How can I show player death message or demo message? Or is it possible only with NMS
Bukkit.broadcast
it would broadcast message
but i need to broadcast this title when you dead
where is respawn and leave buttonsd
this will just send message
Thanks, I'm having an issue where my custom recipes do not work. I believe the issue is because I used UUID.randomUUID() when I created the attribute modifiers used in the ingredients of the recipe, and random UUIDs should almost never collide. Should/can I use the same UUID when creating attribute modifiers?
you can not send messages IN the death screen
I seen that some plugins have send this messages
Yes, the UUID is used to prevent the same modifier being added multiple times.
And messages that demo version ended also
Lol
demo version?
you can change the death message with https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/PlayerDeathEvent.html#setDeathMessage(java.lang.String)
thats bedrock

yeah but this message also shows on java
so it will just change death message, or it will show also?
oh yeah
thanks
how would i go about teleporting a player in a boat where they player and the boat get teleported instead of just the player
1.20.6 api
TP the boat, then TP the player, then mount player on boat.
alr ty
Cluby has Something to say about this as well? 
?paste
cluby? lol
Do anyone know how to rotate display item?
set the transform
how do i teleport a boat lmao
I don't understand how to work with transform of display item
You can try to transform list into array and add there an array
?pdc
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
What would happen if a synchronized method called itself?
Cuz for non-sync it'd result in StackOverflow
Even in the summon generator when I'm trying to rotate display item with right rotation, it doesn't work, it changes it's scale, or something like that
but it's invisible
And rotating it using a plugin is even more difficult
i cant seem to teleport a boat
is there a list of supressable warnings in @SuppressWarnings?
Boat boat = (Boat) player.getVehicle();
boat.teleport(destination);
how come that dosnt work?
u cant teleport vehicles with passengers
ah i see
dismount the player then teleport the boat then remount
its usually not even visible cuz of how fast it happens and to make it even more convincing teleport the player with the boat then remount
thank you for the advice
np
looks like me trying to do html
._.
I got it working thanks again for the advice
np
I guess it would either overflow or just run endlessly
but probably the latter
It's not in degrees
It's also a quaternion not a standard vector
I tried, but it's too strange
Well... Okay, I will just continue using armor stands ,_,
@young knoll run /summon block_display ~-0.5 ~-0.5 ~-0.5 {Passengers:[{id:"minecraft:item_display",item:{id:"minecraft:acacia_boat",Count:1},item_display:"none",transformation:[10.0000f,0.0000f,0.0000f,0.5000f,0.0000f,1.0000f,0.0000f,0.5000f,0.0000f,0.0000f,10.0000f,0.0625f,0.0000f,0.0000f,0.0000f,1.0000f]}]}
It's summoning block_display with item display and both of them are rotating somehow
ah i see
Could not find artifact me.clip:placeholderapi:pom:2.11.5 in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
why cant i import papi in my projekt
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
<scope>provided</scope>
</dependency>
Doesn't it have its own repo
<repositories>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
ty
If a chunk is already saved and I call this method, would this effectively delete the chunk?
for (Chunk chunk : chunksToUnload) {
world.unloadChunk(chunk.getX(), chunk.getZ(), false);
}
no
ok how can I actually delete a chunk then
If I want to make a 8h cooldown for example, should i do it with hashmaps or another way?
wdym delete first
like delete all the blocks in the chunk?
completely unload the chunk and delete it from the world folder
you can refresh chunks but not delete em iirc, why do you need to delete a chunk in the first place
because I'm optimizing my world
it's not a survival world
it's for lobbies/minigame maps
why not
beacause you just can't, it isn't a feature
You can very well just delete the region files in the world folder to prune it
Just make Sure the chunks arent loaded at that time
But for lobbies and Minigame maps, i would suggest using a void ChunkGenerator implemntation
I'm using a copied superflat world from singleplayer that generates void chunks, but there's like a radius of like 20-25 extra chunks in all directions
so it's like 2k chunks loaded instead of way less
Then delete them 
easier said than done š
just grab mcaselector 
Literally call .delete() in the Files
no that could very easily delete chunks I need
I have to go inside of the region files
ā¹ļø
have fun
what's that
If this is a one time thing, literally just mcaselector
a tool to do exactly that, yank old chunks
no this is a map editor plugin
š
Tell them to use mcaselector instead 
it'd just be a lot easier in the long run if I made this automatic
I mean, NMS it is for you then
For chunks bordering on the map, you can remove them async (but on the main thread) over a few seconds
async but on the main thread š¤
?workdistro
case ZOMBIE -> {
Zombie zombie = (Zombie) e.getEntity();
Objects.requireNonNull(zombie.getAttribute(Attribute.GENERIC_SCALE)).setBaseValue(scale);
}
case BLAZE -> {
Blaze blaze = (Blaze) e.getEntity();
Objects.requireNonNull(blaze.getAttribute(Attribute.GENERIC_SCALE)).setBaseValue(scale);
}
and other mobs
is it possible to make it work for all mobs that i add to config?
I need to Specify that blaze is Blaze because otherwise i wont be able to use blaze.getAttribute()
if (e.getEntity() instanceof LivingEntity livingEntity) {
livingEntity.getAttribute(Attribute.GENERIC_SCALE).setBaseValue(scale);
}
should work ig
Is Player#damage armor dependant?
cooldownManager.setCooldown(playerUUID, Duration.ofHours(section.getLong("time")));
cooldownManager.setCooldown(playerUUID, Duration.ofHours(1));```
Could someone tell me why is the second one working but not the first one?
Define not working
@EventHandler
fun bottomBorder(event: PlayerMoveEvent) {
if (!isSkyBattle(event.player.world)) return
if (event.from.y <= 71) {
val damage = EntityDamageEvent(event.player, DamageCause.VOID, 20.0)
Bukkit.getPluginManager().callEvent(damage)
}
}
anyone know why this event doesn't get called? Done some debug statements and it definitely gets reached but the player never gets damaged
š
use player.damage
Also why not use getInt and then convert it to long. Snakeyaml might be weird with longs tbh
it doesnt do typed damage
i can do from an entity
but the void isnt an entity
Like, the cooldown didn't work with the same option
isn't it the same?
U already fired the evnt
Set their hp @lean arrow
Who knows, try it also debug the return value
i'll do
Set their hp based on the returned totaldamage from the event or smth @lean arrow
Well, it returns 0 when it isn't 0
š©
Thereās your issue
Noob
Is it because it is a string?
How can I check if player was pushed by plugin and then cancel fall damage?
CoolDownManager.setPushCooldown(player.getPlayer(), Plugin.getInstance().getConfig().getInt("cooldowns.push"));
Location location = p.getLocation();
p.setVelocity(location.getDirection().multiply(2).setY(30));
} else {
it shouldn't be but idk
Yes
U donāt
thats what you get for using eclipse
What I don't
U donāt detect it
I don't think eclipse made the class package private :c
it did
how can i check if the player has a lead on a entity
so how can I cancel fall damage here?
How fast are they falling
Are they always falling
when player uses command /push arg1 the player's pushes in the air
Alright
Then simply flag the player when you push them. When they take damage next time check for flag and if falldamage, remove flag and cancel the damage event.
What I need to use to flag player?
A set of uuids will work fine
Why It don't work? Am I using right event?
@EventHandler
public void onEntityDamage(EntityDamageEvent e) {
if (e.getEntity() instanceof Player) {
Player player = (Player) e.getEntity();
if (pushedInAirPlayers.contains(player.getUniqueId())) {
pushedInAirPlayers.remove(player.getUniqueId());
e.setCancelled(true);
}
}
}
}
That contains check is reduntant
what do you mean reduntant?
sorry don't know english very good
nvm
It means not needed
i got itworkin
because remove already returns if the element was removed or not
Heyyy I was wondering if anyone had any idea on how to fix this bug I keep on encountering whenever I build a project on Ubuntu. https://mclo.gs/k83w4CC It keeps on saying permission denied.
oh ok
but player still dies when he fall on the ground
is running these two methods even doing anything?
Gradlew is probably missing the execute permission
