#help-development
1 messages · Page 1143 of 1
What to elaborate
I am not sure of the limitations of pdc, last I recalled its a bunch of strings which I think is all that is necessary. But it is technically possible to save objects or code to load later just not sure if pdc would hold that much to allow it.
however, the amount of additional code to make this possible might defeat the purpose in why you want this
Wait what!!
But I think it's a bad design to keep consumers in pdc
No just no
I agree, well yes you can serialize that stuff, just not entirely sure what it is they are trying to make is all
How to parse string as java code 🤓
I guess now you have something new to learn and research
compile it
Hm
There is beanshell
I think version two is maintained by google
But I would argue against it
Why you want save runnable into PDC 🤔
Javascript better
Cap
Im switching my plugin to javascript fr
it won't run better then the native language of the program
serializing functional interfaces is a very bad idea imo
you will have to contend with context switching
What the hell are you talking about
obviously you have much to learn 🙂
so you should go research and learn some more given your horizon earlier has been broaden, even if it might have been in jest lol
Have you ever had that feeling when you make an api and you realize that it can be extended, but on the other hand you realize that with 90% probability you don't need it.?
I don't know what to do.
Wdym
what the actual fuck are you trying to do
You should never get into a situation where you have to serialise a fucking consumer into the PDC
I mean what to do if you want to add new functions to the api that probably won’t be needed
Trolling
…
Add new functions to the api
means to add?
Yes
I'm just making an API for a narrow circle of people
I mean if it maeks sense to add to your API, even if it's a utility, add it if you want
how the fuck do you serialize a lambda
YOU CAN SERIALIZE LAMBDAS????
WHAT IS THIS
HUH
@FunctionalInterface
interface SerializableFunction<T, R> extends Serializable {
R apply(T t);
}
public static void main(String[] args) {
try {
// Create a lambda expression that is serializable
SerializableFunction<String, String> lambda = (String s) -> "Hello " + s;
// Serialize the lambda
FileOutputStream fileOut = new FileOutputStream("lambda.ser");
ObjectOutputStream out = new ObjectOutputStream(fileOut);
out.writeObject(lambda);
out.close();
fileOut.close();
System.out.println("Lambda serialized");
// Deserialize the lambda
FileInputStream fileIn = new FileInputStream("lambda.ser");
ObjectInputStream in = new ObjectInputStream(fileIn);
SerializableFunction<String, String> deserializedLambda =
(SerializableFunction<String, String>) in.readObject();
in.close();
fileIn.close();
// Test the deserialized lambda
System.out.println(deserializedLambda.apply("World"));
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
}
What the fuck???
Probably links to compiled lambda class and calls the constructor
omg
it's strange but possible
I didn't know this was possible but it seems logical
Also
better way to do it
is to have a registry of name -> lambda
then just store the name in the item
and get the lambda from the registry
it's much cheaper this way :P
fr
fr
but anyway this is funny
Why is the skin not updating for the player itself? (Its only get changed for other players) ```java
public static void refreshPlayer(Player player) {
Location location = player.getLocation();
CraftPlayer craftPlayer = (CraftPlayer) player;
ServerPlayer serverPlayer = craftPlayer.getHandle();
DedicatedPlayerList dedicatedPlayerList = ((CraftServer) Bukkit.getServer()).getHandle();
CommonPlayerSpawnInfo spawnInfo = new CommonPlayerSpawnInfo(
serverPlayer.serverLevel().dimensionTypeRegistration(),
serverPlayer.serverLevel().dimension(),
0L,
serverPlayer.gameMode.getGameModeForPlayer(),
serverPlayer.gameMode.getGameModeForPlayer(),
false, false,
Optional.empty(),
0
);
ClientboundRespawnPacket respawnPacket = new ClientboundRespawnPacket(spawnInfo, (byte) 0x02);
ClientboundPlayerPositionPacket positionPacket = new ClientboundPlayerPositionPacket(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch(), Collections.emptySet(), 0);
serverPlayer.connection.send(respawnPacket);
serverPlayer.connection.send(positionPacket);
dedicatedPlayerList.sendLevelInfo(serverPlayer, serverPlayer.serverLevel());
dedicatedPlayerList.sendAllPlayerInfo(serverPlayer);
}```
seems you learned something new as well
Guys if you cancel a runTaskTimer task, does the code after that line finish running?
yes
does someone know how i can use essentials api?
Through a dependency probably
I got the code
public static Chat getChat(){
return chat;
}
public static String getPrefix(Player player){
return Vault.getChat().getPlayerPrefix(player).replaceAll("&", "§");
}
public static String getSuffix(Player player){
return Vault.getChat().getPlayerSuffix(player).replaceAll("&", "§");
}```
RegisteredServiceProvider<Chat> rsp = plugin.getServer().getServicesManager().getRegistration(Chat.class);
if (rsp == null) {
return false;
}
chat = rsp.getProvider();
return true;
}```
chat setup
on plugin start
onLoad? onEnable?
onEnable
tried it says Could not find artifact net.ess3:Essentials:pom:2.13.1 in papermc-repo
and your plugin.yml had a depend/softdepend on vault?
did you add the dependency?
no
am I supposed to do that?
I was thinking about doing that
yeah ```<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>paper-repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository>
<id>ess-repo</id>
<url>http://repo.ess3.net/content/groups/essentials</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId>
<version>2.13.1</version>
</dependency>
</dependencies>```
repository*
does it error if theres no vault?
if you softdepend it will load after vault, IF vault is there
i added repoository and dependency
alr cool
now I can make my own error when theres no vault :D
but thing is
it doesnt even error
so I dont think its that
(I made it to error if it fails to load chat)
oh and also
my chat doesnt contain prefixes
I assumed it cuz I dont have a chat plugin?
could it be that?
your actual in game chat will only have a prefix if you have a plugin to modify the chat
fair
welp
worked
wait no
not neccessarily yet
okay so...
uhm
it worked but not rly
so uhm
the thing is
hm
prolly some char limit
yeah its definitely a char limit
how does tab set player name above head with packets
without the 16 char limit
cuz seems like changing game profile is not the way
players preifx 16chars main name 16 chars and suffix 16chars
nah thats with teams iirc
thats not right
I have a prefix that has 5 differently colored letters
and theyre all colored in hex
so thats like
8 chars each
so like 45 total
prefix
teams
grr
What's wrong with teams??
teams
???
how to send teams packets with packetevents :3
sir have you had the brilliant idea of searching for "Team" in PEs files
wait is it open source
💀
...
It's quite hard to publish a jar artifact for something closed source without people just publishing the entire source
valid
ah damn
thisis over 3 billion chunks
I can't just use memory
sadge
imagine making your own generation system that requires also implementing a storage solution because of how many chunks it spawns
Lol
ok hear me out
I'm actually really lazy
ah nah
yeah there's no way around this one
unless... I kinda just... yolo it
wait no I can't do that due to postprocessing
actually how am I even going to postprocess something I can't load into memory
hm no I can totally do this I just need to get a bit sweaty
hey✌🏼 i need a developer for simple coding verry easy
?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/
woahh, theres a thread?
sick
time to sell my soul to strangers online
Can I report someone for DM advertisement?
yes
where and how
was it a discord DM on this server?
yes
does anyone know how do i remove the invincibility you get after respawning
its really annoying
lol
I never get DM's. No one loves me. In reality I have them all blocked
just turn off dms
I just forget about them
and only allow friend requests from friends
please
this channel is for helping
I have like 33 messages/invites or whatever they are right now pending
not chatting
only friend requests from friends
omg
i meant with mutuals
ok
my English didn't english
I disagree
my english not englishing
Spigot has no invincability after respawn, that I know of
okay better question sorry
you need to chat in order to help, seems a bit of an oxymoron
when citizen bots respawn they have a 3 second invincibility window
i've tried nodamagetick
rather an antithesis
dude took it literally
oxymoron is a connection of words
sounds like citizens issue
its fixable
then you should be asking in server help not plugin dev
well you can fix it with spigot
yeah, lets go with your word
you mean a sentence
no
nah I think its like 2 words contradicting each other
combining words
that itself is an antithesis; combining those makes an oxymoron
it is this exactly
Living dead
is an example
zombie rn
whats the best way to dispose of a world
no, they're just the same in german
delete it
fire usually works too
your world or a default one?
that's an oxymoron - "living as a zombie" e.g. would be an antithesis
yes
thats what weve been saying
well I was at least
Well, I did say you were correct 😉
can u try
also can't delete it if its the primary world either
tho
without stopping the server that is
you will be able to delete most of the world except files that are locked and in use
typically the spawn chunks and the sorts
also to note it wouldn't stop the chunks being regenerated either
so there is also that
is Bukkit.unloadworld the same as Server.unloadworld
yes
yes
damn
Bukkit delegates a lot to the server
nvm then
sorry I don't understand
if I remove an object from a list that will correctly dispose of the object correct?
as there should no longer be a reference to it
if that is the only reference, yes
public void removeMatch(BridgeMatch match) {
File directory = new File(match.getWorld().getWorldFolder().getPath());
Bukkit.unloadWorld(match.getWorld(), false);
try {
FileUtils.deleteDirectory(directory);
} catch (IOException e) {
throw new RuntimeException(e);
}
matches.remove(match.getId());
}```
anything more I should do?
I don't want a memory leak aha
considering there could be unlimited matches objects being generated between server stop/start
"It doesn\u0027t do anything... yet!"
\u0027 what is this?
I am hard assuming its ' but how do u convert it back?
That's a unicode character
dawg who tf makes description that way
and yes it's '
anyway to convert it back?
Hey, I'm having trouble building my plugin
https://pastecode.io/s/5fr7ns9p
I have just updated my 3 plugins to 1.21 and one of the three depends on the other plugin and therefore i added it as a dependency in the project structure but somehow after the update it doesnt build anymore
its called a unicode escape sequence. You use it because of how strings are interpreted sometimes in the programming
and thus using that gets around that issue
otherwise the program displays the character as something else or mistakes it for something else
just watch me use epsilon gc and that never happens
does the PluginDisableEvent handle before the JavaPlugin.onDisable() method call?
It should as its a notification to tidy up any handles you have to the plugin (but test it, don't take my word for it).
.
I wonder if it's worth it optimizing this to be able to do a world size higher than 3200x3200
at 4gb of ram
I feel like a 3200x3200 maze is probably plenty big
I want to make something like 3 lifes hardcore. What's better to use to save their lifes? SQLite or just .yml config api?
?pdc
is it for me?
yes
Does anyone know why the skin under "refreshSkin()" doesnt get changed for the player itself?: https://paste.md-5.net/epiqefomoc.cs
I wouldn't suggest it if entities didn't have a pdc
java.lang.RuntimeException: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
What is this??
if you showed more of the error you'd likely see the connection was refused or not found
Yeah, thank you. For some reason I though that there is only item pdc
it was like that years ago
Ur right
Ur right
Mb
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
Can anyone tell me how to fix this line? I heard about a and b functions but I don't understand how to use them. And I don't know where to read about them
?nms
Is EntityResurrectEvent runs only when entity is being revived by totem on undying?
is there an easy api method to get tps or mspt?
guys how to save any data on plugin folder
i cant find any video about data saving on youtube
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
thanks
can the 2. thread provided by spigot's async method (runTaskAsynchronously) be used for write/read operations for databases or does it have specific usages?
Ok, I don't need those calls so I'm fine. Thanks
It may prove extremely beneficial to utilize ur own thread pool for io (or just virtual threads)
yeah that is my plan B, I have to think.
well cached thread pool is pre configured, which for the average user will suffice
and thats what the bukkit scheduler is using iirc
well yeah so I actually wanted to see how bukkit does it and then questioned myself, wouldn't it be better of implementing my own thread pool?
what kind of io ru doing?
well two kinds, depends on the mode, but basically I have local file storing and then JDBC
isn't that like java 21 thing?
yea
in the case of a no, u may wna stick w a cached thread pool
just so slightly configured to match ur needs
no I can't... well I can but only on mc versions 1.21+ my plugin is complatible all the way back to spigot 1.8
ah alr alr fair enough
in any case, its always interesting to look if u can optimize ur save strategy as well, for example optimistic writing/reading, having upgrade modes etc
yes it is indeed
when plugin is on i change parameters in config
when plugin is shutted down i change something in config (in code) and use saveConfig();. but the saveConfig(); method overrides my changes while plugin was working
i mean thats what i think is happening i have so not much time
if someone can answer FAST
reloadConifg? maybe this
thats it i think
thanks for help ❤️
You’re welcome!
thanks coll!
hello, does any one know how can i move a horse in a specified Direction with a speed? i want the player to be sitting (optionally on an Armorstand) and be able to control this horse and move it like its a vehicle.
why i am asking this is because using velocity when the horse has no AI doesnt seem to work, i tried making sure the physics and gravity of the horse is on but velocity doesnt seem to work without the AI
i tried using NMS but to no avail.
what are you trying to do with all of this
i wanted to create a mini-kart minigame, so i used Armostands, but realized they dont go up blocks and such so im trying to manipulate horses movement(i saw someone called Howzieky do it) to go up blocks and its movement looked smooth
You could just handle the upwards movement with a bit of code
if this was 1.21.2 you wouldn't have to do much with the player input stuff they're introducing 
Hi one question
I'm new in the creation of Java plugins
And I wanted to know, if the creation of plugins for spigot is related to those of bungee?
That is, in coding
but its also a very annoying and roundabout way, although yeah its possible
yeah but it is annoying, you have to remove the goals of a horse or use a boat which kinda sucks for specific movement
cool thing i made using this like 2 years ago but it was a pain in the ass to make
You can just use an armor stand and a packet listener
i could, but i would have to handle every block in the map
hmm
Is it possible to add backwards compatibility so that it also checks if the block is an instance of HangingSign, while supporting lower versions like 1.16?
https://github.com/WiIIiam278/ClopLib/blob/master/bukkit/src/main/java/net/william278/cloplib/listener/BukkitInteractListener.java#L76
So:
block.getBlockData() instanceof Sign || block.getBlockData() instanceof WallSign
To:
block.getBlockData() instanceof Sign || block.getBlockData() instanceof WallSign || block.getBlockData() instanceof HangingSign
i need to make local chat, so when player sends a message, only players in 30 blocks distance will see it, but there are other plugins that change the format of chat message, for example luck perms, it adds prefix, how do i do it?
Try catch the hanging sign part
Wouldn't that mean I had to import HangingSign, which breaks in any version < 1.20
Hence the try catch
Of course, although just the import org.bukkit.block.data.type.HangingSign; statement itself would break in any server version < 1.20 to my knowledge, right?
No
Imports are just a developer thing, the compiled code always uses the fully qualified class name
In that case, thank you both md_5 and Coll!
is it possible to show strictly clientside effects to an individual? For instance, a beacon beam
yes, with packets
Alrighty, I'll take a look
Hey guys why is it when I am setting the no damage tick when the entity spawns it doesn't work?
PitRemake.info(((LivingEntity)super.getNpc().getEntity()).getNoDamageTicks() + " tick");
((LivingEntity)super.getNpc().getEntity()).setNoDamageTicks(0);
PitRemake.info(((LivingEntity)super.getNpc().getEntity()).getNoDamageTicks() + " change tick");
lets say its 30 then it wont change to 0 but stay at 30?
once the timer is gone for the respawn invincibility i can change it and it will work
why is this?
i am new
naturally spawning mobs? that probably isnt possible right
Not unless you rewrite the spawning system
how would that even work using just events tho?
like how would you even know its attempting to spawn a mob on a mob proof block
...you can do that in plugins?
Sure
Just disable natural mob spawning and do all the math and calculations yourself
oh ok i thought you meant something else, like a serverside mod
but yeah no one is doing that so it might as well be not possible
Does XMaterial support item IDs?
looks like yes
guys i've been wondering wich one of the flags is better - "aikar's, hillty's, obydux's and etil's" anyone can tell me if you're using any of this? Or just making the startup yourself (well i mean i can do it)?
Obydux ones ran only on linuix so it's not my style (im windows user)
i think these are all red flags
hm i think based
but like i feel like using and configuring etil's coz it's just nice
and im just asking for your opinion
and explain how they dangerous?
honestly im not using any of this rn and im using default ones (a bit edited tho)
is there any significant harm in creating a “common process” for all plugins in the api ?
for example common container
or class
Have a common submodule or api submodule and then the implementations
fun question
not a great idea to thread sleep even an async task right
or would it kinda be fine
hm
I'll try it out
You block thread for no reason
sleeping an async (Your own pool) is fine. It just yields all cycles until triggered
it stack overflows if I don't
it's just a very big operation and java doesn't like it
Sleeping a Bukkit scheduled Thread, unknown as I've not looked at its implementation
fawe uses a job queue which it pulls from to process
limit how many jobs you do at a time
yeah I don't think there's any tricks I can pull to make this paste over 100mil blocks faster
no
but I can optimize which ones get pasted first which I guess is a good first workaround
doesn't matter that it takes 20 min to paste if players will take 100h to reach the edge
yep, closest first
for check concrete powder change to concrete am i use blockphysics event?
weird
java isn't freeing the memory even though I am pretty sure I am not holding any references to it
the heck java
depending on the gc it may nto free until it runs out
then you have a sneaky reference hiding somewhere
hmm
also I do wonder if worldedit has a mem leak
mem usage consistently goes up
with each paste
and it never lets go
I hm
@EventHandler
public void onBlockForm(BlockFormEvent event) {
if (event.getBlock().getType() == Material.WHITE_CONCRETE_POWDER &&
event.getNewState().getType() == Material.WHITE_CONCRETE) {
event.setCancelled(true);
System.out.println("test");
}
}```
this not worked
that's a good point
I wonder if it still does that even if I am using the api
because at the scale of 100m+ blocks this is kind of not acceptable
debug not worked too btw
you didn;t register the listener
i did
public void onEnable() {
getServer().getPluginManager().registerEvents(new me.vasir.untitled2.Test(), this);
}```
will change code 1m
oh I wonder if these are working hand in hand
I am holding a reference to a clipboard
I wonder if that's where the paste history is
doesn't seem like that would be the case though
okey working when placing water to concretepowder near but when i place concrete powder in underwater not working
okey this fine for me
Hello, i try to use the Teams API instead of Packets, but if i use the Teams API, i dont know how to merge it with other plugins, like I have another Scoreboard Plugin, and the Teams doesnt work anymore, when i have installed this Plugin, or the Scoreboard doesnt work when i have installed the Teams Plugin. Does somebody knows a fix for it?
maybe there is a way to limit the undo history
is there any good particle library for shapes , animations like for example spirals etc? ive tried effectlib but its hard to work with , cannot get stuff like pitch to work at all
Worldedit 100% has a leak when reloaded
Idk about mem leaks outside of reloading tho
Hello can anyone tell me how can i put this plugin in my server ?
Its made in kotlin
Hello, i try to use the Teams API instead of Packets, but if i use the Teams API, i dont know how to merge it with other plugins, like I have another Scoreboard Plugin, and the Teams doesnt work anymore, when i have installed this Plugin, or the Scoreboard doesnt work when i have installed the Teams Plugin. Does somebody knows a fix for it?
This is your own plugin?
yknow I just realized that as much as I am bemoaning how slow I am pasting 100 million blocks I don't actually know how quickly minecraft actually generates chunks
of course it is
Chuck gen would be way more random as it were right?
Oh that’s right I forgot you’re doing the big maze thing
yeah benchmarking 200 radius chunks right now
Effen a cotton
I actually finally woke up and realized why I was getting a stack overflow so I just changed to put the creation logic in a while loop
I find it quite weird how a lot of answers can be figured out just by a good nights sleep
well it wasn't a focus to start with, I was dealing with more pressing things yesterday
I have no differentiation between the two of you and I really don’t know why lmao
well I'm sure simple is going through a very rough time right now
mostly because he's playing albion
so it's at least that bad
hm
again this slows down
when reaching about a million chunks
not a fan of that
hello, what do I do if I want to fix a "gimbal lock", I have a vector that is pointing up, a vector that is an actual direction, and I calculate the orthogonal vector and if the direction and the up vector are the same, the resulting vector is NaN. Is there a "workaround"? Code:
Location explosive = e.getEntity().getLocation().getBlock().getLocation().add(0.5D, 0.0D, 0.5D);
Vector explosiveVec = explosive.toVector();
Vector glassVec = b.getLocation().add(0.5D, 0.0D, 0.5F).toVector();
Vector dirVec = glassVec.subtract(explosiveVec).normalize();
Vector up = new Vector(0.0D, 1.0D, 0.0D);
Vector orthoRight = up.crossProduct(dirVec).normalize();
b.getLocation().add(dirVec.multiply(3)).getBlock().setType(Material.HARD_CLAY);
b.getLocation().add(orthoRight.multiply(3)).getBlock().setType(Material.GOLD_BLOCK);
Bukkit.broadcastMessage(orthoRight.toString());
Bukkit.broadcastMessage(dirVec.toString());
}
I know this is kind off off-topic but it is directly related to minecraft.
use quaternions
:(
real
you can skip the hard part and just use joml
probably the easier way of converting it around
How to change time shown of Player.spigot().sendMessate(ChatMessageType.ACTION_BAR)?
and how frequently I should use BukkitSheduler.runTastTimer(...) to show actionbar constantly?
You can't
Every couple of ticks should be fine
something like 10-20 ticks?
yes
lmao
I just made the generation time go from 1:08:45 to 0:06:37
I'm really out here busting out the gamer moves
You skipped block changes? 🙂
no I'm using a buckets system instead of just a list of ungenerated chunks and a distance cache
buckets are great
also I think I accidentally dumped distance based checks but that's probably fine?
hm
hmm
lol
Hey,
any way to hide the Disk name from the meta of a disk ItemStack?
add item flags
Which one?
seems to not be ItemFlag.HIDE_ATTRIBUTES nor ItemFlag.HIDE_ADDITIONAL_TOOLTIP
It's probably the hide potion effects
It's a bad name for hiding item specific lore
but that's what it was only used for when it was added to the api
Don't think that one exists any more in 1.21
You sure it's neither of the two?
tried with:
itemMeta.addItemFlags(
ItemFlag.HIDE_ENCHANTS,
ItemFlag.HIDE_DYE,
ItemFlag.HIDE_DESTROYS,
ItemFlag.HIDE_ARMOR_TRIM,
ItemFlag.HIDE_PLACED_ON,
ItemFlag.HIDE_UNBREAKABLE,
ItemFlag.HIDE_ATTRIBUTES,
ItemFlag.HIDE_ADDITIONAL_TOOLTIP
);
None seem to hide it 😛
ItemMeta is just so cursed post component switch
See if there's some component thing to hide it
Hey, i want to make an API for interacting with the server through http requests and im wondering... how can i embed a spring boot application into a minecraft plugin
ah right the new component system seems to have gotten rid of the old hide flags nbt
so there might not be a suitable replacement for that specific lore
any pointers on where I start with the component system? not sure iv ever used that before
It's just the new way Mojang has implemented nbt tags
You can read about it on the Minecraft wiki and in the 1.21 release notes
oh 1.20.5 release notes*
Data components, or simply components, are structured data used to define and store various properties. They are used on items, where they are referred as item components or item stack components, and block entities, partially replacing NBT format.
Data components are used in various places, including the player's inventory, container block enti...
Alright so I figured out how to do it
Sadly I think the API is missing methods for it
oh nvm it has it
declaration: package: org.bukkit.inventory.meta.components, interface: JukeboxPlayableComponent
Use this component and set the song and show in tooltip to false
Do note you must specify a song for it to play or it will complain
so get components from meta,
cast to JukeboxPlayableComponent and set the ShowInTooltip
I'm not entierly sure how the new api works
I haven't made a plugin in over a year
Im just returning from about the same time and updating some of mine 😄
appreciate the help none the less
That github repo has instructions on how to do so
Like will i add it as a file?
Or should i make it into .jar
Plugins are jar files
You need to compile that plugin from the source code using the instructions in the project
so this exists, but how do I get this? what from aha
maybe try the get method in ItemMeta for it?
I think i figured it out thx
OH, I see aha,
itemMeta.getJukeboxPlayable() lol
I was blind looking for something that returns a components object or similar
I feel like it'd be so much simpler if the components had some static builder instead
because I feel like its somewhat unintuitive you'd need to use the get method if its not set
getComponent(class) would be easier to find
also would also save a whole bunch of getters from the code?
I was expecting something along the lines of:
ItemComponents components = itemMeta.getComponents()
if(components instanceof JukeboxPlayable jukebox){
jukebox.setWhatever()
}
Not sure how the backing implementation looks like
so idk if would be possible to add
If you're using paper you have event.hasChangedPosition
Otherwise just compare xyz values
By, for example, subtracting to and from and checking the length against a known epsilon
umm can i check if fromX == toX && fromY = toY && fromZ == toZ?
//Set the vanilla component to hide the disc text
JukeboxPlayableComponent jukeboxComponent = itemMeta.getJukeboxPlayable();
if(jukeboxComponent != null){
jukeboxComponent.setShowInTooltip(false);
itemMeta.setJukeboxPlayable(jukeboxComponent);
}
Seems to work for what I need 🙂
thank you for the help there, @chrome beacon @river oracle
Hot take but I think itemMeta.setJukeboxPlayable((component) -> component.setShowInTooltip(false)); would be heat
itemMeta.setComponent(JukeboxPlayableComponent.class, (component) -> component.setShowInTooltip(false));

Hello! How to block all ways to fly with elytra. I tried to check if players is flying and gliding but player can stll fly.
My code:
public class PlayerGlidingListener implements Listener {
@EventHandler
public void onGliding(PlayerToggleFlightEvent e) {
Player player = e.getPlayer();
if (player.isFlying()) {
ItemStack chestplate = player.getInventory().getChestplate();
if (chestplate != null && chestplate.getType() == Material.ELYTRA) {
ChatUtil.sendConfigMessage(player, "error.no_elytra");
e.setCancelled(true);
}
}
}
}
The player toggle flight event isn't for using an elytra is for if someone toggles flight given by a /fly plugin or creative
Tried to find another event but found only this. Is there any better event?
There's a toggle glide event
Players can still sort of glide a little bit even if it's cancelled, but that's just a client thing that you can't really prevent
Found, thanks.
download more ram
Does someone know why this timer isn't being exact? (It is to show how long a player needs to fish)
if (e.getState() == PlayerFishEvent.State.FISHING) {
//Player cast the rod
plugin.getFishingUtils().fastRod(e, itemStack);
FishHook hook = e.getHook();
hook.setCustomNameVisible(true);
int totalTimeMs = hook.getMinWaitTime() * 50;
new BukkitRunnable() {
int time = totalTimeMs;
public void run() {
if (time <= 0 || hook.isDead()) {
hook.setCustomName(ChatColor.translateAlternateColorCodes('&', "&a0.000"));
this.cancel();
return;
}
int seconds = time / 1000;
int milliseconds = time % 1000;
String newTimeDisplay = ChatColor.translateAlternateColorCodes('&', "&a" + seconds + "." + String
.format("%03d", milliseconds));
hook.setCustomName(newTimeDisplay);
time -= 50;
if (hook.isDead() || hook.getLocation() == null)
this.cancel();
}
}.runTaskTimer(plugin, 0L, 1L);
}```
Is this without any plugins? 💀
it's running a pretty intense modular generation system
I'm figuring out benchmarks for what are safe sizes for different amounts of ram
oh right
I just realized I think this might be entirely uncancellable
let's try with 50gb
guys i want to make it so that it checks that the right item is in a custom gui slot and that it has the right stack size how do i do that
i want it to check for 8 iron ingots in the first item
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/Inventory.html#getItem(int)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemStack.html#getType()
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemStack.html#getAmount()
declaration: package: org.bukkit.inventory, class: ItemStack
declaration: package: org.bukkit.inventory, interface: Inventory
so how would i type a line that checks for the 'stack size' of whatever slot
Assuming you already have the inventory you want to check
ItemStack stack = inventory.getItem(0);
if (stack.getAmount() == 8 && stack.getType() == Material.IRON_BARS) {
// do something
}
thank youu
What do you mean by "not being exact ?"
So when the timer is 0, I haven't fished yet
gotta say initializing 96k data points and running very basic math on them is turning out to be absolutely glacially slow
oh hell yeah we're cooking
wait my math must be wrong this isn't 96k
ah yeah
No but
it's 96 million data points
I set the min and máx time as the same
yeah that makes more sense
The method fastRod does set min and max time as the same
Did you try to check the exact time to have to wait to fish ?
I mean, maybe I am blind but didn't find any method that did that
Which was strange for me
Yeah you have to do it yourself
Oh
Probably because you catch a fish on some ticks randomly
And the duration is not determined when you start fishing
Should I set it myself or how would it be
You can code a little listener to count how many ticks you have between when you start fishing and when you catch the fish
For debugging purposes
Then you can check if the fish time is correctly set
If it is, then just use the duration you specify as parameter inside your runnable instead of getting it directly from the hook
I tried but didn't work
You are sure the duration is correctly set ?
And the end of the method is correctly reached?
It is
Maybe this duration refer to the amount of ticks you have to wait before the fishing animation start
Well something does not work
Yeah
Regardless of the timer
I think the timer is every time the same
- Something ms if using fast Rod
- Something if don't
On the first video it starts at 2.5 and on the other one at 4
Bc the second is without fast Rod
Oh
But it doesn't change
Well, the second one symply can't work
As you will have a random offset on top of the min duration
If you use fast rod, you don't have always the same offset between the end of the timer and the moment you catch the fish, do you ?
I think I'll just use nms
could it be the hook chance interfering with your system?
nvm on that, has no effect in newer minecraft versions
I'm using 1.20.4
are you taking the lure time into account?
there seems to be a little time span, between the wait time (a fish appearing) and luring (the fish biting the hook)
oh
thats probably where your time difference is coming from
also instead of checking if the hook is dead, rather check the hookstate first
yeah, since that seems to represent the entire fishing time
Okay thanks
but dont forget the max lure time
you could just set it to 0, and everything would time up perfectly, but that removes the fish approaching the hook
I prefer the approach ig
sure, then this should sum it up
give it a shot
Yeah, 1s need to set up java version 💀
It did work this time
nice
However, do you know if it would be possible to get the exact wait time?
If the player doesn't have the fast rod enchant I want a random ms
max - min 🤔
i mean, what do you understand under "exact"? with min and max being the same the fish will always appear at the same time i suppose
Yeah, but if the min and max is not the same
Which is vanilla minecraft
you could check the server code and see how the time, when the fish is biting, is determined
Isn't it a random tick?
a random moment between the min and max yeah
but somewhere in the code the "activation time" has to be determined
basically randomly chosen
but you could also just take the vanilla min and max and choose the random point urself, then setting the min and max to that
by that you know the exact time and its still random
👍
guys i want to make translate message with colors if player have permission creusa.yetkili.sohbet.color but i cant do
how can i do?
no
okay
i know how to translate colors i cant do that thing
basically, there are four options
- Learn a scripting language such as methodscript, and do it there.
- Find an out of the box plugin solution you can configure to do that.
- Learn java and make a plugin to do it.
- Pay someone to do one of the three above.
Something like permission based coloured translation requires at least some basic level of coding knowledge
Not much, but it is the type of question people will usually avoid answering since it is fundamental enough to likely start a spoon feeding chain
^
his problem is not, that its not working. its, that he doesn't understand, what someone else did for him
In this case, I think 1 would probably be the best solution
since it simplifies a lot of the problems and since this is a fairly simple request
funny how people think they can just feed ai with their idea and they will get the perfect solution in return
coding is luckily way more than that
or just use some chat plugin's colour perms
give it a few years
I think the main restriction on that atm is hardware
oh dont get me wrong, AI is great as a co-dev. but only if you know what you and your co-dev is doing
when we can train stuff a few hundred times deeper, it can probably handle most coding tasks
the only thing that stops "make a factions style plugin" from being a viable prompt, especially given that the entirety of gh is a training dataset, is probably just computation limitations
yeah, then there will be no positions for devs anymore, but for AI prompt engineers
I imagine that will be the state in a couple of decades
sadly
sooner
Yep, I'd say under 10, but very soon
Probably at least 20 years away from "build a spawn for my minecraft factions server"
lol nah, you can already do that
not well
very well
or "find and fix the memory leak in the server implementation found at this ip, this username, with this key"
just make your own model, feed it everything minecraft related, a few maps and give it guidelines like "make it an entry hall" or "symmetric"
it is not currently anywhere close to the level of professional builders
the game is just too finicky for current models to handle
ofc not, since the maschines dont have the creativity yet
same for problem solving
its basically a checklist
how to make nicknsmes invisible
Hey, im still having problems compiling my plugin? Any helphttps://pastecode.io/s/5fr7ns9p
?paste your pom
that would be very easy with the current tech
it is just that nobody cares to collect a dataset and make a model specifically for that
the main issue is the size of data dataset required
if we take everything ever uploaded to planetminecraft, and use labels added on planetminecraft, I doubt that it would be enough for current hardware to train
eh, I think the data in planetminecraft would be plenty, but I can see your point
still, that's only if we're thinking of training a model from the start, it would require way less data to train (or rather, fine-tune) a multimodal to achieve it reliably
I think the best thing would be to make a reCAPTCHA type thing
get every world ever
identify objects in the worlds
feed it to users to identify what is in the photo
would probably hold off bots for a few months as well
same way we trained most image recognition algorithms
use like minerender or something
A lot of stuff on planet Minecraft is very low effort tho
Idk if that would help the model
that might matter for the little details, but it'd still help constructing the weights for the overall concept of a "minecraft structure"
that basically already exists
you can get claude to build shit in minecraft by giving it a basic api
I mean, yeah. But not a whole spawn
it should be able to work at a big scale to be of any use at all
that isn't too bad actually
I think we are at the stage where captcha training would be viable
could also do "which wall is better"
"which island is better"\
stuff like that until the components are done
then "which of the following are picnic tables"
would be funny if there was a jean-claude, only building statues with massive biceps
help
the exception already tells you everything
Make sure you have kotlin-reflect.jar in the classpath
where is the classpath
lol
no one uses it thats the problem
The classpath is not Kotlin specific
There are people who use kotlin, and they are very vocal and adamant that everyone else on the planet should also be using kotlin.
its open source
that's not why we point it out
ive seen the code for it before and refuse to touch it, contact the author
the author is like dead
not really
but like the plugin is for 2 years
Scoreboard teams with packets examples?
how to make nicknsmes invisible
Is there a way to get entity by selectors using plugin?
Like I want to create command that can use selectors
@e @a etc.
Yes. Bukkit#selectEntities()
Thanks
its an issue with the reflection,unless you can fix it yourself no one here will fix it for you ur gonna have to pay someone to fix it
ok
does anyone know a multimap cache collection that i could use? im using an invite system and each player can have their own invites that expire
what exactly is a selector?
@a, @s, @e, etc
oh right
Guava has a Cache package so you could use that. You'd probably want it to expire after access
for (double angle = 0; angle <= Math.PI * 10; angle += 0.35) {
double x1 = radius * Math.cos(angle);
double z1 = radius * Math.sin(angle);
double y = (angle / (2 * Math.PI)) * ySeparation;
Location tempLoc1 = loc.clone().add(x1, y, z1);
final Location particleLocation1 = tempLoc1.clone();
new BukkitRunnable() {
public void run() {
player.getWorld().spawnParticle(Particle.FLAME, particleLocation1, 0);
}
}.runTaskLater(Main.getInstancia(), delay);
delay += 1;
}
Can someone help me with this? i wanna make it rotate with player pitch and yaw but idk how
or even better, Caffeine
Yes but Bukkit doesn't shade Caffeine, so
If you're willing to either shade in Caffeine or use the libraries system, then sure. But otherwise, Bukkit already has Guava at runtime
thing is there isnt anything built in that supports caching the values so they expire after some time for a multimap, you'd have to create it yourself
like the Cache works but single value
Yes it would have to be a Cache of a Collection
Yea
That's why I said expire on access, so you can get it but it won't expire if you access it later
only boosters
and mods because we're cool 
what do you mean rotate with the player pitch and yaw, you want the elipsis to follow the player's POV?
you mean a real day or a minecraft day
exactly, sorry if i couldn't explain right
well, the yaw would be the x, z and the pitch would be the y. Given that pitch and yaw are in degrees, you would have to convert them to the respective x, y, z components by getting the cos and sin of these and then multiply the x, y, z components by the old values (the ones you already calculated there)
i suck @ maths but ig i could do smth
I don't think I can quite explain it right with words lol, basically this: newX = x1 * cos(yaw) + z1 * sin(yaw), then same for newZ except it you'd negate x1 and invert the position of sin and cos
ah, you have to convert the yaw and pitch to radians, since they're in degrees. Don't forget about that
does anyone know if its possible to run an EXE file inside a minecraft server
like i wanna use my minecraft server to host other stuff other than a minecraft server
why? cuz i already have many points in the minecraft server host im using and i dont wanna spend money on a normal server host
okok thx
☠️
yes
#help-server btw
nobody responded to me there
saw some people active here
so
lol u spamming in different channels
what kinda logic is that
:)
nobody is going to help you exploit a server host bro
if you buy an mc server from a host its just an mc server but if you buy a dedi or vps you can run whatever you want
u using a channel of development for getting help cuz "it's more active"
it isnt exploiting when you pay for it
u r paying for minecraft host
it is exploiting when you aren't using it for the purpose it was made
there is this thing called "usage terms and conditions"
ok lemme check them then
this 🔼
this 🔼 too
it honestly shocks me how people think they can get away with this lol
schedule a timer task and check when World#getFullTime reaches 0 ig
Ok so ive been making a crafting ui and slot 16 is supposed to be the result slot but the issue is if the player tries to put something into the result slot and they try hard enough the item will get deleted and if i make it cancel the event for clicking on slot 16 then you cant take the result out after crafting, any ideas how to fix
just stop wasting money on a minecraft-specific host and buy a dedi or VPS where you can do whatever you want
exaroton cheap
other stuff no cheap
ive been using it, seems pretty cheap to me
this is only the listener for the UI
i love the fact exaroton doesnt say what specs the systems have
it is paid aternos basically, shitty shared host
you get what you pay for
exactly
totally agree
emily porfavor actualiza el resourcepack bypass a la 1.21.1 jajaj
nobody uses exaroton lol
lol ft
allá le actualizan, no juego más
Like, seriously, I'd rather just use aternos instead
i feel like a lot of people do and dont realise how bad it is
JSHJDshj
Let them suffer, they themselves just didn't research
callate y ayudame con lo de rotar
lol
bro, there's nothing else to help lol
i don't understand anything at all 😭
if you just apply the thing I told you earlier, it should do the thing
fine
var radPitch = Math.toRadians(pitch);
var radYaw = Math.toRadians(yaw);
var pitchCosine = Math.cos(radPitch);
var pitchSine = Math.sin(radPitch);
var yawCosine = Math.cos(radYaw);
var yawSine = Math.sin(radYaw);
var newX = x1 * yawCosine + z1 * yawSine;
var newY = y * pitchCosine - (z1 * yawSine * pitchSine);
var newZ = -x1 * yawSine + z1 * yawCosine;
something like that
i do
there's probably a better way than to apply the rotation to the existing angle tbh, but I can't really come up with one without visualizing it and I don't wanna write a python script just to plot the thing lol
im happy with it
you must be crazy
That's like the least transparent most limited paid host you can choose
eh atleast i dont have to spend 10 dollars a month
There are free hosts better than exaroton lol
i already checked most of them and they were pretty bad
The free host I'm using rn is absolutely better than exaroton, atleast because I'm not limited
which one
Am I supposed to tell everybody where the gold lays
localhost for president
Real
these things arent funny, like just tell me, you dont lose anything from it
Nether host is pretty decent
decent for free standards
hmm seems pretty cheap
Ok so ive been making a crafting ui and slot 16 is supposed to be the result slot but the issue is if the player tries to put something into the result slot and they try hard enough the item will get deleted and if i make it cancel the event for clicking on slot 16 then you cant take the result out after crafting, any ideas how to fix
i mean the free plan^^
plz 🙏
ok
and x1, z1 and y would be my normal loc right?
yep
also, now that I look at it, multiple run later tasks inside a for loop is crazy, use a task timer
I mean, I haven't looked at your code yet but why not just cancel the event till there is something in the result slot that you put there
also, is there a reason you're manually handling crafting/smithing/whatever that is instead of using the recipe system?
I have a question is there any plugin that can disable exact enchantment like thorns,sharpness even when its already on the weapon?
not really a #help-development question unless you are making a plugin for that
okey so where can i ask?
#help-server ig
its a 3 slot crafting ui
ill try that
that video isn't embedding, discord moment™️
wait
@sly topaz ive tried that and it still doesnt seem to work
Ask an actual question. no one is going to help you from a crappy video
how can i describe this problem
?
Its your issue so describe it. I can only tell its something about placeholder api
can't make out shit from the video
PlaceholderAPI doesn't do recursive placeholders as far as I'm aware
can i make colored light?
if placeholder's output is placeholder its not parse output
you would have to re-parse it if you are adding placeholder. If it can even do that
That's very hard if not impossible to do
if output gives placeholder again?
Keep looping until the string stops changing
with any method?
or
datapacks
You can make a mod
ah
And that mod needs to be installed on the client
Datapacks are far more limited than plugins
You can do some fancy stuff with shaders
I think
JNNGL is a wizard with vanilla shaders
completely broken in next update apparently
anyone happen to know the equivelant of EntityPortalEnterEvent for 1.8
found it: PlayerPortalEvent
1.8 :hollow:
I implemented a gcf function is this optimal?
fun gcf(first: Int, second: Int): Int {
var fr = max(first, second)
var sr = fr % min(first, second)
while (fr % sr != 0) {
val temp = sr
sr = fr % sr
fr = temp
}
return sr
}
I kinda just winged it and guessed what would be good based off of euclid's algorithm
yo
is there any place I can get support about a plugin I bought if the plugin owner is not answered, question about refund
How would I implement a social media verification system, would springboot socials be a viable option, and would it be possible to code a plugin without using a website?