#help-development
1 messages ยท Page 520 of 1
hi
you need the instance elsewere
all this fornothing
just not right theere
new File(getDataFolder().mkdir());
dont need the new File(
How do i use that tho?
bruh ๐ญ
get the player join event
then check taht function
ok but i want name the folder does it will auto name or what
i see
And its going to alow me to have a diferont spot were people spawn first time they join and /spawn Will bring them some were else?
the name of the plugin in the .jar or in Plugin.yml or what
plugin.yml
just need understand how this works
Create then
Yea, if its true, the execute teleport to X location if its false (its first time join), you teleport then to tutorial or smth
why is your jar 32 megabytes
maven or gradle
maven
?paste your pom
yessir
no.
why no
is he using maven or gradle?
maven
gradle is hard
yea, pom is pretty clean by default
not really
gradle is bae
thats fine, paste ur pom and i can tell you why ur jar is 32mb
yes
kilobytes is smaller than megabytes
thank for helping!
they are on the same scale
bruh xD
fact
.
thanks illusion
Guys need help
again?
?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!
lul
I have system like you write name and it create the name you write to folder but some people write something that windows don't understand and it give me error
can you make like
when it fine error
wat
it say "sorry something went wrong"
hell ye what happens again when people realize they can create files on their own?
write name where
Player player = (Player) sender;
loc = player.getLocation().add(0, -3, 0);
sz = (int) loc.getZ();
world = player.getWorld();
if (args.length == 1) {
try {
BufferedImage img = ImageIO.read(new URL(args[0]));
ItemStack map = new ItemStack(Material.FILLED_MAP, 1);
MapView view = lazyx2.Utils.MiscUtils.mapViewFromImage(img);
MapMeta meta = (MapMeta) Bukkit.getItemFactory().getItemMeta(Material.FILLED_MAP);
meta.setMapView(view);
meta.setDisplayName(ChatColor.RED + "Test Map");
meta.setMapId(map.getDurability());
map.setItemMeta(meta);
player.getInventory().addItem(map);
} catch (Exception e) {
e.printStackTrace();
}
return true;
}``` this just gives me one image and after that its all ways stuck with that image can anyone help me?
@karmic salmon If you wanna go sure, just generate a folder with a uuid then have a file in the folder with the display name
Like when you /tv create Hello it will create folder in treasurehunt called "Hello"
no brekain anythign
yeah i wouldnt create a folder for that
use ?paste
ah
you would want a yaml file
database?
whats that?
oh
what he said
what is yml file
?paste
creates a link where you can put ur code
oo map views and images
you know how most plugins have a config.yml
its them
but you can create custom ones
is that bot dead again
no
I played a lot with maps
i see
no clue about your MiscUtils method tho
you can
But overall a map view is what contains your data and your mapmeta just points to the map's contents
so like
its just harder to use
i see
if you want mutable maps just use the overwrite the same view
probably wouldnt be profitable to use opengl to draw a map
otherwise they immutable
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
so no need create folder on it files just 1 yml?
https://paste.md-5.net/eqipodotak.cpp this is the full code and now that I've restart the server the images don't work at all (its still stuck on the same first image loaded)
you will need your data folder but it can be 1 yaml file
i See
no need folders yay
My bw plugin saves in json, mongo MySQL or yaml
no
damn
haven't made adaptrt
tell me you did it smartly and use an interface and each class has impl
hypixel
about what
I applied again
how'd u guess
i thought that was next year
bc thats the smart thing to do and what i do
and I've been like
noice
working my ass off for the past year to learn all the things I lacked last year
like uhh
working with influxdb and grafana
or minigames in general
those graphs
I still don't like the way I'm doing teams here
what you using graph databases for
internal measurements
like how many players did something in the last hour, for example
ah like that
if you wanna take a look at how I did Teams I'll give u the class
what this will do java if (Files.isRegularFile(Paths.get("plugins\\TreasureHunt\\" + args[1] + ".yml"))) {
nah
I just mean like
the way I abstracted it
it will like check if file calledargs[1] + ".yml?
just check if it exists
outside of the game unlike everything else
if it doesnt create it
stop using \\ as we said
also dont hardcode your plugin name
new File(plugin.getDataFolder(), args[1])
im taking a wild guess you havent read the wiki i sent you
and sanitize that input
where .yml
uh ye whatever
where braincell
this check the path
use /
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
you will do stuff a lot quicker and by yourself
?whereiam
how many times have you sent ?learnjava in the past hour
2
lol
MainThreadExecutor.INSTANCE being Bukkit.getScheduler()::runTask hmm
why we need plugin. here
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
because the getDataFolder only exists on a plugin instance
if you didnt remove the getInstance code you can use TreasureHunt.getInstance()
It will take a few years until they will work there, if ever
well
it lets me do stuff in futures
This is something one can worry about once you are in an intermediate level of java
my first messages here are absolutely idiot too
at work we just use our custom future class that lets us thenRunSync
but ye
the first like 4 months of my dms to coll are me refusing to learn java and asking for help
mfs making me write a static abuse guide
@echo basalt This is how i handle playerdata
Thankfully my first messages on here are unfindable thanks to me accidentally nuking my account
i once thought about implementing a less overhead cf but that just went horrible
I'm not a fan
also mf got the 8k monitor
How u handle ur arenas?
Though I believe they wouldn't be too cringe given that I had a few years of off-on programming java already
Heh
i had like one year of experience and i was an absolute noob
getInstance on javaplugin is not really static abuse
I literally just made cosmos for arena handling
I'm still not a fan of singletons
just DI
only clutters up code imo
Well, I'm not too, but it's far from abuse
and spigot will already prohibit you from making multiple plugin instances so nothing wrong with di
im clearly not a fan of singletons :)
Noice, having a small issue with copying the code cus it too large xD

<insert record here>
so yeah for like
custom games
you just extend the map class
and register the maps in the registry
ah blame java
and since the minigame class like
Here the massive image
expects a map by default
you can just
new SkywarsGame(mapRegistry.getSpecificMap("skywars-one", SkywarsMap.class));
and it creates a skywars game with that map
which contains all the spawn points and chest categories
(each category holds a loot table)
and we use vectors because they're all offsets of a common anchor point which is where the map is pasted at
So yeah then for like filling chests just convert all of those to absolute
get the loot table from the registry and fill it in
and if I want to make bedwars instead I can just change the map stuff
to like
Generator and whatever
make a custom BedwarsTeam class that extends my GameTeam class and have it include stuff like the generator tier
write some logic for the generator, phases for levelling the global emerald and diamond generators
and you can write the game in less than a week
There Have fun with this image
Pretty epic way of doing it ๐
500mb ram image

nothing should be that long
mans storing block and entity references directly instead of positions and uuids
memory leak go boom
also world reference yikes
and this all goes in a static list
hell nah
you got a memo leak right there
yea ik i gotta rewrite it
also I'd use proper phases and like
ever heard of enums
where code
here
This code is a year old dont bully meh ๐ฆ
here's some inspiration
Hey guys tell me pls how i can create online map for old minecraft server without using dynmap
not enough generics
this ain't cosmos
or my scripting engine
doesn't need generics
Oh, you also wanna see the code for the Phase??
it needs more generics
Im about how i can create my own plugin like dynmap but without using dynmap api
uhh
Heh
you look at the code and see how dynmap works
good luck with that
You need to create an Webserver
what he said
๐ฅน
I'm working on/off on a school project that's basically like
mcjukebox but with mic in
aka openaudiomc
but my own version
and even without any graphics it's the biggest ass pain
๐
WELCOME TO MY GAMEPHASE
mf firefox can only zoom to 500%
yeah this is straight ass
MUAHAHAH I SHALL INSTILL PAIN IN EVERY ENTITY THAT READS MY CODE
lemme try tv screen
I just download the image and toss it on ms-paint
anyone who can read this
occupies a few hundred mb ram
I feal like that person from NCIS who goes "inhance"
oh no i smell a double map lookup
It's cluttered aswell, both gamephases and eventhandlers intertwined
Yea the guy just somehow enchances the image fromm 100km away
and that second check should be first
please tell me that this is actually ONE file?
this is better
Theres 4 more ๐
Ik the code is bad, you have already told me enough ๐
Maybe you want to add something like a config file for these messages, so you don't have to delve into the code every time.
skull
or a map
use lambda
or a placeholder
Also use a stringbuilder for all that string concat
Why is this here?
dont worry
Hey I have the following problem (Spigot 1.19.3):
I want to set a player's spectator target, which by itself is no issue, however if the target is a farther away then it won't work and the player only gets teleported to the target.
v1: Only works on close distances
player.setGameMode(GameMode.SPECTATOR);
player.setSpectatorTarget(target);
v2: same results as v1
player.setGameMode(GameMode.SPECTATOR);
player.teleport(target.getLocation());
player.setSpectatorTarget(target);
v3: this actually works, but the delay is very noticeable
player.setGameMode(GameMode.SPECTATOR);
player.teleport(target.getLocation());
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> player.setSpectatorTarget(target), 1);
Does anyone here have an idea what I could do differently so I wont have to add a delay?

you have alot of those weird event blocks that don't do anything.
Correction, you have 2 1/2
something tells me it's a packet thing
use runTaskLater not scheduleSyncDelayedTask
I've tried that too, but I get the same result
probably what illusion said then]
myes
๐ญ
requireNonNull gives me nightmares
fun what it does with anonymous classes
You are just trying to break things now
nah just jdgui
ah
still no dark mode
That is why recaf is better
Lol wat
Hi, im using a method for reloading, reloads the AnimationsList to then recreate it
public static void reload() {
AlixAPI.getInstance().reloadConfig();
animationsList.clear();
AnimationsManager.RegisterAll();
}
but seems to not reload the config
jd-gui had a stroke or something
recaf looks pretty nice, i only miss syntax highlighting
c# naming conventions 
Hi everyone is there a way to be able to use CraftPlayer in 1.19?
?nms
Uh thanks ๐
some people just have to die
Honestly, how can people write such good maths code?
Maybe is hard
I've been trying to write some code to spawn blocks in such a way where the blocks lift up then fall down in a wave effect but damn it's hard to do lol.
I failed maths in school, so I'm trying to relearn maths now lol, I've been trying to make the wave come up out of the blocks then crash down a few blocks along the line
guys there are var that in it string called [hiii.yml, hiii2.yml]
but i want add it do list
?
like , is the sprit letter that sprit between this string and the other string in the list
Separator?
Yes.
Quotation mark? ["Test, string", "other"]
like There is var in that var there are string and that string is [hiii.yml, hiii2.yml]
now
List? Array?
i want hiii.yml and hiii2.yml be in a list
make a list from an array?
Arrays.asList("hiii.yml", "hiii2.yml")
and put it in list
You near but this not from a string
Do Anyone get it?
"a b".split(", ")
i see
input:
string = "a , b"
so string.split(",")
System.out.println(string)
output:
"a b"
like this sir?
Can you give me Example sir?
string.split returns a list of strings
it doesn't modify the initial string
[a, b]
Yes this what i want
Yep!
thank you Sir!
wait can we remove "[" and "]" from a string?
that's a list
i see
can you explain what you are trying to do?
yeah
if this is configuration, use Configuration getStringList
its smth with his command args
There are String Called [hii.yml , hiii2.yml] i want take this and remove [ ] and make , slipt between them and add the strings to a list called hello
a string or an array?
wrong.
where are string from
from other list of files in a folder
this is confusing me
results.clear();
for (File file : files) {
if (file.isFile()) {
results.add(file.getName());
}```
@karmic salmon start from the beggining and explain what are you trying to do
How would you guys go about generating code what makes a arch like this https://i.imgur.com/cYGFh0m.png the arch lifts itself up and falls back down in rows, I'm so confused how to do it and have been trying for ages lol
ok but you already have list in code there
do you know how to use sin?
Not really, no do I need to use sin?
yes but when i try print it it say [hiii.yml , hii2.yml]
there might be other ways but it is the easiest one
blockY = sin(blockZ + ticks)
I can learn it if needed
something like that will get you started
print out only contents of list, not entire list
How Make this.
make a thread
f.ex.
for(String s : list) {
System.out.println(s);
}
this is getting messy
yeah my bad
dw
- '[message] 9F287โถ Voting Li ...
^
expected <block end>, but found '['
in 'reader', line 34, column 10:
- '[sound] ENTITY_EXPERIENCE_ORB_PI ...
^```
what did i do wrong lol
Hi, what would be the best way to set block rotation in spigot 1.19?
declaration: package: org.bukkit.block.data, interface: Rotatable
thanx
any idea why is this producing error NULL java System.out.println(loc.getBlock().getBlockData()); ((Rotatable)loc.getBlock().getBlockData()).setRotation(BlockFace.EAST);
while the sysout command outputs: "CraftBlockData{minecraft:oak_log[axis=y]}"
?
thank you
guys how are the new blocks that could stretch named?
bocks can stretch?
Please Help Me Guys
give some lines around it
block display
Sometimes the blocks need to stretch to warm up their muscles
?
Throw it in a yaml validator
is there a way I can change a players display name and display like an icon along side the playername?
like this:
"[aVisualDiamondSword] aPlayersName"
is there a way to do it ?
Use the AsyncPlayerChatEvent and make your own format
I didnt specify how I want to use it actually, I want it to be like in their nametag / the name displayed on top of their head. (my main problem is , how do I obtain the icon of the sword and display it)
What's criteria in registerNewObject(name, criteria, displayName)? is it like a group name?
What are the available criteria?
guys i have a werid qustien i want set a new boolen but for just a uniqe player not every one
like i want set boolen of the player who do the command to false or smth like that]
wdym
Donโt use name
fr
i see do you have any idea how set it true or false?
so you need three possibilities? true false and absent?
what are you even trying to do
bruh
i try make like when some one make command code set there uuid to true then other code
;/
this rude man
ok
like
every player have unique uuid
and want set it to true
idk how
set what to true
how can you set an java.util.UUID to true
here.
just tell what you're trying to achieve in general
ah
i just want get unique boolen that every player unique have to true or false
example please?
LOL
probably not what you want
maybe this? Player player = (Player) e; player = (Player) new HashSet<String>();
should be write
won't run
now i can add anything to player
eh?
That will result in a class cast exception
I guess you want to attach data to a player?
Does it need to persist across restarts?
Okay, then you can use Map<UUID, String> - or more concretely:
public class MyClass {
private static final Map<UUID, String> map = new HashMap<>();
public void myMethod() {
map.put(player.getUniqueId(), "value"); // Insert data
String val = map.get(player.getUniqueId()); // retrieve data
}
}
i see-
would be so much fun when spigot would let you make your own player provider
If you were to want to make it persist you would have needed to either store the data yourself or use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/persistence/PersistentDataHolder.html#getPersistentDataContainer() (||Editor's note: does it persist across player deaths?||) but both approaches are painful for beginners like you
declaration: package: org.bukkit.persistence, interface: PersistentDataHolder
I can see teh compatibility issues already
ye ofc
oh
changing anything now will break all plugins
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
so "value" is the data now how check if that player have "value" in his data
I just realize something ....
Don't ever use the variable value and instead always use map.get(player.getUniqueId()) otherwise you will be confused why stuff doesn't work like you think it does
Explaining why I recommend that is pointless though given that I am fairly sure you'll quit programming within a week
i believe you scared em
You really donโt need a map for a Boolean value
Issue is they won't comprehend how to use a set since from a beginner's standpoint sets don't make sense
A map on the other hand does make sense
Player pdc should persist across deaths yes
And is more versatile - so it will avoid having to explain the same concept twice
Judging by them attempting to use them like a map I doubt so
yes
Idc much
depends on the amount of items you expect it to store, although you dont know, you kinda do
What about an AsyncImmutableCopyOnWriteDoubleLinkedHashSet
The issue with LinkedLists is that they are almost always inferior to array lists
which vectors?
They were good in the old days when CPU were much slower than RAM but these days that is simply not the case
i like those fastutil collections
So java.util.Vector?
๐
I'll personally come to your house and burn it down with lemons
The real question is when that moment will be though
Could always be in 2^(10^(10^10)) years
undefined ๐
Dayum. I bricked google
not enough bits
Im making a plugin for custem achievments right now. Is there a way i can have other of my plugins trigger things on my achievment plugin
Expose a simple api
itโs just too large, also any number over 0 is undefined
doesnโt have to be 0/0
iโm more of a fan of defining it as one
Iโve been told anything to the power of 0 is 1
But my iPhone calculator says 0^0 is error
yeah 0^0 is an edge case
but it is also undefined because of what @quaint mantle said
Cheeky edit
What if zero doesnโt feel like being raised to the power of 0
i hate the proof for 0! = 1
i saw it as n! = (n+1)!/(n+1)
i dislike integration immensely
yes
they are cool
but integration calculus is cringe
thatโs not what i said
i said i donโt like it
mod arg form ๐
rotation formula?
yeah
volumes of revolutions i call them
????? why
itโs fucking easy
oh yeah sure
Nerds
doing this right now
not quite, (3+sqrt(33))/4
where is the dx!!!!
the parametric version of this is cooler
math nerds
look iโm on my 5th hour of maths revision today cause iโve got my exam this week
i got exam in two weeks and i failed the prev exam ๐
iโve gone thru an entire pen
i believe i havent even used a whole pen in this whole year ๐
on my pc every hour
guys
i want rename a file
File file = new File("oldname");
// File (or directory) with new name
File file2 = new File("newname");```
file.renameTo(file2);
does there are any other way to rename it
i like need make whole other file and then delete
anyone?
Not sure what the issue is. #renameTo() is the way to do it
Oh
this way simple java Path source = ... Files.move(source, source.resolveSibling("newname"));
from #renameTo()
Yeah, you'll just need to use Path objects instead of Files
Ah ye it fine
Which is fine. If you have a File already you can do File#toPath(), or you can do it with Path.of()
i really was need path not file ๐ so it fix other problem
Perfect
Paths are just posh strings
what languages?
next addition in the minigame lib
the ability to individually disable certain mechanics present in vanilla
No Minestom 
what if you want uhc
PR to VRI 
can't bother
stromine
myes just to print 1 2 3
big mistake to rewrite this in c++
actually only 9 instructions
we are doing js, java and python in college
and shell ๐
actually powershell and cmd too
lessons are finished now
What are some plugin, I can add dependency to mine, currently, i have [Vault, PlaceholderAPI, ItemsAdder], but i don't have ideas to add something else to it
^^
I mean you can I guess, but why
a plugin for a cinematic camera, with a simple scripting language to make actions in markers or when it start or end, all of them are softdepends
is it on github?
no
Well
currently im not making it open source but in the near future probably yes, when the plugin will have a stable base
What do you use those dependencies for
in the action system you can for example do [MONEY_ADD] 100 and works on Vault
or use hud in itemsadder
why not, its not a bad idea thanks
I have this string that will result a gradient text:
"ยบxยบ3ยบ3ยบ4ยบ4ยบaยบaMยบxยบ5ยบ5ยบ3ยบ6ยบ8ยบ8eยบxยบ7ยบ7ยบ2ยบ9ยบ6ยบ6mยบxยบ9ยบ9ยบ1ยบbยบ4ยบ4bยบxยบbยบbยบ0ยบeยบ2ยบ2eยบxยบdยบdยบ0ยบ0ยบ0ยบ0r"
Why is this not getting accepted in getScore in Scoreboard?
just use team prefixes for that funkery
and use the score as like... an index or something
How do I use EnchantmentStorageMeta and Damageable on the same ItemMeta?
How I get keys and values from a config.yml of a "main key" ?
Imagine:
players:
p1:
name: "Yo"
description: "AHhahhahh"
p2:
name: "HEY"
description: "Nice"
``` And I want to have : p1 and keys, p2 and keys.
yeah but for whatever reason that doesn't register the item as an enchantment book
just a book with an enchanement
is a specific material
ENCHANTED_BOOK?
I have code that checks if the enchantment book is a enchant book and it fires with the creative inventory ones but not the ones made by me
show
?paste
I suspect either one of them doesn't have the meta
You need to use EnchantmentStorageMeta to add enchantments to a book
Stored enchantments are different than regular enchantments
something about slapping someone with a fire aspect book?
I remember that was a thing in ps3 edition
yeah
I see
they could've just been stupid
and hardcode a check to skip enchanted books lmao
That would be a lot of checks though
just like
a check before all the usual checks
or embed it in the hasEnchantment check or somenthign
Generally you donโt want to wear a suit when butchering pigs
I got an IRL formal party to attend next week
and I don't think I'm allowed to wear this sexy and comfy minecraft tshirt
and thats the moment i quit the video
I was looking at nms code the other day
and today looking at it again with a fresh mind
fun thing
when you damage an entity with a non-crit attack
it spawns an amount of particles corresponding to the amount of damage you dealt, in hearts
So if you deal a ton of damage, it spawns a huge amount of particles
figured it'd be hardcoded but no
and apparently it's these hearts
and they have a spread pattern
that like
they spawn outwards and creep inwards
it's goofy
Does spigot expose a way to set the last player that damaged an entity
I donโt see anything in the docs
it exposes the last EntityDamageEvent that the entity caused
so you could cast that and see the damager
it also exposes the killer if the entity is dead
The last damage event is not necessarily the last player to damage it
For example if you hit a mob off a cliff the last damage will be fall damage
But it will still recognize that a player caused the death
I am upsetti
there's this within nms
which is used for death messages
but no exposure to spigot
@worldly ingot pr time
I can always pr it myself :p
I think we are currently at a feature freeze though
Or at least close to one
Hey do you know how to link a discord-server with a plugin like make a channel on specific discord with my plugn
JDA
?
That's for me ?
Yes
maybe it just doesnt allow pinging?
JDA is a discord api for java
is it your server?
A quick question, is it a good idea to name your class as "EnchantHandler" if you just have the custom enchants in there and then call them thru different classes ?
If not, then what is the proper name of naming that type of a class ?
Oh okay, Registry is a good idea, thanks a lot @young knoll!
OHH NICE THX
general java question for creating an api, should i annotate a method @Nullable if it only returns null when there's been an exception thrown. i've only been annotating nullable if it should legitmately return null, but would it be better to add it to erroneous circumstances too
nullable means the return type is either as expected or null
if it throws an exception... it won't return null
but instead be at an exceptional state
I usually just handle bad inputs by returning null unless it's like
a critical fuck-up
oh yeah thanks, i confused nullability with an exceptional state
Optionals
nullability wrapper
#help-server we ain't your personal sysadmins
but generally just use ufw
don't forget to not lock yourself
not my fault
server pings are part of the handshake
ah yes let's allocate extra memory instead of returning the NULL constant because people might want to use anonymous classes to abstract away a single if check
Exactly!
no clue why a plugin would interfere with server status packets honestly
It's not something regarding iptables
otherwise you'd be able to connect
Do you think I can create my discord bot inside my plugin
Yep
yeah so
here's the basic runner
a client pings a server to initiate handshake
and that initial ping has some basic data
which is like
client version, what hostname it is using, player's uuid and name
and a status
it either is "server list" or "connect"
If it is server list, the server just replies with the server list data and closes the socket
If it's "connect", the full handshake occurs
So like
You either have some wicked server list plugin
or a fucked server motd config
What am i doing wrong?
use either, not both
but yeah you gotta run buildtools
do i still need null checks if i have annotations? intellij tells me no because it can statically analyse but i'm not sure if it's still safe when another package uses it as an api
you do
annotations just trigger ide warnings
cheers
they're pretty much just a warning signal
like
"ayo this can return null"
I already diagnosed your problem
maybe a bad server.properties
that has like
invalid motd data
or something
yeah but
what if it's like
just empty
alright so
and/or
there goes my memory
intellij + clion is a death sentence for ram ๐
I just have that as defaults
Only looks like you have about 5gb in use from that screenshot
Plus whatever the OS is using
What is your total ram
it could always be that they want to paste stuff for themselves
I wanted to paste something in for my question that is comming up ๐
Hey,
I am trying to create a updating scoreboard for each player. I created this class: https://paste.md-5.net/nosizitivo.java for it and a TestScoreboard with the specific scoreboard data: https://paste.md-5.net/kadimejava.java.
Top test it, I just created a new TestScoreboard Instance and passed the player: new TestScoreboard(player).
But when joining the server is logging the score got set from the sout but I can't see the scoreboard and there are no error messages in the console.
Has anyone any Idea what is wrong?
haven't messed that much with the scoreboard api so idk how it works
but generally I just use a more basic scoreboard utility class
Here's what I got
will bukkit/spigot ever pass the plugin a null event to a handler
Has a Scoreboard a mayimum lines of 15?
guys what this error mean
That scoreboard lib doesnโt support values that change without resending the whole board..
What do you mean?
You can set values to teams in a scoreboard
then you can get that team and edit that value and the scoreboard will reflect it
but it is not working for me
which PDC?
you write it to reload everything you need to.
yes because I have to get something in the config that changes every second.
Don't
take do not insert
a config is not the place for something that changes often
what are you changing and storing like that?
I know but I server to count the time a player plays
there is already statistics for that
?????
WHICH PDC? there are many different PDCs
Is your PDC on the Player, the Chunk, the world, an Item, and Entity?
then the PDC goes where the item goes.
TOTAL_WORLD_TIME?
If it is a placeable item it does not get transfered to whatever it places.
Some blocks also have a PDC
anythign with a TileState
but you have to set the PDC when it is placed.
things like Chests
playing sound is fun lol, my man casually sending a soundwave at 40Hz ๐
nice bass
hardcoded the id and lambda relation
store the ID with the lambda code
I'm assuming this is for things like special effects or powers on the item
then it's simple, POWER_ID and code is all you need
the ID is whatever power you want, and it references the code to run
same ID as you put on the item
you could or better just store the ID, Interact
not every item, just one instance per code
Whatever event you trigger from, you get the ID from the items PDC, fetch the code from the Map and run it. Be it a consumer or a Function
what?
of course you can
get Item, read PDC for ID, fetch code from Map
you don;t give EVERY item an ID
you give abilities an ID
the ID corresponds to the code that item should run
not the item
so if you put that ID on a Block ItemStack or a Stick ItemStack, they run the same code if they have the same ID
you store your code as java Consumer<PlayerInteractEvent> code = event -> { System.out.println(event.getName()); }; yourMap.put(id, code);
in your interactevent you get the item in hand, get it's ID from PDC then java yourMap.get(id).accept(event);
You only store one instance of the code not every item that uses it
why would a different lambda be assigned to that ID?
you decide that
hardcode it in your code
How can i set on the tab the rank? like what should i use to display it?
//Setup Fireball
Consumer<PlayerInteractEvent> code = event -> { Utils.fireball(); };
yourMap.put(0, code);```
Fireball will always be ID 0
Map.of(
"id0", event -> event.whatever(),
"id1", event -> event.smthElse()`
);```