#help-development
1 messages ยท Page 652 of 1
throws?
Dont let eventhandler methods throw exceptions
no error
oh so i need throw manuel ex ?
You need to catch and handle it
which ex am i need catch ?

am i need catch exceptions ?
no exception
on console
wait i will test again
brb
How do I get the download link from a plugin which always downloads the latest version?
Use PlayerJoinEvent

i think that the events aren't listened if you have throws in their signature
Again: Dont let eventhandler methods throw any exceptions. Catch and handle them yourself.
And make sure your listener is registered
ah i forgot this
OMGGTGY
I won't write code again at midnight
It appears item entities do not trigger EntityMoveEvent. Is this true?
alternatively: https://spiget.org/documentation/#!/resources/get_resources_resource_versions_latest
then get the "id" from the json result, and then the download link is https://www.spigotmc.org/resources/a.<resourceId>/download?version=<id>
alright thanks
e.g. like this (haven't tested but should work fine)
public static String getLatestResourceDownloadLink(int resourceId) {
try {
URLConnection connection = new URL(String.format("https://api.spiget.org/v2/resources/%d/versions/latest", resourceId)).openConnection();
try (
InputStream inputStream = connection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))
) {
String json = reader.lines().collect(Collectors.joining("\n"));
JsonObject jsonObject = gson.fromJson(json, JsonObject.class);
return String.format("https://www.spigotmc.org/resources/%d/download?version=%d", resourceId, jsonObject.get("id").getAsNumber().intValue());
}
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
I have these examples https://github.com/SpiGetOrg/Documentation/wiki/Request-Code-Examples
that's bad
doesn't close the inputstream nor the reader
don't use it
this will work just fine ^
Make gson instance
Gson gson = new Gson()
You don't have to make it every time tho, you can have single instance
Whats a good way to download a file from an URL?
I would recomend using an intetnet browser
could curl it
Or wget
in java
depends
You mean on the island or in the language?
Get Inputstream like you already did, and write it to fileoutputstream
BanList<UUID> banList = Bukkit.getBanList(BanList.Type.PROFILE);
banList.addBan(player.getUniqueId(), reason, expires, sender.getName());
is there anything wrong with this code? it throws nullexception
or maybe i shouldnt give null as date to it since i wanted to make the player permanently banned
how can i make a plugin that gives effects to a player with an nbt item?
How do i get the line of text with the health, mana and duration to pop up
not like the health and stuff, but how can i put text on that line
just above where the item name is when you hold it
Apparently I am getting 403 for the url so I used this (https://spiget.org/documentation/#!/resources/get_resources_resource_download) and its working fine now ^^
what T does getBanList method return when i want to use BanList.Type.PROFILE?
The profile ban list
PlayerProfile ?
try it out
i did but i cant figure it out even it isnt said in javadoc
does it not get intellisense?
i thought it returns BanEntry<UUID> which i was wrong
it does but it returns BanEntry<T>
I gotta know what type that T is
since BanEntry#addBan methods first parameters type is that
and basically without knowing it type i cannot enter anything
it returns a generic, it depends what type you ask for
if you get the profile ban list it will return the PlayerProfile ban list
BanList.Type.PROFILE
ah thats it thanks
Who faced such problem of abstract classes? there are 4 classes working with speed, player attack with the SAME logic but different parameters, so I wanted to create a common method for them, but 1 class has unique parameters for clarity, I will show it config Abilities:
day:
attack: 2.3
speed: 1.4
night:
attack: 1.6
speed: 0.8
and for the rest Abilities:
attack: 1.2
speed: 0.7
waterSpeed: 2.4
4 class have 4 parameter instead of 2
make a method that calculates what you want and input default parameters if a value isnt present
thats what I'd do
Is this problem common in the IT industry?
similar but yes
does it make sense to adjust the method for it because of 1 class
well
you can either make the method once and adjust it when required
or you can write it for every class separately
keeping it in one place tends to be simpler
Generally one is overcomplicating the problem
and if in the future a similar class appears, but for example, there are already 3 identical repetitions of parameters
i dont think there's a 'best' solution here
what is in the books about it
Params themselves can repeat whatever
You are probably thinking of behavior similar to interfaces here
i dont know the name for it but what sometimes happens is constructor classes wher you do something like
constructor.setHeight(10).setWidth(25).setStartingHeight(17).build() which then puts the values you specified and default values into the object created
not really applicable here tho
Interfaces do not solve this specific problem this way
I saw a video somewhere about this problem where I think it was talking about using interfaces instead of abstract classes
I wonder why subscribing to this event does not ever fire
Uh, are you really subscribing?
no
This is most likely solveable via inheritance
wdym
I take that as a no
what are event essentials
However since I am on mobile I can only say that is the problem
the handler lists
Yeah just look at the bukkit event classes
Not the abstract ones you cannot listen to
that isnt named correctly iirc
?jd-s
where, how
You need a non-abstract getHandlers method
Also singular, not pular for the static method
Ah nvm, didn't look correctly lel
Holy, how bad is my memory
better than mine ill tell you that
ddr1 ram be like
The run method of the timer is executed, right?
Ahh, I understand the problem is not in the abstract class, but in the hierarchy
?stash
you need to clearly understand where you need an interface and where an abstract class
implements Listener but you have no event handlers
Yeah but not the sauce of the issue
?paste the event class and the listener classes for it
However that is a valid point, is the event handler even registered correctly?
Ketchup is sauce
smoothie
Smoothie with sauce bernaise
Like the true listener, not your psedo-listener that emits events instead of subscribing to events
mmmm
i wonder how many people still think tomatoes are a vegetable
Also i just now realized this is the help dev channel my bad lmfao
Aren't they legumes?
TickPassedEventListener: https://paste.md-5.net/ducamozesi.java
TickPassedEvent: https://paste.md-5.net/yomiruroga.java
InitizalizeListeners: https://paste.md-5.net/ihititeguz.java
TicksEvents: https://paste.md-5.net/ojokalutih.java
I have objections to your usage of the new keyword but whatever
wdym
this has no reason to be a listener
actually nvm I'm stupid as fuck
Are you really registering TicksEvent?
I'm not registering any listeners at all lmfao
Because I don't think so
and these listeners are registere
Generally you shouldn't pop items of the operand stack immediately after invoking the constructor
That is they should be used in other methods or stored in a local var
also why do some of the classes have an empty constructor
ah
Having local dependcies means i only need to add this and not a repo right?
<dependency>
<groupId>pine.toast</groupId>
<artifactId>mana</artifactId>
<version>1.2.4</version>
<scope>provided</scope>
</dependency>
I have realized I'm stupid as hell
correct
is it another plugin
Yes, but I'd avoid that
It's my own. in the same directory.
but is it a plugin or a library
library.
Okay then it is safe to do so
And shade it in and whatever
But if the dep is a standalone plugin it does not matter whether it is a lib or not - no shading is required and scope should stay at provided
Yeah that's what I've heard before. it is a library but worked with provided so i just left it. it just kind of stopped now. prolly because i changed computers but who knows lol.
if its shaded in another plugin it would also work
Not as-is generally
depends how it was shaded
Shading in plugins into plugins isn't a flawless process
Especially not with standard behavior
As in the lib must specifically support these kinds of shenanigans
tryna learn docker and thought running a mc server would be a great way to practise.
it works fairly well and all starts up correctly. as soon as i try to connect or re fresh my server list it spams this error untill shutdown
[19:59:08 WARN]: An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.RuntimeException: Unable to access address of buffer
at io.netty.channel.epoll.Native.read(Native Method) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.doReadBytes(EpollSocketChannel.java:678) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:714) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe$3.run(EpollSocketChannel.java:755) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:268) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.Thread.run(Thread.java:833) [?:?]
any1 knows why this could be happening?
Use Java 8
ah i thought that was the problem
isnt java backward compatible
or am i tripping here
Netty is doing native stuff I believe
ahh, fair enough i will try that then
yea that did it. thank you.
i need help
i installed world edit and world guard on my local server and when i try to use it /tg command doesnt exist
you should post this in #help-server
dk what /tg is even supposed to be tho
never heard of that either
is worldguard enabled
that command
see in /pl
where do i need to enable it?
it should automatically unless there is an error
in which case u need to check the console and see what the problem is
Do you need help, epic? I can show you how to use google /s
ah no someone asked for an invite to fabric's discord
It's funny that telling someone google exists is enough sometimes lol
im good myself thanks though!
Anytime!
?paste
how to increase swimming speed of bukkit api player
and turn off the removal of bubbles under water
when player swimming
dolphin effect is the first thing that comes to my mind
not configured. Not an option
Wdym not configured?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityAirChangeEvent.html
Here's the event for the air bubbles
declaration: package: org.bukkit.event.entity, class: EntityAirChangeEvent
i mean i not can
you could try just multiplying the players velocity when hes swimming in the playermoveevent
though be cautious
its an heavy event
thf
On this code, i don't arrive to bold equipment, can you help me please ? https://pastebin.com/vFem1inr
Bold name of equipment
what is the result then
should probably change this to & since ur translating color codes
I'm getting such an error can anyone help?
did you import java?
Ok i will try
java not spigot
Any idea how I can fix the error?
Right click -> properties and then there should be something with JRE
has been a while since I used eclipse
Right? Vim is great
Ok, still not work : https://zupimages.net/up/23/31/h6un.png
Here my code : https://pastebin.com/vFem1inr
And i want to bold the name of stuff
Yes
ok
maybe try ChatColor.BOLD instead of &l since ur doing that with ur colors too
woulnt know otherwise
The order is important for colors and formatting
Refresh the project (rebuilding it if possible) and restart the IDE
I think BOLD then color, I keep forgetting though
Ok, thanks i will try
how much to bet to have a maximum
- You can also just cancel the event so they don't decrease in the first place
thf
how can i set vararg type as @NotNull annotated?
@NotNull Foo... objects
would annotate Foo type
but not the vararg
Still not work
so if if do smth like this
Foo[] objects = null;
bar.callNotNull(objects)
it doesnt invoke the warning on my ide
@NotNull Foo @NotNull ... objects
this is great, i've annotated my all my builder methods with not nulls
because what's the point of invoking a method which supplies null
Eh i dont need @NotEmpty i have overloaded methods
with varargs
so if it does supply empty vararg it wouldnt work
because the call would be ambiguous
and hey compile time error, which is great since i dont need to check it at runtime ๐
This question came up yesterday
People living varargs and annotations all of a sudden
this was highly unreasonable dovidas

but ok
xD
yeah there was no malice emanating from your lexicon usage
totally
anyhow goodnight
ZBLL always sees malicious intent
it's not like I have trust issues for nothing lol
gotta put my mental instability to use
How to make the armor stand impossible to hit? Such stands usually use plugins for holograms
Impossible to hit or invulnerable?
Probably the same for holograms. So you can use https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Entity.html#setInvulnerable(boolean)
declaration: package: org.bukkit.entity, interface: Entity
am i set default value with sql code ?=
Let's say you have a decentholograms plugin on the server, you create a hologram, a hologram is an invisible stand, but if you just create an invisible stand with the colosseum disabled, you can click on it
colider*
my eng is bad sorry
Collisions
1.18.2
unfortunate, 1.20 would have had display entities
I have heard that such stands that cannot be deleted (there is no hitbox) are created using packets
But I'm not sure that's true
Yes usually you use packets
Do you have any wikipedia on this or do I just need to find "how to create a packet stand" on the internet?
typically people use protocollib
and rely on their documentation
of the packet structure
You can look at open source plugins or maybe you can find a protocollib guide.
I think there is a way to disable hitboxes on armor stands though. At least I found how it works with commands
yes
stand.setMarker(true)?
should be it yea
If that's an option, yes try it
well looks like you wont need it
yup seems to be in the api
maybe that's what I need (I'm making a plugin for rp)
the player writes /desc and a text with arguments appears over his head, for example ("I love dogs") and due to the fact that he can't build with a hitbox when you jump and you can't do it over a nickname
so it doesn't change its appearance, only hitbox
and how high the text appears apernatly
On 1.20 you could set a display entity as a passenger :/
I removed that function temporarily because there was a bug that the player could not break the entity because of my crooked code without using prepared functions, the stand was small and was just above his head if you look at his platform
hello, good afternoon. how can i remove this? about the /help command
add /help command in your plugin.yml and don't make a command handler, the command will override the commands of minecraft or other plugins, at least that's how it worked for me
oc thanks i will try that
If Iโm wanting to make a plugin that listens for when other plugins try and give items but if the players inv is full I want to create a mailbox thing for the items what is the best way to go about this ideally not using asm for player.giveItem or whatever
How do I do in java to dynamically color an equipment? The team moves from the first letter to the last letter from one color to another
There's a ColorableArmorMeta or something
Get see what getItemMeta on leatherarmor returns
together with a small stand, this is what I needed!
sorry can you suggest me a help plugin please
What can I help you with?
Can you recommend a help plugin, the one you told me about?
You developing your own plugin and want remove help command??
Or you want /help plugin like essentials or cmi?
how could i do it?
if you create your own plugin, you must have a plugin.yml file, do you have one?
Post the error and the relating code pls
Nope
Verify account
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
!verify
Usage: !verify <forums username>
!verify EzedOn
A private message has been sent to your SpigotMC.org account for verification!
this is the issue
i have no idea where its coming from
i cant add code since i dont know where its coming from
The exception tells you where it comes from
it doesnt
click on a higher hierarchy tab
which is?
the highest one i click?
Are you using maven or gradle?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources (default-resources) on project boxessentials: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:3.3.0:resources failed: newPosition < 0: (-1 < 0) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
maven
Show your pom pls
anything specific?
anyone here do comissions?
?services
?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/
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/
:^)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.ezed</groupId>
<artifactId>boxessentials</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>boxessentials</name>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
here
Before that. Do mvn clean and then try mvn install again. Sometimes you just need cleaning.
all of those people don't actually do it
they message me then stop messaging
I have alerts on for that forum section
We see every post
Some of them are just bad ideas
do u do comissions?
how im very new to java
Maybe on the ItemSpawn event, check if the item location is equal to the player location?
My overflow code just spawns items at the player's location so it may be a good start
In intellij you have a maven tab on the right side. Use this or use your terminal.
Run clean first and install afterwards
ok
done
Anyone know of a way, packets or otherwise, to make it so the client reacts to the side of a block as if it were vine/ladder to climb it?
TYYY it worked
I've done that before, it's a pain
You need to make a resource pack that makes vines invisible
And some code to detect walls
That sounds awful, but thank you
force them to climb it with levitation
That could do something.
otherwise not sure if you can fake vines
you could probably send them a ladder packet
but that will get them kicked
tell them to use spider hack
or let them sit on one
otherwise push them up with velocity
That would be pretty funny.
Yeah it's for the Spider ability in my plugin.
Trying to get it so they could walk through spider webs at normal speed was an impossible task too lol
hm, you could apply velocity at them if they sneak at a wall
That may be the way I gotta go.
ehh that's annoying
not that hard
Sucks I can only go off of the jump increment for spacebar usage. Up/down will be very painful
I already got systems to create threads to watch the player and disable effects.
I'll try watching the cardinal blocks around them and seeing whatworks. Thanks
yeah you just gotta check the 4 direct neighbour blocks and if one of them is solid and the player sneaks, set them into spider mode and push him up
if he unsneaks let him in spider mode and push him slowly down without falling
once he's away from that wall spider mode off and he can fall as usual again
Yeah.
I could give them feather falling for a couple seconds to make wall to wall jumps possible.
Still wanna punish them if they mess up though
double sneak for jump into a direction ๐ค
No, I don't have one, can you recommend one already made? please
CodySimpson has very good tutorials on youtube
can you screen all folders in your project and what ide you use?
I'm not creating a plugin
you need /help plugin?
i can create this plugin
wait 1 min
Which you version use?
Which version you use*
no, no, what I want is to remove the /help command from my minecraft server
I can create a plugin that will remove this command from you, do not be afraid, I will post the plugin code on github, you can make sure that it is without backdoors
he specifically wants to delete the command so that it says "unknown command"
Does it really matter if it says unknown command or you do not have permission for this command
oc, the code where to send it? or publish? And please send me the link when I published it or if you can send it to me privately please
Do you need to write this plugin or not? I didn't really understand what you said
Can you send me the code that you are going to create so that I can delete the /help command?
Good evening, I wanted to ask what is the best way to deactivate a function in a plugin? it should not be usable later for normal players.
Look, I'll make a plugin that will write your message there will be a config file in which you write what message to write if the player uses /help
for example:
message: 'Unknown command'
What is the messagetype used to send a message which is in the middle of the players screen (and how can i send it)?
build it out ๐ค
actionbar?
or title?
i guess title then
The function is a butcher function that kills animals / mobs directly and only drops the loot. So as not to strain the performenc. The thing behind it I have little to no experience in the Java language.
wait
?
Thatโs title
yes, thank you
this is an example, I do not know what exactly he needs
i alr got it
Itโs just Player#sendTitle
yeah
coll, do you know a satisfying sound that i can play when this title appears?
or a nice sound
player.playSound();```
You can find all sound on minecraft wiki
What kind of sound do you want
what happens, is that I wanted to install a custom help cmd plugin, which will send you a custom help menu
A ding?, something magic sounding?
but
hmm, something that sounds nice, which sound do you like in minecraft?
essentials -> help.yml or you server files -> help.yml
maybe amethyst
the default help command won't let me because it commands something else
And block the /help command of the other plugin
is there a mp3 file too?
to listen to all of them?
maybe
go in-game, /playsound
I already did it but nothing appears
maybe this?
Use something like DeluxeMenus if you want a help gui
Yeah, dont use another plugins, simply gui menus plugin
What I can do?
how?
Store the timestamp when they will be off cooldown
And then compare it when they try to do whatever
Thereโs also method 3 which is just a slightly improved version
The entire guide is useful
Hey, does any one know how to register a custom entity in spigot (version 1.8.x) ?
na its a bit meh
like u can use it but it becomes problematic when u wanna scale of it

i think the biggest issue comes with thread prioritization and and interruptability design
some help ๐ฅฒ
I am gonna say I personally think you are going too fast chief.
You were unaware of abstraction or general OOP concepts earlier today and now ur mucking about with threads?
1.8 is 8 years old. Believe it or not most folk don't have that good of a memory
No he doesn't. His code is sloppy and unfortunately encourages bad practices every other video.
Someone like smiles needs to seriously do a similar series but, yknow good lol
The honest truth is that 90% of what he teaches is quite literally just "read the docs" and "learn java". So if someone here was to make a video it should be about reading the docs and how to use javadoc over teaching spigot things.
Hey I got a question, how exactly do I do modular plugins using gradle?
as in allowing verious NMS versions
A series teaching java via spigot concepts would be big brain
Lol true.
I've always though of doing something like that but I hate my own voice and have a rough accent
People say they like my voice but I tend to ramble and become incoherent lol. I'd hate to make a tutorial and have it be a video essay
I'd need to write a script to not trip in my own words but it ends up sounding unnatural
I just prefer sticking to my usual illusion index posts
Just have no mic and write in notepad for the video
And my github wiki stuff
have the mic on top of the keyboard
hi my console keep sending Could not save messages.yml to plugins\Votekick\messages.yml because messages.yml already exists.
encourages bad practices in every other video?
would more say that he doesn't apply enterprise thinking to his vids
just normal spigot tuts where he shows how to code against spigot api
I feel like a 1 hour video on the basic setup/config along with some basic "good to know" things like PDC and whatnot would be useful. Then, another video on NMS. That'd probably be all you'd need
average programming tutorial be like
how do you delete entire words
huh?
ctrl backspace
ohhh
it's so natural you just do it
it's amazing because if you misspell you can just delete the who thing
yeah it's natural
i always do the "so this word has 8 letters so i press backspace 8 times"
Yeah spigot does that if the file already exists
Itโs annoying
Just add a check to see if it already exists
when you type fast enough it's better to delete the entire word and start over
I'm on a surface keyboard rn so my wpm is probably sub 30
speedtype test are always the complex words fast and shit like "him", "it", or "or" breaks it
hey im currently working with click types in the inventory click event and ive been debugging this for a long time now, but it simply seems like the check "event.getClick() == ClickType.NUMBER_KEY" or any other click type does nothing, can someone point me in the right direction for what im doing wrong and for how to fix it? if so, then thanks.
Is your event firing at all?
The event is registered and it works for some other checks in it, but not for the click type one above
the code you posted should work
Time to print the click type
please post the relevant function
Are you guys going to be online in about one hour? I've just went away for one second.
not me
no clue if I'm gonna feel sleepy within an hour
but I usually stay up til 5am so you got maybe 4 hours
does anyone-a-reno know how to use the plexus/eclipse compiler-eno in gradle-ahoo?
Stroke?
Okay, I'll be right back
you philistine haven't played thimbleweed park
hey look smile's lurking
smile is leaking. leaking mucus
Allright. Thats enough internet for today. Im gonna go hit the hay.

im broke asf
dont let the bedbugs bite
we all are
got 5โฌ on paypal
nice, a burger in the clinic where I was only costs 4.50โฌ
I just got $70 from nexus mods
so you could 1.1 burgers there
Pretty much rich now
gotta survive for 2 days with this money
but I do have chicken in the fridge
Enough for a day
And I can buy more chicken
chicken's like 6โฌ/kg
So am I
I once tried to copy money but the printer just printed black bars
And photoshop refused to open the scanned bill
Is that an actual thing computers do
Yes
Yea
Neat
well, depends on the software
Printers also print with nearly-invisible yellow dots
That are a sort of metadata
That display info about the printer
I figured it just didnโt matter since the printer wouldnโt be able to copy and of the fancy security stuff
money is almost impossible to fake
Eurion constellation its called
Interesting that photoshop also says no
Eurio*
Wonder if other image editors do
krita and inkscape probably dont check
Well even if they didnt, the printer refuses to print it
Krita is meh
Tried using it as a sort of whiteboard
It keeps the entire image in ram
so a 40kx40k image was like 20gb
wtf r u doing with a canvas that big
taking notes with a drawing tablet
I havent written anything by hand in years
teacher was a bitch and insisted we wrote by hand
nowadays I just ignore their demands
My handwriting is godawful
Mine too lol
mine depends on how much sleep i had
i'd recommend using pens then
graphene doesnt get smudged nearly as much by water(like) stuff as ink does
ehh
i've discovered when a notepad i wrote in with both got soaked once due to rain
the page warps
i can still read all the stuff i wrote with a pen
Write in blood
and none of the stuff i wrote with ink
It also sends a message
I think you mean pencil
This is my handwriting when taking notes
fun
youre clearly a doctor
the only thing that's readable are the section signs ยงยง
can you still read that?
eh you do you
im asking cuz i can somehow read everything ive written
except one line of text
has been bugging me for years
do someone know how could I delay the opening of a barrel with some pdc values assigned to it?
like i need that the barrel opens after 3 seconds and send before an animation (https://paste.learnspigot.com/qayupijaxi.java & https://paste.learnspigot.com/ameyehiquw.java)
Just use a runnable?
just schedule it
yeah I know but, something like player#openInv in the code block or
No, I don't remember which was the method to open it, was it player#openInv or something else?
Player#openInventory
player.openInventory
you dont have any code completion or idk
also use documentation
or even google it
?jd-s is your friend
Guys I know the Javadocs and everything, i tried to google it multiple times and came up with nothing, the method should even set the block to air after its opened but doesn't work
what didnt work, opening inventory? XD
Also with the current code it doesn't make 1) the animation or like, it makes them but after i opened the barrel which is not really what was I'm trying to achieve
https://paste.learnspigot.com/vahefetafa.csharp this is the listener class
so you want to play animation and then open barrel gui?
yeah like cracking barrels and when the animation stops it opens the barrel
so why wont you open it when calling cancel method?
So whatโs the issue here?
^
in the ticksPassed >= totalBars if?
yes
right before calling cancel method
I assume cancel method means end of animation
Exactly, but actually with the current code if I understood it should set the barrel to air (so remove it)
if so it doesn't work
openinventory,
set type to air
cancel
I have a custom yaml file, I'm trying to add default values, but it seems like I cannot choose the type of the value. I'll specify the path, but the value is just an object.
So if I want the value to be a string, it will still be displayed without "" in the file
you want to open inventory using event or player.openInventory?
I want that when the player interacts with the barrel it tells cracking barrels and after the animation is finished it opens the barrel, so I think maybe in the PlayerInteractEvent?
- Interact event
- Start repeating task with a counter
- When counter hits N, cancel task, open inventory, break barrel
runTaskTimer or which kind
Yes
Is there any event that i can use to listen, if a player uses tnt to destroy blocks?
TnT is EntityExplodeEvent
How do i get the player?
check who interacted last
which one is the better event?
TNT stores who activated it in some cases
I am going to place tnt and a redstone wire to activate it, then stand on a pressure plate to activate the redstone
I am going to place tnt and a daylight sensor next to it and it will explode when the sun comes up
I am going to place tnt and get a skeleton to shoot a flaming arrow at it
your best bet is to attach metadata about who placed the block initially
getting who actually triggered the explosion is a fool's errand
what are you trying to cover then
Aka the same cases minecraft tracks it
because different events can cause it
anyone knows if i can get the destroyed blocks as well? from the event
From the EntityExplodeEvent, yes
but this one only activates if an entity is being killed by tnt
What is your goal
tracking, which blocks the player breaks with an explosive
Then yeah, EntityExplodeEvent
? but its only called if an entity is killed?
by an explosive
Lit tnt is an entity
@echo basalt are you available?
Uhh yeah
Okay so i have this in my inventory click event
if (clickedInv != null && event.getCursor() != null) {
if (if event.getCursor() is the custom itemstack i have) {
if (clickedInv.getType() == InventoryType.PLAYER) {
Bukkit.broadcastMessage("inventory type is player");
Bukkit.broadcastMessage("shift left - " + (event.getClick() == ClickType.SHIFT_LEFT));
Bukkit.broadcastMessage("shift right - " + (event.getClick() == ClickType.SHIFT_RIGHT));
Bukkit.broadcastMessage("number key - " + (event.getClick() == ClickType.NUMBER_KEY));
Bukkit.broadcastMessage("shift click - " + event.isShiftClick());
if (event.getClick() == ClickType.SHIFT_LEFT || event.getClick() == ClickType.SHIFT_RIGHT || event.getClick() == ClickType.NUMBER_KEY) {
event.setCancelled(true);
Bukkit.broadcastMessage("shift or number");
}
return;
} else {
event.setCancelled(true);
Bukkit.broadcastMessage("inventory type is not player");
}
}
}```
What works: a player can move the custom itemstack in their own inventory where ever they want to, but they can't put and drag it into another inventory.
What doesn't work: a player can shift click and use their number keys to put the custom itemstack in another inventory.
Yeah so
Cursor only gets you so far
When dealing with this event, the values are set like following:
Cursor: The item that was in the player's cursor before clicking
Current Item: The item at the highlighted slot
So you'll have to do extra handling to see where things will go
So i should change cursor to current item?
You should write better checks
And get the specific item depending on the click type
I've written about one thousand lines of code of a variety of checks for it trying to debug the problem
I feel like I'm going in circles
Write better checks then
No duh lol
The checks seem all good, but they're obviously not
I'm not sure what's wrong in it
Do me a favor and print out all the values of the event outside of any checks
See if you can recognize any patterns
- Item in cursor
- CurrentItem
- Item at raw slot
Grr I'm looking at luckperms' dependency loader and this code looks annoying to write
im doing this now
ive debugged this
Bukkit.broadcastMessage("cursor - " + event.getCursor());
Bukkit.broadcastMessage("current item - " + event.getCurrentItem());
Bukkit.broadcastMessage("item at raw slot - " + event.getRawSlot());```
and when i click on the custom itemstack in my inventory, cursor shows as the custom item stack, current item shows as material air, and item at raw slot shows as thirty six
it doesn't have to be, LP takes a very DIY approach, tbf all you really need is a maven resolver like apache aether and store your dependency configurations somewhere accessible at runtime, then throw everything into its own classloader
Still annoying
What I used to do back in the day was toss all my dependencies in an external plugin and download it from a web server
which is better nested if statements or nested switch statements (I know neither is)
Is spigot nexus thing down?
https://senpai.plz-choke.me/G668KfB2
Getting that and this when I try to build my plugin: https://nekobin.com/rixuvelaxu.py
(Please ping with replies, yall)
nexus must be down atm
I just spent entirely too long trying to fix my gradle/intellij before checking that lmao
oh thats what guy tried to connect
mb
i thought bout this for some reason
ping me when its back
same
LMFAO literally same smh. Didnt see that it was down till now
if (!getDataFolder().exists()) {
getDataFolder().mkdir();
}
msgs = new File(getDataFolder(), "messages.yml");
if (!msgs.exists()) {
try {
msgs.createNewFile();
} catch (IOException e) {
e.printStackTrace();
Bukkit.getConsoleSender().sendMessage("ยงcThere was an error creating the messages.yml file!");
}
}
msgsc = YamlConfiguration.loadConfiguration(msgs);
msgsc.options().copyDefaults();
saveResource(msgs.getName(), false);
My messages.yml gets created but its all empty
it apparently didn't save the default config
[00:53:17 WARN]: Exception in thread "Timer-1"
[00:53:17 WARN]: java.lang.NullPointerException
[00:53:17 WARN]: at pg.perms.api.inits.MySQL$1.run(MySQL.java:26)
[00:53:17 WARN]: at java.util.TimerThread.mainLoop(Timer.java:555)
[00:53:17 WARN]: at java.util.TimerThread.run(Timer.java:505)
``` is that normal?
no
I'm looking to allow crops to grow in the dark, with no light level requirement. Has anyone ever done this before or has an idea how?
disable day cycle ๐
Hello, how do you give a spawner that spawns a certain entity (e.g. creeper)?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/BlockStateMeta.html
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/CreatureSpawner.html
declaration: package: org.bukkit.inventory.meta, interface: BlockStateMeta
declaration: package: org.bukkit.block, interface: CreatureSpawner
Hi, i have a problem on this code : https://pastebin.com/RQESGGGc. The problem is the following, the name of the equipment is not colored in yellow, and the yml file has the correct cooldown value, but not the Minecraft server (when the user checks his cooldown, it marks something else)
Why are you setting the ItemMeta 3 times? Are you planning to use these methods on other items?
Also elaborate more on the cooldown, what's wrong with it?
Honestly i don't know, im full beginner so i ask ChatGPT to help me x)
.....
Well that makes a whole lot more sense lmao
What should i do for fix the problem ? I fix solo the name at yellow for stuff, but i don't arrive to fix the cooldown
Well, I would start by actually learning what your code means
Your never going to get anywhere by copy-pasting code from ChatGPT and stack overflow without knowing what any of it does.
I understand but that not help me to fix the problem, that why i ask here ๐
I learn with experience like all people, ChatGPT help me to get experience by provide me a theorical code
eh, chatgpt is hit and miss
ChatGPT is probably the worst source you could go to for education on anything
Ok maybe not the worst but still, there are a very large number of free sources better than it
ChatGPT does not know how to code. It rips code from it's training set and attempts to mash it together to fit your request
I just want help, not talk about ChatGPT please ๐ ..
If you don't know just tell me
He sent a paste
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
it has a bit of highlighting and much nicer to read
Alright ๐
That's because ChatGPT wrote it
But fr tho my best advice is to just use a kits plugin if you don't know how to code
What exactly are you trying to do?
Let them make mistakes, learn and try; Why are you so harsh on them.
Honestly coding is easier then fucking with chat gpt. Chatgpt frustrates me so hard sometimes
@stuck imp if ur gonna use AI I recommend using phind.com
chatgpt may be useful to get debugging ideas but yea dont try to code with it
I'm not trying to be harsh I'm giving genuine advice. ChatGPT is the worst way the could go about this.
ChatGPT give me idea to how to code something. It's not worth and stupid
With that, i code a perfect Python Bot
Able to do many things and task
Tell me what you actually want to do and I can help you @stuck imp
gpt isnt there yet. Learn to code or you will be stuck with tiny projects forever.
And if they break you wont be able to update/fix them.
I want fix the cooldown bug. In Minecraft game, it's show "31/01/1970 at 00:37" when the real time is "02/09/2023 at 10:06
" for example
thats just default time
?
somewhere in your code you grab time and dont set it to anything
resulting in timestamp 0
january 1970
How i fix that ?
whats goin on
.
@chrome beacon
Is there anything in the config file @stuck imp
what lol java setCooldown(player, System.currentTimeMillis() + 30L * 24L * 60L * 60L * 1000L);
ChatGPT
What is L
long
long
oh
Shouldn't it be smth like Instant.now().getCurrentTimeMillis() aswell?
no?
currenttime is also good
yoo chill I'm a beginner
neither
oh
you mentioned it lol
nonono
System. currentTimeMillis() returns the milli second in the current second, doesn't it?
i didn't mean to harass you for real
just completed the sentence fr
changing if to switch is a very negligable change in performance; Might even be changed during compiling either way
No, it returns the time in millis
it returns milliseconds elapsed since the unix epoch (1970 or smth like that)
isnt switch based on a hash jump table
no
Oh, neat. Always thaught it was the milli in the current second
under ze hood
Also on data being switched
i mean if you just go to c and do some ifs and then disassemble the resulting artifact
and look at code
well you can have it by subtracting full elapsed seconds from it
you just save millis to config and get millis from config
and only work around it when you want to display it to user
using SimpleDateFormat or smth similar
cuz saving it as date to config is just a waste of resources
and time
I always freak out how little ms have passed since 50 years ago
i always freak out that c++ inventor is still alive
How old is he
most of the god devs from 1970's are still alive
freak out is my basic state
isn't your basic state freejava?
72 years old
FreeJava extends FreakOut
first atomic station was built less than 100 years ago
"I Became A Programmer By Mistake" Says Bjarne Stroustrup
Everybody in this discord be like
Hey!
I'm currently trying to open a chest for a player.
When I do it, the chest doesn't visually open and InventoryClickEvents don't fire for this inventory.
This is how I currently do it:
Container container = (Container) block.getState();
player.openInventory(container.getInventory());
Are you trying to open a chest that is in the world or just an inventory?
A chest that's placed in a world.
It has to work with other containers too though
Well the chest ins't going to open becuase your just sending the inventory to the player, as far as the events go InventoryClickEvent should work
Have you tested it with a normal inventory?
send your event listener
Make sure your event is registered properly
Reminds me of yesterday
As far as visually closing/opening the chest goes use this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Lidded.html#open()
declaration: package: org.bukkit.block, interface: Lidded
This is the code for my InventoryClickEvent:
@EventHandler(ignoreCancelled = true)
public void onShulkerOpenAlternative(InventoryClickEvent e) {
e.getWhoClicked().sendMessage("Click!");
//Rest of the code
It does not fire.
It does fire if I re-open the chest and try again though
When I came here asking why my events won't work and then I noticed I forgot to register the listneers
Hey man it happens to the best of us lol
wdym by re-opening the chest?
It is registered, though ๐
It works just fine as long as I don't force-open the chest via my plugin
I can close the inventory and open the chest myself.
This works just fine
Hmm
What is the overall objective here?
Why do you need to listen to clicks from a physical chest?
I have a temporary menu which you can open while viewing a chest.
As soon as this menu closes, I want the player to go back to the chest
Can you explain that a bit better?
What does the menu do
And how is the menu related to the contents of the chest
Yes, sorry.
I should probably just explain what plugin I'm working on...
Basically, I'm allowing players to open shulker boxes without even placing them.
To make the process of viewing multiple shulkers inside a chest easier/faster, I want to re-open the chest afterwards so you can either view the next shulker or do something else in the chest
Ah ok
I can't think of a reason why the event wouldn't be called
The inventory is being displayed correctly to the player right
Yes, it is.
I haven't tried taking anything out of the inventory though.
Maybe the inventory isn't even working
Just tested.
The inventory isn't even real.
If I take items out of it, they just vanish as soon as I try to interact with them
how do I store entities in a yaml file
So when you open the chest the normal way and click on a shulker box it's inventory it's contents are displayed to the player but when you re open the chest iventory and click on a shulker the event is not firing? @sage dragon
Yes, and the re-opened inventory isn't even real
not real how?
Oh, you will need to set the contents of the chest inventory after it is closed if that is what you mean
The inventory seems to be completely client-side.
If I take items out of it, they get removed as soon as I try interacting with them
Oh weird
Easiest way is probably just to serialize it
Try cloning the inventory and open that and then just set the contents after they close it
Actually that could cause issues if multiple people try to interact with the chest
Yes ๐
damn alr ty
Man I'm sorry i really don't know could be causing that
