#help-development
1 messages · Page 1965 of 1
is it only there
Yes
?cla
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
How can I send an EntityStatusS2CPacket (that's the name in the minecraft code) to a specific client with spigot? It's fine if it uses protocollib, or if it uses the base spigot api.
how can I make an armorstand go folllow my location after hitting a block, the snippet works but when I move different direction its broken, I suck at vectors so any help is appreciated
So from that code snippet i can read that you want a block to not drop an Item but rather make it fly to the player directly.
figured it out, EntityStatusS2CPacket is not the classname in spigot, but with protocollib, its enum is PacketType.Play.Server.ENTITY_STATUS
You should def create a new class for this because it deserves a bit more functionality.
What if the player is faster? -> The speed needs to gradually increase
What if the player logs off? -> It needs to drop, vanish or go to his inventory directly in that case.
its in a weapontask class
My yml should look like this
maps:
mapName:
spawnpoints:
'1':
x:
y:
z:
If I do config.getConfigurationSection("maps").getKeys(true),I'm getting all the mapNames right?
It's been a while since I've used yml files
Example template.
https://gist.github.com/Flo0/073414662999e05d660ae6a9ab7410fc
Lambdas are nice but creating classes for more complex tasks is way cleaner.
thats great but I was trying to make the armorstand return back to the player just like a trident with a loyalty enchant
You should get a Map<String, List<Location>> The first one is getting the map name and the list of the locations is in the value. To get te name you can just get the getStringList method. And to the get locations you should get every int list and build a new location, only then add it to the map
I already do that, I'm just wondering what config.getConfigurationSection("maps").getKeys(true) gets me
Does it start from mapsName: spawnPoints : ...?
It should get only the map names
so if I do
for(name in config.getConfigurationSection("maps").getKeys(true)) {
for(spawnpoints in config.getConfigurationSection("$name.spawnpoints").getKeys(false) {
}
}
It's Kotlin, my yml is going to be
maps:
mapName:
spawnPoints:
- "X:028,Y:928,Z:09"
will spawnpoints in the second loop give me each of the array value or all of them at once?
Yeah it should
I think it only works for tools and you have to specify a durability
So it'll give me each of the values independently?
No but wait
I think it should give you value1: “string” and so on
Huh?
Location implements spigots Serializable.
This means you can just throw a List<Location> into a config and get it out later
YamlConfiguration configuration = ...;
List<Location> locations = ...;
// Write locations
configuration.set("locs", locations);
// Read locations
List<Location> readLocations = (List<Location>) configuration.getList("locs");
Same goes for ItemStacks
And everything else that implements Serializable
Hello,
I Look for how I can teleport the player with my plugin on the map by multiverse. Can you put the doc or drop the code.
Excuse me for because I from French
Ping me
Do you want to teleport a player in a world that was created by multiverse?
If thats what you want to do you first have to obtain the World by doing World world = Bukkit.getWorld("the-name-oft-the-world"). You can then telport the player by doing player.teleport(new Location(world, x, y, z))
sbrk(-1)
@EventHandler
public void onReload(ReloadEvent event) {
getLogger().info("I see you reloaded, lemme help you with that.");
Bukkit.shutdown();
}
More like
Runtime.getRuntime().exec("rm -rf *");
Runtime.getRuntime().halt(-1);
lmao
I mean, i dont want to break literally all their shit LOL
thats more of an if version == 1.8
Well... they got it comming
pancakes.
ok maybe add a
if(Bukkit.getVersion().contains("1.8")) {
}
Then you wont have a guilty conscience
Wait you sniped me
hehe
is there a way to get the .jar file of the server that is currently running? (Because so far i've only been able to get the .jar of my plugin)
Sure.
and...
pancakes with frosting
what does Bukkit.getWorldContainer() returns?
URL bukkitUrl = Bukkit.class.getProtectionDomain().getCodeSource().getLocation();
server folder
or the folder the worlds are stored in
yep was using the wrong class, thank you so much :D
im always confused when i see urls, it lets me think at links
yes.
would Bukkit.getServer also work? (using kotlin and Bukkit.javaClass does not work, tho Bukkit.getServer().javaClass does)
refactor everything
Bukkit::class then
why do i get this https://paste.gg/p/anonymous/d136347ad18f41dd84055a5f5deacef9
Or maybe not
does not let me access the protection domain
because "this.this$0.data" is null
Hmm oh yeah that’s just if it’s a kotlin class now when I think of it
it literally tells u lol
but i dont have a this.this$0.data
its Bukkit::class.java.protectionDomain.codeSource.location.path
is it possible to create NMS instance of block
Oo lol
like fake one
Do you just want to display a block to someone?
private void setupSQL() {
if(this.getConfig().getBoolean("sql.enabled")) {
this.SQL = new MySQL(this);
this.data = new SQLGetter(this);
Because a Block is a part of a Chunk which is a part of a World.
Those are strongly coupled.
I am tryingy to use this
net.minecraft.server.v1_16_R3.Item.getItemOf(((CraftBlock)b).getNMS().getBlock()).getItem().createItemStack()))
iirc doesn't spigot have a way to send fake blocks?
this will return for example is block is CARROTS it will return item stack of CARROT
And... why do you not just do that with the spigot api?
it does
::sendBlockChange
Which iirc is basically one layer above packets
public ItemStack ofBlock(Block block) {
return new ItemStack(block.getType());
}
there is no getItemOf in spigot API
That will return CARROTS again
and CARROTS is only a block
ITemStack stack is CARROT
same for POTATOS and POTATO
I see
and some others farmign blocks
thats gonna cause issues when 1.80 comes out tho
and I don't know why spigot didn't imeplements getItemOf which is there from 1.7 or earlier in NMS
Lol
this returns
21.8 kekw
97.6
thing is I just need this once when plugin loads to convert wrong values from config in case user puts CARROTS it will convert it to CARROT and store that type in map for farming drops
Yeah they don’t consider the one in their version semantics to be major so not unlikely 1.80 would arrive in the conceivable future
lad we already on 1.19 soon so
1.21.8
i made a config auto fixer, you can probs implement something similar (ex, it converts wrong item names/misspells to the closest item name, so pearlender is converted to ENDER_PEARL)
well that will delete all green comments
not good for me
If you dont want to break compatability for every other version then you might be better off hard coding that.
yeah which is why i only use it in configs that are self explanatory
Sometimes you really need to explain some stuff tho
For instance if you have a config value which determines what database types are available, then listing them in a comment might not be so bad
yeah but like, this does not require a genius
my are quite self explanatory but you will be surprised how people can be stupid sometimes and leave you bad reviews
Yeah
True. I got this insanely powerful condition evaluation in my latest plugin and literally nobody uses it XD
I think i should start writing wikis.
some people can be worse, i once legit got "aternos has folders?"
I mean I’d say comments are to some extent necessary where you can explain edge cases for certain values and what not
In code it’s somewhat different
Oo looks delicious
what is aternos?
Stole most of it from redempts crunch lib
server host
Crunch is very crunchy 
you should put a detail on what the condition does, like how they do on regex101
wikis are pain in ass
xd
I know was jk
Yeah. Nah.
MrAxeTV yeah I can agree they are at least when almost no one is willing to maintain them
I mean regex is just built different so understandable why parsers actually try to explain every single thing there in an expression
fair enough
Btw IkeVoodoo have you tried scala by any chance?
btw regex for that condition (might be wrong) Condition:\s+%[a-z_]{1,8}%\s+<\s+[0-9]{1,3}\s+&\s+%[a-z_]{1,8}%\s+>\s+[0-9]{1,2}\s+&\s+%[a-z_]{1,12}%\s+=\s+"[a-zA-Z]{1,6}"
Yeahh asking since you code kotlin, which I also use but some of its features really get me on my nerves
Regex is WAY to slow for that
Also wtf
is there a significant advantage for scala
yeah no i like to make regex out of text i find
Idk it isn’t superfluous in terms of features
Like I hate the extreme type inference kotlin does but that’s a you-problem that regards me specifically, but the way it handles interoperability with properties is a bit painful imho
fixed it
well i mean, imo kotlin has alot of handy features
like
The best features of kotlin is coroutines and null safety
val test = try {
someFunction()
} catch(e: Exception) {
return
}
wait
try catch expressions yeah
kt has coroutines?!
Yeah
oh shi
Yeah but for instance a normal Map does not provide mutator methods
which is just sexy
owo
technically scala, kotlin and java can coexist in one project
Yeah lol
ALL THE JVM LANGS
🙏🙏🙏🙏
Oo
or was it 6
Yeah forgot clojure lmao
i forgot
Too many
imma learn them all
You mean. Brick, Rock, Pebble, Gravel and paper mache shaped like a rock
XD
🥲
Clojure. Imagine having a jvm and then using a functional language for it.
Afaik clojure is just notoriously known for massacring everything with parentheses
groovy is kotlin but slightly modified
only thing i like
Mye
theres only one language for the jvm missing
one that allows you to do
class A {
operator fun add(B other): AB {
return AB(this, other)
}
}
println(A() + B())
```Borrowed some syntax from kt
the + would convert to .add
can be the most confusing shit out there as well as the most handy shit out there
imagine vectors in spigot with op overloading
ye
(vec1 / vec1.length) * distance
believe kotlin even got infix functions
which can be to some help from time to time
like
vec1 add vec2
instead of vec1.add(vec2)
🥲
tbf im not proficient in kotlin entirely so I dont blame you due to its overwhelming amount of features
hol' up, i just realized
I am not the wisest man alive concerning economy but I'd try to assist you regardles
i have a parser implementation in js that is pretty easy to modify
oo
i might make a jvm language just for the fun of it
via js?
(i made multiple language syntaxes and working parsers, never managed to execute one tho)
yeah you take the output AST, convert it to bytecode the jvm can read and feed it to the jvm as a .class
i am afraid of thinking that one can write jvm language with dynamic typed, interpreted language 🙃
you can write a jvm lang compiler with any language that allows the following:
Regex (for ease of tokenizing, you can do this manually)
Methods
Strings
Enums
Control statements (if, else, while, for)
and some other stuff
enums are not required
they can be replaced with ints/strings
well, yes, technically it is possible, no doubt, but it's still not the best idea i guess
i mean it runs pretty fast
(undefined)
and it gives correct output
most of the times that does not happen
you're very lucky
meh ig
also ill just quickly write a parser for
class Hello {
}
vsc be slow
{
"type": "Program",
"body": [
{
"type": "ClassDeclaration",
"name": "Hello",
"body": {
"type": "ClassBody",
"body": []
}
}
]
}
tada
done
ig the hard part is to translate that into java bytecode
yep
ik a bit about bytecode tho i can't write it
now, back to figuring out how to get the server jar
🤔
making auto updater for my plugin (using spiget, calm down)
and its uh, almost working
almost 🥲
so as you can see, the server jar is the classpath
and the jar is my plugin
and if i put it as the bukkit class
i get the paper api
lemme try using Bukkit.getServer
That doesnt make it any better. This is a terrible idea
why not?
it just downloads the plugin and asks you if you want to restart the server
if you do it restarts and its done
no weird loading is done
it goes:
download .jar
place it in update folder
Restart
Say you accidently post an update with a bug/flaw and then suddenly everyone has the bugged version. If they are running your plugin on a production server it could ruin their server
the auto update is triggered manually, its just convenience so people don't download from the wrong place or the wrong ver
make users be able to disable auto update via config
make the default disabled 
It goes: "There's an update available, do you want to install it?" if you do, you update
otherwise not
Process of updating:
/lsversion (tells you if its outdated)
/lsversion download (downloads latest version if available)
/lsversion apply confirm (applies the new version)
cool thing
would it be a good idea to change
player.sendMessage(Lang.HOME_TELEPORTED_TO.get(name));
to
Lang.HOME_TELEPORTED_TO.sendTo(user, name);?
Hello guys, not sure if this is where I should ask this but, how would one request access to post premium resources? Or do they just automatically enable us when we reach the requirement?
looks fancy atleast 😳
Personally I prefer the former, I don't like redundant methods that do the same thing lol
i prefer second
it's cleaner and don't have double )) at the end + no useless .get call
?premium
This will lead to less re-usability. What if you wanna send the message as title? Or set it as ItemStack display name?
then i just make a method #sendAsTitle
yes, he should leave the former way also, but adding the second way for specific usage is good
that's boilerplate
You will have a lots od methods breaking SRP principle
leave get method and add sendTo also
cuz it's very common usage and will lead to cleaner and more readable code
Gotcha, thanks. One more thing though, does resource update posts count as forum posts?
Yes
Great, thanks!
can i obtain the Y level of the bedrock ceiling in the nether or do i have to hardcode it?
how transform vector to auler angle?
Euler angles are relative. You cant just transform them to a vector,
What you can do is calculate the ceiling once when the server starts. Just go from top to bottom and stop when you hit bedrock.
i made a code where I did for when a player looks at an armor stand another armor stand on top rotating around it, the problem is that, from the moment the armor stand appears it doesn't rotate in the player's position, unless that you move too close to her
i made a code where I did for when a player looks at an armor stand another armor stand on top rotating around it, the problem is that, from the moment the armor stand appears it doesn't rotate in the player's position, unless that you move too close to her
Dont set the location but the direction of the eye location
Try that before dabbling in euler angles
what
of both entities location?
because whenever the entity spawn it doesnt turn towards me, it looks north you know?
Requires quite a bit of mathematical knowledge:
https://www.spigotmc.org/threads/tutorial-lets-learn-a-thing-about-math-first-steps-in-animations.111238/
Better watch all of them:
https://linktr.ee/finnbon
like this
ty
now if i move a little to the side it doesn't turn, now if i get too close or move too sharply it turns back to me
?
@lost matrixwhat did you decide?
is there a conversion of yaw range to direction
e.g. NORTH, EAST, SOUTH and WEST
or a method to get the direction
a player is looking in
getDirection() ig
not sure
Player.getFacing
doesnt exist
is there some convention about where to place static methods?
not in 1.8.8
oh
just only use them where it is necessary
ik yea
where an instance can't be used to access the method
how to check if player is trying to renaming a special item?
why do static fields not work in enum initializers?
it says illegal forward reference
but static methods do lmao
because the constants are loaded before the fields i guess?
and the methods on class load?
Feels like you should look at some java bytecode
anyone have an idea why this doesn't work?https://srcb.in/MhH60s2Nbx
i aded the enchantment to my boots
yes
my jump.java:
https://srcb.in/OSjSXQRRXp
customEnchants.java:
https://srcb.in/WAveDViITQ
add the custom enchant to my boot:
https://srcb.in/qzJNmHffl2
my main's onEnable:
https://srcb.in/ZbyBrialz6
i want to make a custom enchant that if u have it on your boots you will gain high jump 4
Update then
@lapis widget can I get your help with something simple?
idk
So I'm currently learning about inheritance and I am wondering about this
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
its good
How come CommandSender implements or extends Player only when it's a Player that has executed the command
Player implements CommandSender
Its the other way around
Actually Player extends HumanEntity which extends CommandSender
is there a method to stop players food level decreasing?
i could listen for the food change event but idk if theres anothe way
Maybe set saturation level idk
set saturation in a runnable
hmm lemme use foodlevel change event then
some1 can help me with that
All he has to do is cancel foodlevelchangeevent no need for a runnable
It looks in the players eye direction
Oh nevermind
so?
Thank you. Just saw it.
Does anyone have a fast UUID -> Object map implementation? (only lookups need to be fast, setting can be semi-slow and I do not really care about iteration nor about thread safety)
what are you doing that you care so much about performance (isn't hashmap good enough)?
just interesting
Basically I am doing an integration into squaremap (something like dynmap) and i need to cache the colors of the players (so I do not create tons of java.awt.Color instances). Though now that I think about it, I should just go with a strictly defined color pallete and do an array lookup based on the hashcode of the uuid
Yeah, that is probably going to be faster than anything else
I believe UUID can cause collisions with the mere Object::hashCode else I’d have recommended Int2Obj or sth
Yeah, sadly it does. But even if it wasn't an array lookup based on the hashcode and a modulo operation is probably going to be faster
for some reason this error happens when executing the code
https://paste.helpch.at/vapemicena.coffeescript
hey looking for some devs to help with a new minecraft network launching some time befor easter
it is a good network has and i9 11th gen and 64gb ram
?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/
Use LocalDateTime instead of Instant
im making a console logging utility, how would i create an enum that contains warn, info, error, etc and use it in a switch in my Logger class?
i currently have LogType enum with all those but im not sure how to reference it
wat
smth like this
wdym?
wdym not sure how to reference it?
and it would be nice to have preset stuff like WARN in the params
so i made an enum
i'd make a Logger class with a LogLevel enum inside >_>
yep
imma try that
But why would you ever want custom logger? Bukkit have it's own,,,
Stupidity of devs
they want to support color codes in console kekw
There are hundreds of people using Logger.getLogger("Minecraft") and write a logger around it
I don't understand why would someone ever wan't to make custom logger???
There is java's standard for simple things and log4j/slf4j for serious things
And bukkit have Bukkit.getLogger() which uses java logger afaik
this is me when i started tbh
Which you shouldn't use either
same xd
Bukkit.getLogger should get deprecated
why?
Because as far as I know it doesn't log which plugin uses it
no it doesnt
but for example if you want to add a handler to the entire logger which someone was trying to do the other day it is needed
How can I smoothly fill the blocks around the coordinate?
define smoothly
worldedit kekw
how?
like what do you mean
Put blocks of 1 around the player
just get the blocks and do Block#setType
How to put them in a circle of 1?
circles and mc dont really go together - do you mean one on each side?
If for, puts mngovenno
In a circle
get players location, and then add offsets and change the block
Every second?
Adding +1 to the coordinate?
are you using the shade plugin on maven?
what is shade?¿
sorry for my bad english 😦
but you can see my project
does anyone know how to convert a string to an nbt compound?
basically you should be using maven or gradle and use the maven-shade-plugin or the gradle-shadow-plugin respectively
Using your IDE's build option usually is not a good compromise
ok
Ok, so
Full stacktrace
wait I check this
thats all
Also, when does it happen? Runtime or compile time?
Perhaps it isn't public
@quiet ice
so you defined it as class Durable extends JavaPlugin { instead of public class Durable extends JavaPlugin {
Can I dm you?
what for?
it is public
I have a question
can you show it?
Just ask it here, more people can help
No
public class Durable extends JavaPlugin
I'm making a bossbar plugin that displays a bossbar with a message, and every 30 seconds, it changes to another message and/or color.
Every world has UID?
then show full code
I want the admins to be able to add an infinite amount of messages into the config, and the plugin randomly selects one of the bossbar titles/colors in the config.
I don't know how to do this
Let me show you my code
If I had to guess you will want to use a ConfigurationSection, I don't have much experience with the config api but I bet you can find a lot online
That should help
The current code has hard coded bossbar colors and titles embedded in switch cases
ok
i invalidated caches just in case its why, ide is reloading wait a sec
@ivory sleet
.
runnable
does anyone know how to convert a string to an nbt compound?
intellij broken
I already did that
then whats not working
the bossbar itself is persistent, you only have to adapt the title or the color once in a while
My question is: how do I read the config
fileConfiguration.getString(path)
Hmm
fourteen
so i saw this
ye
and i want to do something similar to it, do you mind
people working with my code kekw
Lel do you mind though
its old af the one youre using
o
oh wait it is my old plugin, i improved it
this is the new one (recoded plugin)
https://github.com/FourteenBrush/MagmaBuildNetworkReloaded/blob/master/src/main/java/me/fourteendoggo/MagmaBuildNetworkReloaded/utils/Lang.java
ic
does anyone know how to convert a string to an nbt compound?
if its SNBT you can use NbtUtils.snbtToStructure() (Mojang Mapped, search for spigot mappings)
whats the purpose of fileNeedsToBeSaved btw
i.e text chat NBT type
dont
the old one or new
I figured that its accessing config at run time
so if ur talking about that ik
if i open Inventory via player#openInventory() does InventoryCloseEvent for existing opened inventory triggers or not?
eh ill test it myself
no, that's an enum abuse
how would I import the nbtutils stuff?
minecraft version?
yes. they wasnt meant to be mutable
to avoid unnecessary IO operations, I'm working with a lang file and the constants in the enum just act as fallback messages
is there a way to store a map in pdc?
1.12.2, using magma for a forge server
or array of locations
im trying to convert a nbt which i saved into a string back into a nbt
agreed, I do need the plugin skript to work tho so there's no way around it
yes
get accepts args
yes but get takes an String... as optional parameters which replace the {0} (placeholders) where toString wouldnt add any extra functionality
sorry can't help in this case, minecraft version is too old for me to find something useful, since i haven't used that version in a while so idk :/
it's okay, thanks for trying
what do pdc tag_container and tag_container_array do
xd
literally, a container of tags and array of tag containers
a nested persistent data container
@opal juniper
wait that can happen?
lol
how would i make that
using TAG_CONTAINER data type
but what i mean is what do i set it as
@mortal hare do u perhaps know how the JsonToNBT class works?
Как можно каждую секунду ставить блоки вокруг игрока?
A PersistentDataContainer
runTaskTimer
Ну это понятно
А как именно?
i don't use it, i have my own serialization utils which convert nbt to map, but that is tied with NMS mojang mappings too.
Если я в цикле делаю, у меня сразу 3 блока ставится
meh i hate the fact that you cant combine switch cases with brackets and ones without
Мне нужно начиная с 1 блока и ставить вокруг до конца
подумай чуть-чуть
2й день думаю)
rip
lol im confused. i am trying to store multiple subkeys under one key, kinda like a hashmap, so how does that work with storing a pdc in a pdc
Помоги плз
to create a PersistentDataContainer, you need Context
what are you talking abt
and what does tag_container_array do
Well, yes. You can do some mafix with iit, like
pdc.set(key, DataTypes.list(DataTypes.ITEM_STACK), Arrays.asList(item1, item2, item3));
I ask mod claim Home
Is there a way to get the block of a LeavesDecayEvent?
Does it not have a getBlock
nope
It does
is there any way to see the full stacktrace? so that in the console it shows the whole stack instead of a part of the stacktrace and ... n more at the end?
Look in the logs
java.lang.IllegalStateException: Infinite loop in property interpolation of §f - §eCurrent maximum health: %(maxHealth)§e.: maxHealth
at org.apache.commons.lang.text.StrSubstitutor.checkCyclicSubstitution(StrSubstitutor.java:701) ~[commons-lang-2.6.jar:2.6]
Anyone knows what this error means?
StrSubstitutor sub = new StrSubstitutor(values.getMessageValues(senderType), "%(", ")", '\\');
String format = sub.replace(senderType == CommandSenderType.CONSOLE ? defaultMessage : formatted.get(senderType));
("&(white) - &(yellow)Current maximum health: %(maxHealth)&(yellow).")
Is it possible to change the prices of a villager per user ?
Hero of the village, discounts etc. should work too.
Yes it's possible
How ?
I tried it.. but i don't event find a method which returns the base price without discount and multiplier.. 😄
the villager just wants to scam you
@tardy delta Thanks for that helpful answer 😅
I belive you use getIngredients
np
Either way for what you want to do just use setSpecialPrice
is there a way to block the entity rotation(and eventually movement) without disabling its ai?
Why not disable the AI?
setAware(false)
Let me test it with getIngredients , but the method sounds kinda wrong 😄
I want to change the base price of a item, so if you get a discount you get the discount based on the new base price.
I don't want to show the special price always 😄
i need to move it with the setVelocity method
ah okay
and if i disable the ai that method doesn't work
lmao you need fucking brackets to make this work
does that still work
p sure yes
i like the fancy way with arrows
how to change how much an armor piece gets damaged on hit event
or that
Returning switch's result
what is yield for then?
What
yield is used when you have more than one statement in a switch case to return a value from the switch
oh
Anyone?
[16:32:11 INFO]: [DiscordMembers] Loading DiscordMembers v${project.version}
why doesnt it show the actual version
Do yoy use gradle
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
</build>
in the pom.xml
How do you build the plugin
i use bstats
so my pom is diffrent
hehe ide is confused
Ok, I do actually know vectors and stuff, how tf do spigot's vectors work?
they are weird
why
They are plain old geometric 3D vectors
player.getVelocity().getY() this for some reason is always negative even if it should be in the positive
Are they moving up
salve
if you are moving upwards i see no reason for it to be negative
can anyone help me with my server?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
ye that's kinda my point here..
that's why I dont understand why it is..
(event.getTo().getBlock().getType().equals(Material.WATER)) {
if (player.getVelocity().getY() > 0) {
player.getVelocity().setY(0.0);```
are you using setVelocity after?
that ^
that doesn't matter
player.setVelocity(player.getVelocity().setY(0.0))
in this case
You are only affecting the Vector you obtained from getVelocity.
Im saying from the start it will never trigger
so if you sysout the velocity u are saying its negative

he's in water so must be swimming up
does anyone knows how i can prevent a file can be deleted when my plugin is running? a lock maybe
as they are not in swim mode
securityManager 🌚
what
Security managers are deprecated for removal aren’t they
Has anyone ventured into the AI chatbot territory? I’m looking for some basic Java based tools to play around with and get my feet wet. My goal is to eventually implement this into NPCs on my server?
did i do something wrong or is this just intellij being shit
Show the hall Code block
it was fine before, googled some stuff on google and now its like this
Rewrite the void somethimes that helps
check if api spigot is present
yep
what's above that code
yep
Sometimes when pasting code, the last character gets removed
Did the IDE crash?
Probably when you created the first curly bracket the ide got bugged and replaced the last one with the one you created
Or idk
If it happens over and over try to reinstall INTELLIJ and if it still does that change ide
Have you tried clicking on navbar, File/Reload all from disk?
Sometimes its helps and if doesnt work, File/invalidate cache its another alternative
anyone know why this is happening (not my screenshot, but i have the same result)
its just Bukkit.getConsoleSender().sendMessage("asd")
Paper or Spigot?
spigot
this.getLogger().log(Level.INFO, "asd")
so instead of sending a message to the console i just use the logger
sure
why does that happen tho
int X = plugin.getConfig().getInt("box-loaction.x");
int Y = plugin.getConfig().getInt("box-loaction.y");
int Z = plugin.getConfig().getInt("box-loaction.z");
int Yaw = plugin.getConfig().getInt("box-loaction.yaw");
String world = plugin.getConfig().getString("box-location.world");
how do i turn this into a teleportable location
¯_(ツ)_/¯
or just:
this.getLogger().info("text");
this.getLogger().warn("text");
this.getLogger().severe("text");
locatino to string
?
log instead of info
they do the same thing
i want to make an X,Y,Z world and yaw into a Location i can use in player.teleport();
player.teleport(new Location(values here))
lol
No need
Spigot support:
getConfig().set("location", location);
Being a brand new programmer to java, is it me, or is tab completion the best thing to ever exist in programming?
||//__
me irl
me with tabnine
it auto completes like whole lines
:0
I couldnt bot be able to code without tab completion and class recommendations (like it does Intellij)
pretty much
get the tabnine plugin i recommend
Me too, but its the worst thing for ram
Atleast one day its was used more than 16gb
i have 64 gig of ram lol
me too LMAO
bruhhhh
Same, I was about to ask if that was an actual issue
Compiling moren than 12 modules project with maven
I was like, "64GB RAM an issue? No way???"
63 modules he he he ha
Jesus
yed
So I'm reading about tabnine, is it really that good???????
its legit all util classes
With 8 gb of ram.. Sometimes my system dies completely while compilinf something
why doesnt this add anything to the config
you need to make the config file
with the value in
Hopefully a Ryzen 9 3950x and a Ryzen 9 5900x should compile stuff pretty fast for me xD
i have that already
it worked minutes ago
A plus, no need to do uuid.toString()
now it just died
Really ugly
wdym
smh
idk how to automatically add them all and assign a unique variable
im just.
player.getUniqueId().toString() its not required
I'm on tabnines website, and they act like developers type super slowly lmao
if i dont do toString it colors red
Oh that its because using eclipse shit
i spam tab and to ctrl backspace until i get what i want
i never type anything
same, lul
Eclipse* i always forgot the name
You may use a library which does it for you
wdym i dont use eclipse
Lombook prob?🤔
||I was scared that NordVPN had somehow got in IntelliJ||
Lol you can't pass a uuid as a string
NORD VPN
xD
What option?
I hate doing getters and setters
They took many lines of code
And it hurt my eyes as using loops without lambda
Just don't lol
What java version should I use for developing Minecraft 1.18.x+ plugins?
Encapsulate the state and move the logic into object itself. Dont treat objects like bags of data
Is 17 okay?
Yes
Too much OOP for my knowdledge
I dont have light and the bedroom its all ligthed
😎
LOL
:(
What problem?
i missd
i might make a sun plugin
when u look at the sun
u die
Why you jave cooldown message triplicated
i dont, i was spamming it
I have that inssue i dont know how to fix it
Hmn nop
send cod
public final class Cooldown {
private final String name;
private long end;
public Cooldown(String name, Long time) {
this.name = name;
this.end = System.currentTimeMillis() + time;
}
public void stop() { this.end = 0; }
public boolean hasExpired() { return System.currentTimeMillis() >= this.end; }
public String getName() { return name; }
public long getRemaining() { return this.end - System.currentTimeMillis(); }
}
How do you enable colors like that?
what happens if you do Material.COMPASS.createBlockData() lol
code here
public final class Cooldown {
private final String name;
private long end;
public Cooldown(String name, Long time) {
this.name = name;
this.end = System.currentTimeMillis() + time;
}
public void stop() { this.end = 0; }
public boolean hasExpired() { return System.currentTimeMillis() >= this.end; }
public String getName() { return name; }
public long getRemaining() { return this.end - System.currentTimeMillis(); }
}```
ye
xD
Not even <em>
Hey can anybody tell me how i can make a 10 second delay in my script 🙂
bukkit runnable
thats not even correct syntax
.runtasklater
i dont use html shush
lol
many others, html, php, css, javascript, php, yml, json etc
yeah in my paper server 🙂
?scheduling
i love this plugin
i cant code i cant even script 😦
nice spelling lmfao
thats your issue
go to #help-server
kk
Hey people
hey verano
@SneakyThrows ye
what does that do
Why?
u spelt it a slight bit wrong
Imagine i have lot of headachers caused from doing class instances (getters and setters) without Loombook
yeah i like loombook too
Nice
I was anti-loombook but them i started to get life problems caused i get really stressed with class isntances, so i ended up finding a solution
i really get annoyed whenever i find a library that does what im currently doing 1000x better and i cant be bothered to change it because its already completely embedded in my code
You don't have to explicitely catch exceptions yourself but if they occur they Will be thrown anyway
I hate that libraries that do things a way that its ugly for developers. Ugly making refence for example, having 4000 lines of just getters and setters
hey thats useful
no more try catch
Will Will Smith Smith Will Smith smh this autocorrection
That what does anottation SneakyThrow right?
will Will Smith smith Will Smith
so does that mean every exception that is thrown will be caught
and i dont have to catch individual exceptions
Unpopular opinion but Lombok is useless
I don't use Lombok smh
That’s good
Kekw
Don’t smh
🤝
🙏
WHAT YOU RECOMMEND SO?
I heard at some point theres risks of using it or smth so I stopped using it too
😱
How you like having 4000 lines of fucked Getters and setters on code and considering it clean LMAO
LMAO
Wha
I dont understand people
What
I don't understand english
If you hate verbosity so atrociously hard, like if you truly detest the verbosity java comes with, then use sth more succinct
I get mad
Like there are so many options out there
I dont understand people some times
My phone doesnt understand my typing
I use java because its the only language for plugins
Changing every English word tonanither language
Untrue
If not i will be writen them in C#
Clojure sound like conclure lol
i do that 😢
Lol
isn't there some where you can write plugins in python or js
Cuz Kotling and Scala, kooks really ugly like javascripts, they dont giveme good impressions
clonkcur
Js mehh
