#development
1 messages ยท Page 45 of 1
oh my bad wait thats only in dev
2 seconds
ignore the bonus .toSet() call that's because i'm stupid
what is the map supposed to return?
Btw, have you tried to debug to make sure the map actually returns anything?
because it should be %<identifier>_<arguments>%
well i use it in internal placeholder parsing so i'd imagine so
wait so getPlaceholders should return
["%ecoskills_placeholder1", "%ecoskills_placeholder2"?
at the moment it's doing
["placeholder1", "placeholder2"]
yeah it expects a valid placeholder
will do
So if it does work, maybe we need to update the GitHub issue to be more-so as a discussion or make it clearer in documentation that it needs to be a fully qualified placeholder?
I'd go with the second option
amazing it works thanks
Trying to add MySQL support to a program written in Kotlin. Can you guys recommend me a MySQL wrapper for kotlin or java(that still works in kotlin)?
I'm pretty sure I've asked a while ago the same exact question but I can't seem to find it so I don't remember the answers. Never gotten to actually using any of the recommendations given then.
Well actually it is a MariaDB database if that makes any difference at all
๐ฎ definitely going to give it a try. Thanks a lot!
np
I've rather liked exposed in the past.
Kmongo is around as a Mongo wrapper as well. (I know you didn't ask)
I'm a big fan of ktorm (not ktor, kt-orm lmao)
Exposed looks kinda interesting.
Does it work with relocation yet?
On spigot
Although there's the libraries feature on spigot since like 1.17 I think
And paper on 1.19.4
Why wouldn't it?
its got some service stuff or smth
there was a github issue opened but idk if it got resolved or not
i saw secretx using it though recently so i assume it got fixed or theres a workaround
Oh you can fix that with gradle
I did it here for Kmongo, technically it's ShadowJar api I think
https://github.com/DrZoddiak/Strax/blob/master/build.gradle.kts#L121-L171
idk what that does but if it works for exposed too, epic :))
Well it's just basically scanning the files looking for matches and then replaces it, very not technical at all, just looks spooky.
Could probably copy paste my code and replace the strings at the top and it would probably work though.
I am currently searching for a skilled builder who can help me with a large project that involves creating numerous buildings and structures on a custom map. Does anyone have any recommendations or suggestions on where I could find someone who is experienced in this type of work?
I can tell you that you're definitely in the wrong channel here
"Great! Could you please guide me towards the appropriate server?
If you're going to pay the builder, then #1103027378206290051. If not, then #1103027380685115473 is the channel you want.
What if I wanna talk about character development, is #development the right channel?
๐ฆง
Yes it is not
๐ซก
Has anyone contributed to refined-github? I want to make a function that hightlights // todo comments and it is not working 
https://github.com/iGabyTM/refined-github/tree/feature/highlight-todo-comments
If I add a console.log outside the init method it is printed, but not the one inside init and I have this warning in console
DevTools failed to load source map: Could not load content for chrome-extension://dehmkhkfkicaaafgjnhpmlocdafjedmh/index.js.map: System error: net::ERR_BLOCKED_BY_CLIENT``` which points to refined github
Using Tailwindcss.
I have a div(grid) that contains 2 components: text and image. The text component contains 2 other components: h2 - title and p - description
I want that when a user hovers anywhere on the grid the style of the h2 and p components change. If I use hover: in the h2 and p components, the style will only ever change when I hover over the text and not anywhere over the big component.
Oh shit
could have a :hover on the div and use JS to change the style
just found out about the group class
xd
yep. this works.
Someone called me?
Idk. Did anyone call you?
Lol
Is there any way to use paper's api for pathfinding on client side entities? I'd say no, but I hope for yes ๐คฃ
the server doesn't have api for something that doesn't exist there
Yeah fair
you would have to make a server-side entity then hide it from everyone or something
or, just code all the pathfinding again yourself
also idk how efficient getting a block at a location in Paper is nowadays
last time i tried to do something similar, i literally made a separate data structure to store all blocks in the world separate from minecraft, and keep them synchronized on chunk load and block change, all just to make it faster to get which block it is at a specific x,y,z location
and i could only get away with it because it's a minigame server, because it basically doubles ram used for each chunk
what
that is most definitely not what happens lol
unless you are creating a ChunkSnapshot, which, you know, by definition is a (very limited) copy of the whole chunk, but even that is very optimised
I read that as "it literally made a separate data structure..":๐
re-storing all the blocks ๐
but getting a block is.. fast
A Block is literally nothing more than a fancy Location, it just keeps xyz and the region
it should be pretty fast, like a 1 ms at most
unless the block is not in the memory? then the overhead of loading the chunk/data from disk adds up, no?
getting a block from a location doesnt do any chunk loading
wait what
what if the chunk is unloaded?
oh
does it just call world methods
this is all it does
it's "lazy", if you will
it doesnt actually do anything until you call a method
ic
didn't know that ๐ค
me neither until i checked at 21:39 (GMT + 1)
Bukkit's design is amazing
Best way to remove placed blocks (reference stored in a List/Map) when turning off the server?
If i recall correctly setting block type to air doesnt work onDisable as it gets ignored (i think)
Calling saveWorld in onDisable bugs light (iirc)
Any good way?
setting to air should probably work in onDisable, i think
i think plugins disable before the world
I remember i tried but it didnt save changes, and calling saveWorld saved the air blocks but bugged light xd
https://www.spigotmc.org/threads/when-is-ondisable-called.136009/#post-1442545
according to this guy it is saved last
- at the end of latest.log, you always see like
Saving worldsafter plugins are disabled
ยฏ_(ใ)_/ยฏ
I tried, weird, will try again later xd
a bit late but what if instead you store that list somewhere and then set blocks on enable? idk lol
Arbitrary
Cool theme ๐
Is it your own?
Nah itโs just atom one dark lol
https://paste.helpch.at/epabepojuc.typescript
https://paste.helpch.at/tagajokesi.java
Can't figure out what is wrong errors are:
Multiple markers at this line
- Cannot make a static reference to the non-static method getItemConfig(ItemStack) from the
type Config
- ItemConfig cannot be resolved to a type
If I want to use AdventureComponents/MiniMessages with papi is the only way of doing it to get a string, replace the placeholders and then serialize that using MiniMessages? Doesn't seem like the best solution
Makes sense to me
theres a method directly on the component
I don't remember what its called tho
Try Component#replaceText
@@Contract(pure=true) @@NotNull
Component replaceText(@NotNull @NotNull TextReplacementConfigย config)```
Finds and replaces any text with this or child Components using the provided options.
4.2.0
a modified copy of this component
config - the replacement config
(theres also another method that accepts a Consumer<TextReplacementConfig.Builder>)
for more help I'd recommend going to kyori discord
They started there
oh
crossposting without referencing the other message ๐
they're getting it from the config, so config -> papi -> component is the best approach
String -> parse placeholders -> minimessage
ok bruh didnt see ur message
Hey there, maybe on of you guys can help me!
I have the following pom.xml file and I want to import the PlaceholderAPI:
<?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>net.atrophygames.obscrts</groupId>
<artifactId>LobbySystem</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
No matter what Im trying it cant resolve it
Do you get any errors when reloading maven?
When reloading maven I get this error "Could not find artifact me.clip:placeholderapi:jar.2.11.3 in central (https://repo.maven.apache.org/maven2)"
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<repository> <!-- remove this -->
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repository>```
You got a `<repository>` tag inside another
Thank you very much, should have noticed that myself๐ฅฒ
np
classic maven L
hi hi hi, i have a variable of type PlaceholderExpansion (placeholderapi), and i need to set that value with an expansion
then, if papi is installed, that expansion will be registered when the plugin starts. i still want to be able to set the variable tho even if papi isnt installed, but when i try to (and papi isnt installed), the plugin fails to load
ive tried using a supplier but that didnt work, only other thing i can think of is having a getPapiExpansion() method that the person would override to provide their expansion (and then call that method after checking if papi is installed)
sorry but what
yeah i expected that lmao, i suck at explaining ๐ญ
You can't do that. If PlaceholderAPI isn't installed then it won't find the class PlaceholderExpansion so you'll get a NoClassDefFoundError
yeah so is there a way around that?
Before accessing the variable of type PlaceholderExpansion you can check some boolean flag, like "is papi enabled" and if that is true you proceed to use the expansion variable
yeah i thought about that too but it wouldnt be intuitive for my framework (even tho much of it already isnt)
variable: https://github.com/srnyx/annoying-api/blob/main/api/src/main/java/xyz/srnyx/annoyingapi/AnnoyingOptions.java#L114
example: https://github.com/srnyx/annoying-api/blob/main/example-plugin/src/main/java/xyz/srnyx/annoyingexample/ExamplePlugin.java#L37
ignore how its called an API ๐ญ
Time to make it intuitive
since the expansion is optional, having to check a flag before supplying a value should not be that much of a problem
ยฏ_(ใ)_/ยฏ
the api is meant to do the checking tho, person is just supposed to supply it
maybe you can get around NoClassDefFoundError with a class that extends PlaceholderExpansion and to extend that class for your expansions instead of PlaceholderExpansion directly
yeah i have that already, AnnoyingPAPIExpansion, and tried using it directly but it still started crying about PlaceholderExpansion
welp then I guess you have run out of options
I know java doesn't complain if you import the class but it doesn't exist. Does it complain if you use it as a method's return even if you don't use the method?
It would make sense, but Idk which is why I'm asking
nah as long it is not referenced anywhere you can have missing classes
yeah thats what i was gonna try with the getPapiExpansion() thing i mentioned in my original message
it's a bit yucky but i dont see another way 
you can move the getter inside the plugin class and call it only if papi is enabled
so instead of doing options.papiExpansion = new Expansion() you override a method that returns the expansion
it doesn't work because the class doesn't exist
but i thought it (the expansion) would only be constructed when Supplier#get() is called
yeah idk, you probably didn't used it right
imma try it with lambda again then try it by writing out entire new supplier thingy and overriding get
there shouldnt be a difference between the two
to be pretentious, they are isomorphic
your mother
yeah im assuming there isnt but im just curious
you will disappointed
dont say that ๐ญ
you will disappointed
oops
stop!!
funnily enough, it depends on how the supplier is used
something like () -> new T() would be the same, but T::new will perform classloading shenanigans
new Supplier<PlaceholderExpansion>() {
@Override
public PlaceholderExpansion get() {
return new ExamplePlaceholders(ExamplePlugin.this);
}
};
```it fails cause of the first line which makes a ton more sense now
as in eagerly loading the T class?
?
yes
the first one will create a separate method that calls the function code, the second one simply "points" to the constructor
although, yada yada compiler implementation detail
thats instead of just:
() -> new ExamplePlaceholders(this);
i dont understand >it fails cause of the first line which makes a ton more sense now
why
what is the first line
it is constructing a Supplier with the PlaceholderExpansion as it's type (or whatever its called), which doesnt exist
oh
huh
so that's basically exactly what emily was saying lol
guess i shouldve scrolled up before confidently saying there's no difference ๐
i dont ever understand what emily is saying so i just tune her out
rude
have you heard of our lord and saviour Abstraction?
Abstract face
no thank you
\๐ฆ
\๐ต
but also, why are you storing an instance of a PlaceholderExpansion? if all you really do with it is basically register into PAPI lol
very wise question
so that the api (framework) can register it when it wants to
and why not just.. create it on the spot if papi is available and register it?
cause then thats more work for the person using the api (aka me)
?
instead of
private Supplier<YourMotherExpansion> expansion = ...;
// later on
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
this.expansion.get().register();
}
just
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
new YourMotherExpansion(this).register();
}
it would actually be:
instead of:
options.papiExpansionToRegister = new Expansion(this);
```do this:
```java
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
new Expansion(this).register();
}
```which is just a tad bit more work, but in the long-run it helps me a ton to make as much possible (thats repeated in my projects) to be handled by the api
except that papiExpansionToRegister would be a supplier, no?
well it cant even be a supplier, it would have to be a method, so it'd be more work my way actually ๐
but still, letting my api handle registration is just way easier for my little pea brain
a supplier is a method
i mean like a method to override
uhu
supplier isnt working
i mean a method that doesnt have a type thingy
so a Supplier<Object>?
ok
what
im using this now btw and just casting it to PlaceholderExpansion when registering in the api, ty
๐
anyone got an example of a configurable recipe in a YML? it should support both shaped and shapeless. too lazy rn to figure it out myself ๐
not asking anyone to make it for me, just if u know of an existing plugin that has this
this is what i have rn btw:
# The ingredients for the recipe. If you want to disable the recipe, set this to {}
ingredients:
B: BEACON
R: REDSTONE
# The shape of the recipe. If you want the recipe to be shapeless, set this to []
shape:
- " R "
- "RBR"
- " R "
```only problem with it is that if `shape` is `[]` (so shapeless), there isnt a way to specify the amount for each ingredient
wait would this just work:
# The ingredients for the recipe. If you want to disable the recipe, set this to {}
ingredients:
B: BEACON
R: REDSTONE
# Whether or not the recipe doesn't require a specific shape
shapeless: false
# The shape of the recipe (if shapeless is true, it doesn't matter where the ingredients go)
shape:
- " R "
- "RBR"
- " R "
```and then i can just get the amount of each ingredient from the number of items it shows up in `shape`?
I don't see why not, though I think spaces for empty slots might not be ideal necessarily
well they'd be necessary for shaped recipes
Empty slots would be necessary, I don't think those should be represented by spaces.
what would u suggest? spaces most closely match what the recipe would look like in-game
Probably dashes or underscores. Some symbol.
You're free to go with spaces, I just have a feeling it may lead to confusion.
ill add support for dashes & underscores
iirc spigot uses spaces in the api
so it might be good to leave it for consistency
yeah it does, thats why imma just make it support all 3
maybe not _ tho, cause ppl can use that as an ingredient (but not - cause its an invalid YML key), even tho they probs wont
Is it a good idea to listen PlayerInteractEvent while creating a GriefPrevention copy?
why wouldn't be?
it can be fired twice and it means double message to player
@Nullable
public EquipmentSlot getHand()```
The hand used to perform this interaction. May be null in the case of Action.PHYSICAL.
the hand used to interact. May be null.
yep, that seems logical thanks
as far as I can remember it gets fired when someone places or breaks blocks too right?
then I will check it, thanks
Hello! I want try to develop plugin or mode. The basic idea: the concept of energy, mages, spells, and other things appears in the world.
Objects and a character can store energy and use it.
I've never encountered development for Minecraft, can I clarify - can it be done as a plugin, or only as a mod in any case?
I apologize if I wrote in the wrong place.
depends what the extent of it is
You should be able to do it as a plugin and I don't suggest you to start with mods before you know Java/Kotlin really well.
What you should learn while making the plugin:
Particles
Resource packs and custom models (optional)
Creating custom recipes
Working with persistent data storage, NBT
Using a database (most likely, I don't suggest you to store data in YAML files)
Not Work ( placeholder ... )
This is Me Code i need help ...
public class LevelSystemPlaceholder extends PlaceholderExpansion {
private final LevelSystemMain plugin;
public LevelSystemPlaceholder(LevelSystemMain plugin) {
this.plugin = plugin;
}
@Override
public String getAuthor() {
return "LevelSystem";
}
@Override
public String getIdentifier() {
return "levelsystemtags";
}
@Override
public String getVersion() {
return "1.0.0";
}
@Override
public boolean persist() {
return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload
}
@Override
public @Nullable String onPlaceholderRequest(Player player, @NotNull String params) {
if (player == null) {
return "";
}
if (params.equalsIgnoreCase("level")) {
return "[" + LevelSystemDataBase.GetLevel(player) + "]";
}
return null;
}
}
Main:
if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
new LevelSystemPlaceholder(this).register();
}
Could you please use a paste bin service to put the code in? https://paste.helpch.at
Also, we would love a bit more context. What have you tried? What doesn't work?
Thanks you!
use onRequest method
Can i ask one more question please? What is the best site to study this on? Not java, but to work with Minecraft and the sections described.
I learned all by watching around 7 tutorials on YouTube from Kody Simpson and then I've been experimenting and looking into the docs, can't say what's the best
Thanks!
If you're using a reasonable api the java docs should suffice rather well
Im trying to add placeholderapi lore for pinger and it'll just out put exactly (%pinger_players_localhost:25569/%pinger_max_localhost:25569%) %pinger_online_localhost:25569% instead of (0/0) Offline heres my code
ItemStack item1 = new ItemStack(Material.NETHERITE_SWORD);
ItemMeta itemMeta1 = item1.getItemMeta();
itemMeta1.displayName(Component.text("KitPvP")
.color(NamedTextColor.DARK_BLUE)
.decorate(TextDecoration.BOLD)
.decoration(TextDecoration.ITALIC, false));
List<Component> item1Lore = new ArrayList<>();
String playerCountPlaceholder = "%pinger_players_localhost:25569%";
String maxPlayersPlaceholder = "%pinger_max_localhost:25569%";
String onlinePlayersPlaceholder = "%pinger_online_localhost:25569%";
String playerCount = PlaceholderAPI.setPlaceholders(null, playerCountPlaceholder);
String maxPlayers = PlaceholderAPI.setPlaceholders(null, maxPlayersPlaceholder);
String onlinePlayers = PlaceholderAPI.setPlaceholders(null, onlinePlayersPlaceholder);
item1Lore.add(Component.text("(" + playerCount + "/" + maxPlayers + ") " + onlinePlayers)
.color(NamedTextColor.WHITE)
.decoration(TextDecoration.ITALIC, false));
item1Lore.add(Component.text("Kits, Duel, Bounties!")
.color(NamedTextColor.WHITE)
.decoration(TextDecoration.ITALIC, false));
addLoreToList(item1Lore);
itemMeta1.lore(item1Lore);
AttributeModifier modifier = new AttributeModifier(UUID.randomUUID(), "generic.attackDamage", 0, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND);
itemMeta1.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
itemMeta1.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
item1.setItemMeta(itemMeta1);
inventory.setItem(29, item1);```
cursed
wdym its cursed
why do you parse the placeholders individually
so i can add lore in a single line?
you can have multiple placeholders in a single string
PlaceholderAPI.setPlaceholders("(%pinger_players_localhost:25569%/%pinger_max_localhost:25569%) %pinger_online_localhost:25569%")
Yea but it'll output plain text
Even though pinger is already installed
Cause I used that for citizens or npc and it works just fine

Yeah I know it's weird
do the placeholders work if you use them in-game?
if not, try to replace localhost with the ip of the server
for pterodactyl (docker) it is smth like 172.x.x.x
papi parse works fine with that so it certainly works
yeah I know localhost works but not on all setups, and that is the most common issue with the pinger expansion
still shows plain text of it...
well it does work on citizens hologram...
so the same placeholder works somewhere but not in the parse command?
but with my Server Selector GUI doesnt work
Wdym parse command? Isn't it like /papi parse me %pinger_players_localhost:25569%
yes
what if you try --null instead of me?
It output as 0
dont cross post @trim hornet
Oh sorry
That what it supposed to output but I don't know why it won't do same argument as PlaceholderAPI.setPlaceholders("(%pinger_players_localhost:25569%/%pinger_max_localhost:25569%) %pinger_online_localhost:25569%")
Everytime menu is opened
you need to pass the player to setPlaceholders
How can I achieve it?
i don't think pinger uses the player anyway
idk what they are even trying to do but it looks wrong
Yeah that what I thought
you can not pass a player to setPlaceholders if that's what you're concerned about
yes
you just said you can not
you can not, not you cannot
Could not would probably be more clear
ah yes
One of those dumb English moments
yeah it doesn't
but it seems with --null it doesnt work (if i understand correctly)
Is there any with with kyori / components when using Component#replaceText(Builder.match(Pattern)) it can ignore colours 
any with with
i hate it here
i love you too
With --null on /papi parse does works
This almost makes sense in kotlin.
you mean that if the color is changed in the middle of the word it doesn't match it?
yeah
hmm weird behaviour
Specifically using rainbows or gradients causes it to not match
yeah that's not gonna work
I wonder if kyori has a guild
Component#replaceText(builder -> builder.match("\[(item|i)]"));
stripping the text colours and adding them back is so jank too
why dont you use <item> and MM?
Huh
Huh
Huh
yeah too much work
wdym too much work
wdym too much work
I thought you want to add a hover to that?
its easy af
Would that work with Legacy? I mean when you deserialize using LegacyComponentSerializer a text like
&#rrggbb**[&#rrggbbi**&#rrggbbt&#rrggbbe&#rrggbbm&#rrggbb**]**

Is it possible to create blockdata without actually having a placed block?
The BlockDisplay setBlock method requires block data
but I can only find examples of getting block data, not creating it
Yes
Material.BROWN_MUSHROOM_BLOCK.createBlockData("[down=false,east=true,north=true,south=false,up=true,west=true]")
Pretty sure CraftMagicNumbers also has a method.
why'd you use internals for that lol
Is there a way to use kyori adventure text 4.13.0 on version 1.19.2? I want to use the ClickEvent.callback() method but the server is saying that method does not exist so I assume that this version of paper does not have the latest adventure api.
I think you can shade and relocate adventure, but that means you can not use any methods from paper that take/return components
Is there a way to see what version the server api is using for adventure?
I would highly recommend making a util method
if you don't, then as gaby mentioned, you can't use any paper methods that use adventure (deprecation warnings incoming unless you use 1.16.4 api)
paper has META-INF/libraries/... and there are all the libraries
Well I don't use function that return components anyway I use my own utility but I am probably going to just use send command click event instead.
You don't use Player#sendMessage?
paper 1.19.2 b307 uses adventure 4.11.0
why not update ๐คจ
Mythic Mobs
for me, the server owner had custom built plugins which wouldn't work on 1.19.4 ๐
update the plugins? lol
they prob wouldn't go that far to just update to 1.19.4 ยฏ_(ใ)_/ยฏ
not every plugin is updated yet ๐ also been working on the project for 2 months its not as simple as updating a few plugins lol
I would strongly advise to update at any costs, there is a major crash exploit in โค1.19.3 (and vanilla 1.19.4 too (and spigot))
๐ฎ
๐
Emily making shit up ๐
i wish
That does sound pretty nuts though, big if true
how do i get the time in a timezone?
i have a timezone variable thats set to london's timezone and one thats set to my system, they are different, but i cant figure out how to get boths time.
or well when i get their times it always returns my systems time
TimeZone timezone = TimeZone.getTimeZone("Etc/GMT-12");
TimeZone mine = TimeZone.getDefault();
System.out.println(timezone.getDisplayName() + " / " + timezone.getID() + " / " + timezone.getRawOffset());
System.out.println(mine.getDisplayName() + " / " + mine.getID() + " / " + mine.getRawOffset());
System.out.println(Calendar.getInstance(timezone).getTime().toInstant().toEpochMilli());
System.out.println(Calendar.getInstance(mine).getTime().toInstant().toEpochMilli());``` it just returns
GMT+12:00 / Etc/GMT-12 / 43200000
Eastern European Standard Time / Europe/Tallinn / 7200000
1683603402617
1683603402617
epoch milli has a parameter or smth (not sure which method has the parameter)
By default, i'm pretty sure it's UTC timezone though
I think I did it a loooong time ago
I forget now though
i figured it out, used LocalTime and added the timezone offset as seconds to it, didnt use a TimeZone class
how do I stop maven from modifying my resource files coz it looks like its modifying my .schem file
Use Gradle ๐ค
You can add filters for resources afaik
does deluxemenus have a wiki for it's API (fully documented)?
deluxemenus doesn't have an API
is there any plans for it?
yes. but it ain't happening any time soon. the plugin is a mess. the hope is to open source it with the next major release which would allow other people to help us clean it up a bit and start working on an API.
as I wish to use deluxemenus as a proxy for my GUIs creation while my plugin handles the database storing & sharing to deluxemenus (basically reducing my workload by 3 times)
I see, thank you
I just noticed this is the wrong channel, my apologies
you could use a library such as triumph-gui for this.
The thing I'm worried is the configuration which is why I'm was thinking of putting it all on deluxemenus so it handles it instead of me
Ghost messages ๐
My bad ๐ . Already found it ๐
๐
๐
\๐
https://github.com/KDharmarajanDev/NPCSyncBungee
https://github.com/KDharmarajanDev/npc-sync-spigot
Does anyone know of a velocity version of this/something similar?
If you want to keep that plugin, you only need a small velocity plugin, all the bungee part does is to send the PluginMessages to the other servers
I wonder if it would work with Snap for testing.. time to try it out
Nope, but the spigot plugin also needs some updates for NMS anyway, so we'll just update it eventually ๐
what am i supposed to put for name for an AttributeModifier? just the name of the Attribute its modifying or what?
d;AttributeModifier#getName()
@NotNull
public String getName()```
Get the name of this modifier.
name
i think i figured it out btw ^
just an identifier so that u can have multiple of the same modifier
got another question tho, whats the best way to identify an itemstack for use in things like events?
example: i have an itemstack that i give to a player (Item A). whenever the player right-clicks with Item A, X needs to happen. Item A's display properties (name, lore, enchantments, flags, attribute modifiers, material, etc...) r all dynamic, so they cant be used to determine if the item used in the event is Item A. so what can be used?
this is just an example, not actually what i need to do, just something similar
d;PersistentDataContainer
public interface PersistentDataContainer```
PersistentDataContainer has 8 methods.
This interface represents a map like object, capable of storing custom tags in it.
or PDC for short
it can go on ItemStacks, entities, chunks, and tile entities (blocks that store extra data such as furnaces, chests, etc)
how? i dont see a method for it
its on ItemMeta
ohhhh
nooooo it was added in 1.14 ๐ญ
i really wanna keep 1.11-1.13 support cause its goofy
there's NBTAPI which prob can do it
but that requires another api
which optimally is added onto the server
at least for me since i occasionally ran into nbtapi shading bugs ๐ฅฒ
or nms
hmmmmmmmmm
i got an idea
o why?
its 1.11
it was originally 1.8, but some stuff required 1.11 (and i didnt know how to do reflection)
ill use lore for 1.11-1.13 and then PCD for 1.14+
i can set the lore after the "dynamic" one is set
only problem is the line number, since i'd want the identifier to be on the last line
how are u gonna make a hidden lore tho?
I feel like the safest way would be to make a custom enchantment
since that doesn't show (only vanilla enchantments show on lore unless added manually)
it wouldnt be hidden, 1.11-1.13ers will just have to deal with it LLLL
but how do u do a custom enchant?!
oh
oh yeah u literally just extend the enchantment class
time to make my own datastorage system that will adapt based on server version :DDDDDDDDDDDD (sucks to suck for ppl updating from 1.13 to 1.14+ LLLLL)
alright heres what i made, untested: https://paste.srnyx.xyz/faduyimuxo.java @dusky harness :))
uhhhh
isn't ID supposed to be the same for the enchant?
wdym? it is if they provide the right key
also, that constructor doesn't exist in 1.13
:DDDDDDD
wait which constructor
spigot actually removed something without deprecating it??!?!?
!!!!!!!!!!
๐
ok whatever ill just make another exception for 1.13
but everything else looks good right?
I would make a separate class for Enchantment, then add its own method as I think the ID is supposed to be unique per enchant-type
here's the reflection stuff btw: https://paste.srnyx.xyz/womaluxima.java
๐ฅด
oh also make sure to load it lazily (don't initialize it right away) because it will throw an error if the method/class is not found
actually
is this even possible
it is unique tho
u can't do this with reflection anyways
you're making a subclass of Enchantment so you can't use reflection to call a different super constructor
new Enchantment(key.hashCode())
this part
r u sure?
yea because java won't compile without calling that constructor
wait i just noticed something
ReflectionUtility.persistentDataContainerSet.invoke(ReflectionUtility.namespacedKeyConstructor.newInstance(plugin, key), ReflectionUtility.persistentDataTypeString, value);
this is literally doing nothing ๐
the item is nowhere in that
it was only supposed to be annoying for the person using it ๐ญ
nbtapi is prob the only chance now
I don't think your API should shade in NBTAPI anyways though
maybe you could have like an NBTUtility class
ยฏ_(ใ)_/ยฏ
Idk
nbtapi is so stinky tho
๐คจ
what timezone?
You're 1 hour older than me HAHA
๐ฅฑ
one hour closer to death, see you in an hour.
just maybe...
i cant see u in an hour because in an hour ill be in the future an hour in ur perspective which means you'll always be 1 hour in the past in my perspective, never aligning
Sure, but I'll see you in an hour
๐คจ
I can see you, you can't see me, sorry. I don't make the rules
which packets are for when a player executes a command ? (trying to cancel a plugin's message when someone sends the plugin command)
i would assume PacketType.Play.Client.CLIENT_COMMAND but that doesnt work
tried PacketType.Play.Server.COMMANDS too
Its just chat iirc
ah ok
ill try that
is there any way to get the clients full command from the packetevent?
nvm i found out
which uses less resources when using a bukkit scheduler task timer?
having 2 timers, one at lets say 1 second intervals and another at 10 minute intervals
or 1 timer, counting how many times its ran to see when to run the code for 10 minute intervals
or even on a grander scale, if i have a list of classes and they have a timer in them, should i just run 1 timer that runs a method in all those classes
Hello all ๐
I'm currently trying to detect if my item has the flag 'HIDE_ENCHANTS'
public void EnderEyeHold(PlayerItemHeldEvent event) {
Player player = event.getPlayer();
ItemStack itemStack = new ItemStack(Material.ENDER_EYE);
ItemMeta itemMeta = itemStack.getItemMeta();
if (player.getInventory().contains(Material.ENDER_EYE)) {
player.getInventory().addItem(new ItemStack(Material.DIRT));
if (itemMeta.getItemFlags().equals(ItemFlag.HIDE_ENCHANTS)) {
player.getInventory().addItem(new ItemStack(Material.STONE));
//player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 100, 1));
}
}
}```
This is what I've written. I've been testing it as I go in game using the temporary dirt and stone feature but it seems to get stuck at the If item flag part. Is anyone able to explain what I'm doing wrong here?
Only check for contain
List<ItemFlag>#contains?
โฌ๏ธ
d;itemmeta#hasitemflag
boolean hasItemFlag(@NotNull ItemFlag flag)```
Check if the specified flag is present on this item.
if it is present
flag - the flag to check
@dusky harness itโs possible with java proxies (I think, thatโs what chatgpt and some stackoverflow thing said)!!
I'm developing a plugin that is like griefprevention, I want my players to be able to add other players to their regions by a command.
I'm saving whitelisted players via their UUID. Is the following code best way to get a uuid of an offline player?
val selectedPlayer = Bukkit.getOfflinePlayer(firstArgument)
val uuid = selectedPlayer.uniqueId.toString()
alot of plugins avoid dealing with offline players and just allow online players to be added cus getting the uuid from a player name is quite slow or has api limits from mojang. tho id assume that method is the best way
selectedPlayer.uniqueId ๐ฅด
uniqueId is a method not a variable?
I'm using Kotlin it refactors getters setters automatically
yeah that works.
spigot (I think) automatically assigns offline players an UUID which is
UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8))
People stop using Java and you should too ๐ค
Yeah, it's much better to check for them ๐
You'd have to do it on purpose
i assumed they wanted to get the uuid of a player thats not on the server
same thing
I mean, at some point the server will create the uuid for that player, but that only works for offline mode servers @broken elbow
thats what i was trying to say
Anyone know why getClass would be returning class java.lang.Class on an object rather then its actual class?
Ex;java Class<?>[] parameters = new Class<?>[params.length]; for(int i=0; i<params.length; i++) { parameters[i] = params[i].getClass(); getLogger().info("DEBUG (ReflectedClass:Method) >> Param: "+parameters[i].getName()+" : "+params[i]+" : "+params[i].getClass()); } Outputs DEBUG (ReflectedClass:Method) >> Param: java.lang.Class : interface net.minecraft.server.v1_16_R3.Packet : class java.lang.Class
When you call the getClass() method on an object in Java, it returns an instance of the java.lang.Class class, which represents the metadata of the object's class. The java.lang.Class class provides various methods to query and manipulate the properties of a class at runtime.
The reason you don't get the actual class object itself is because Java follows the concept of type erasure. This means that, at runtime, the JVM (Java Virtual Machine) does not keep track of the specific type of an object. Instead, it maintains the metadata about the class, which includes information such as the class name, superclass, implemented interfaces, and other details.
Use case is a parameter array for looking up methods.
So how would I get the class (interface) to use as a parameter in an array? (Array is Class<?>...params)
Method.getParameterTypes() outputs Class<?>[]
thanks chatgpt
I donโt get what youโre asking, can you give an example of expected input & output
Yeah give me a sec
public ReflectMethod getMethod(String name, Object...params) {
Class<?>[] parameters = new Class<?>[params.length];
for(int i=0; i<params.length; i++) {
parameters[i] = params[i].getClass();
getLogger().info("DEBUG (ReflectedClass:Method) >> Param: "+parameters[i].getName()+" : "+params[i]+" : "+params[i].getClass());
}
return reflection.getMethod(classReflect, name, parameters);
}
public void runTest(Player p) {
Class<?> packetClass = reflect.getClassFromCache(PacketClass.PACKET).get();
sendPacketMethod = sendPacketMethod == null ?
class_Connection.getMethod("sendPacket", packetClass) : sendPacketMethod;
getLogger().info("DEBUG (SendPacket) >> Send: "+(sendPacketMethod == null));
}
runTest(player) will error because sendPacketMethod is null because params[i].getClass() is not returning net.minecraft.server.v1_16_R3.Packet but instead returning java.lang.Class
Also don't worry about 1.16 lol it would be the same for all versions. I'm just currently testing with that.
Uh, why don't you use Packet... params then?
Cause the method isn't solely used for packets and Packet is based on the version.
ok
I'll just make a method that ignores the params check
You are passing Class packetClass, on which then you do (effectively) packetClass.getClass(), which is, well, Class
๐คฆ lol
I still just made a method to ignore parameter types so all good lol
Ignore what parameters?
When it searches the methods it tested the parameter types.
Similar yes.
My search method is basically```java
public ReflectMethod getMethodByReturnType(Class<?> location, String name, Class<?> type, Class<?>...params) {
loopMethods {
// test name
// test type
// test params (Arrays.equals(Method.getParameterTypes(), params))
return new ReflectMethod(Method);
}
}
How is getting a method "by return type" supposed to work, isn't like you can have two methods with the same set of parameters but different returns 
Minecrafts obfuscation makes multiple methods have the same name but with different return types.
You still can't achieve that
I already have...
Ultimately they will also have a different set of parameters, or number of
The method already works lol
gaby doesn't understand bytecode, day #1
๐ฆ
Its the parameters that caused the issue.
Which emily actually clarified what was wrong.
Interesting to know that with bytecode you can bypass some java limitations I guess, if that' what you mean
yess
yeah itโs just a source level limitation lol
good to know
Him honk nose
sure i can help for a bit
can u move to another channel like #minecraft tho
Whys does this /^(\d{2}).(\d{2}).(\d{2,4})$/g tests true on this 19052012?
(javascript)
ok i inderdstand now
geez my brain sometimes

hey anyone really good with packets/nms
eh
just go ahead and ask
I've used packets but not much nms
how would you go about making an invisible ender dragon death
https://www.spigotmc.org/resources/prodigynightclub.58234/ like this
you would think so..
what happens if you try?
but it only makes dragon death sound
did you set the correct location too?
can u put the code here?
hmmm
it says "sound or particle effect" and these aren't particles
so you're probably right
you could use ProtocolLib (if you're not already) to setup a packet listener for most packets (besides movement, ping/pong, etc)
it's what I did sometimes to find out what packet was used in the past
it will just send status packet
which works but i cant make the dragon invisible
wdym status packet?
didn't read the full conversation but the dragon death is heard on the entire server
this packet play_server_entity_status (took long to find)
and im kinda using skript (idk if u know what tat is) but if you dont providing the code wont really help
soooo
How would I go about checking if a player has a unique helmet on whenever PlayerToggleSneakEvent triggers.
This is what I've got so far and it works. Hopefully anyone can point me in the right direction?
public void onSneakEffect(PlayerToggleSneakEvent playerToggleSneakEvent) {
Player player = playerToggleSneakEvent.getPlayer();
if (player.isSneaking()) {
for (Entity entity : player.getNearbyEntities(10, 256, 10)) {
if (entity instanceof Player) {
Player livingEntity = (Player) entity;
livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 200, 0));
livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 200, 0));
}
}
}
}
}```
check if player has a unique helmet
yes that's the goal but I'm unsure on how to go about doing that.
would doing something like this work? Or is there a way of targeting the helmet slot.
if (!itemStack.getItemMeta().hasItemFlag(ItemFlag.ITEMFLAG)) {```
you can use player.getInventory().getHelmet()
then for identifying the unique item, if you're on 1.14+ you can use PDC (PersistentDataContainer)
It's basically persistent data that can be put on some stuff such as ItemStacks
https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/
thanks for explaining ๐ I'll look into that
@dark garnet
PDC is technically on 1.13 btw
using the CustomItemTagContainer api
i just found out
but at this point
using 3 different apis for item storage-
is barely overdoing it and i should make it more complex
agreed
๐
only 1.13.2 btw
idk but 1.13.1- will just use enchantments
cant
remember
1.13 mc removed IDs
and spigot removed its backwards compatibility ๐
ok so 1.13-1.13.1 will use namespaces
and 1.11-1.12.2 will use ids
ya
typo
no still cant
yes can
.
i have no idea what proxies are but either you'd prob have to use modules or some funky bytecode modifying lib
InvocationHandler handler = new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (method.getName().equals("abstractMethod")) {
System.out.println("Abstract method implementation");
return null;
}
// Handle other method calls
return null;
}
};
example that chatgpt gave me lmao
idk how imma do it yet
oh it wont work
i dont think
since interfaces dont have constructors
and proxies have to be interfaces
according to https://stackoverflow.com/a/1001289
To create a sub-class of an abstract class via reflection and override its abstract methods, you can use the java.lang.reflect.Proxy class along with an InvocationHandler to provide the implementation of the abstract methods.
Here is an example of how you can do it:
Assuming you have an abstract class AbstractClass with an abstract method abstractMethod():
Copy code
public abstract class AbstractClass {
public abstract void abstractMethod();
}```You can use reflection to get the Class object of the abstract class:
```java
Class<?> abstractClass = Class.forName("com.example.AbstractClass");
```You can then create an instance of the InvocationHandler interface, which will provide the implementation of the abstract method. In this example, we will provide a simple implementation that just prints a message:
```java
InvocationHandler handler = new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (method.getName().equals("abstractMethod")) {
System.out.println("Abstract method implementation");
return null;
}
// Handle other method calls
return null;
}
};
```Finally, you can use the Proxy.newProxyInstance() method to create a new instance of a subclass of the abstract class, passing the InvocationHandler as a parameter:
```java
Object subClass = Proxy.newProxyInstance(
abstractClass.getClassLoader(),
new Class[] { abstractClass },
handler
);
```You can then cast the resulting object to the abstract class and call its methods:
```java
AbstractClass subClassAsAbstract = (AbstractClass) subClass;
subClassAsAbstract.abstractMethod(); // Will print "Abstract method implementation"
```This way, you can provide your own implementation for the abstract methods of the reflected abstract class.
is that chat gpt
gonna bump this down here
๐ฅฒ
xp ๐
lmao
yeah ull need asm or smth
๐คช
if you want your code to be wrong and fail, go ahead and be my guest lmao
i barely use it. it kept giving me stuff that looked like it would allow for dynamic proxy on constructors with parameters. then i asked it if it was possible and it said no 
so imma just use lore
what if a plugin uses setLore tho
ok what u suggest?
this
no for 1.13-1.13.1
i wouldn't support those versions
that'd be so random tho
i mean
im not sure if anybody uses 1.13-1.13.1
ex there are some plugins that only support the latest of each minor version
supporting the latest of each major release is understandable, but wanting to support every single release is simply stupid
being stupid is more fun
a
Does anyone know how to properly rotate a passenger armorstand?
If I try rotating the vehicle, the armorstand snaps back into a specific position partial rotation.
If I try rotating the passenger stand its self, it results in only the base rotating
https://youtu.be/P_2r7STJGzU
Im starting to suspect there might not be a clean way to do this
(Heres what it looks like when you try to rotate the vehicle)
https://youtu.be/MEkhUeMBfWE
cool
babes is there a bukkit event for the first join?
No but you can check if it's their first join. I think it's Player.hasJoined() just run PlayerJoinEvent
Ah sorry it's Player.hasPlayedBefore()
hm idk how to set up a discordsrv alert with that but i ll give it a try thanks
Could create an event.```java
@EventHandler
public void onJoin(PlayerJoinEvent e) {
if(e.getPlayer().hasPlayedBefore())
Bukkit.getPluginManager().runEvent(<your event>);
}
i dont think it supports such thing :/
its in this form
#- Trigger: PlayerFishEvent
# Channel: fish
# Conditions:
# - state.name() == 'CAUGHT_FISH'
try #player.hasPlayedBefore() == false
- Trigger: PlayerJoinEvent
Conditions:
- player.hasPlayedBefore() == false
```idk the configuration on discordsrv so adjust accordingly.
ye i ll give it a try thanks ;d
skript lookin ass
actually it is spring expression language for conditions xD
and yaml for the file
Hey there! I'd like to learn how to make plugins, would anyone let me know what all I should know? I'm quite aware of Java and I'm familiar with certain syntax's, but anything else? ๐ฌ
if you know java confidently there aint much to it
just install spigot with your preferred build tool and get started
https://www.spigotmc.org/wiki/spigot-plugin-development/ this is a good place to start for spigot-specific stuff
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@icy shadow Thank you so much!
np
Hey guys i am tryna access weapon and armor attributes and change them with my plugin logic(attack damage, attack speed etc), but i am struggling to apply the increased changes. Is there any forbidden minecraft knowledge on how to edit the attributes?(damage, attack speed, armor, toughness)?
what have you tried so far?
i am using this to get the item's modifiers:
Collection<AttributeModifier> currentModifiers = meta.getAttributeModifiers(attribute);
and this to try to increase them by 5%/level:
updateAttribute(item, Attribute.GENERIC_ATTACK_DAMAGE, newLevel * 0.1, UUID.fromString("26e0d72b-991e-4f4a-b77e-86d15acaae5a"), "Whet Attack Damage");
updateAttribute(item, Attribute.GENERIC_ATTACK_SPEED, newLevel * 0.05, UUID.fromString("bfdaecf4-4b9c-4d2f-92e0-7e9d27bc09c9"), "Whet Attack Speed");
have you set the meta again?
yeah ive set the lore(which is working) and the meta(which is not) both in my applyEnchantment and updateAttribute methods:
meta.setLore(lore);
item.setItemMeta(meta);
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โข HelpChat Paste - How To Use
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โข HelpChat Paste - How To Use
this is the whole listener class(one of variations)
https://paste.helpch.at/evoseyadit.java
the issue is that you're changing 2 metas at once
so you either have to pass in the meta in the parameter or do getItemMeta after or before updateAttribute
get meta 1
get meta 2
change meta 2 (doesn't change meta 1)
set meta 2
change meta 1
set meta 1, overriding the changes of meta 2
that's basically what you're doing
(because getItemMeta returns a copy of the ItemMeta)
Thanks! I will try to fix this right away
Hello. I'm working on building a paintball plugin with different paintball minigames and I'm wondering if anyone would be interested in testing some things out with me tonight. Send me a DM ๐ Thank you so much. Any amount of time is appreciated. And afterwards, if you're interested in the project, I'll be looking for server staff too ๐
I'm getting a location from a DB and I'm doing it using async runnables. I have to verify does server have world called x, how can I do it? I can't do it in a async runnable. Should I create a sync runnable in async runnable?
you do Bukkit.getSchedular().runTask(...
I would just store a List<String> of the world names
since running a new task can take up to 50ms (a tick)
you can call the sync task methods async
yes but it comes with a cost
runTask does the same thing as runTaskLater 1 tick
id assume caching the locations rather then always querying the db is the best option
@dusky harness Hey, i have ravamped the entirety of my code to use a smithing table. Now it's changing the stats and increasing them properly, but instead of increasing the current stats(attack damage 7 and attack speed 1.6 for diamond sword for example), it completely removes them and adds new ones(+5%damage).
I can't send screenshots here, but i hope you get the picture. Here is the new piece of code:
https://paste.helpch.at/uvakupowuq.java
As you can see in the applyEffects() method, i am indeed removing the existing attributes, but i am trying to put them back in. But i feel like this is where i messed up and i am not reapplying them or doing doing math incorrectly. Can you give me some advice on that method please?
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload or similar service to upload images/screenshots.
is there a mod that allows you to log out of a server with a click of a button, i could set a keybind and as soon as i click it, it will automatically make me log out
what
mod?
there's likely a plugin where you can attach commands to block interactions and you can just kick the player who clicked it
2 clicks, alt f4
Or just make an AHK for alt f4 lol
oh I didnt understand the question lol
Hey guys, when i am trying to edit the item's attribute modifiers, they do not change/apply for some reason. Are Attack Damage and Attack Speed(weapon) attribute modifiers in minecraft? Or do i need to use something else to access and edit them?
https://paste.helpch.at/kiyorowigo.java
Set the meta to the item after you finish modifying it
do i just use item.setItemMeta(itemMeta);?
Yes
What API?
im assuming they want to use the spigotapi but dont know how to use maven or gradle to do so, tbh they should just learn how to use one of them as it makes life so much easier and plugins arent 50mb+
Using jar dependencies with maven or gradle is different
wdym
Does anyone know a plugin that can obfuscate player IPs in console
I want to give some of my admins console access, but donโt want them seeing player IPs
Or a custom server jar that does so
jsyk IPs arent detromental
config/paper-global.yml โ logging.log-player-ip-addresses
if you dont trust your admins to see player ips then they shouldnt have console access
I donโt think thatโs necessarily true
Itโs not hard to block all commands that have ip support
Not using essentials
if you dont trust your admins to not do anything with the ip addressed of other players then hpw can you trust them to have access to your server files
I'm trying to replace a air with a crop and then make it's age max.
val randomBlock = randomLocation.block
randomBlock.type = type.block
val blockData = randomBlock.blockData
(blockData as? Ageable)?.age = 7
randomBlock.blockData = blockData
I'm doing it like that, it replaces air with block but it doesn't set it's age to 7.
If you don't know Kotlin and can't understand this I can translate it to Java
'Minecraft related' issue
The block is still air when you change the age
I use Scheduler for this ๐ฉ, idk if it's the best solution
but if I use Scheduler how will I be able to pass randomBlock? (I had issues with using local variables in runnables)
Yeah, you can, just use it there
val randomBlock = randomLocation.block
randomBlock.type = type.block
Bukkit.scheduler.runTaskLater(PLUGIN, Runnable {
val blockData = randomBlock.blockData
(blockData as? Ageable)?.age = 7
randomBlock.blockData = blockData
}, 1)
You can give console access without file access
that didn't work :/
Any error? Or it just didn't change the data?
just didn't change
Also, could you change it from null-safe call to asserted call? ๐
It is very weird, I changed it to asserted call and it still doesn't throw error nor change block
[17:49:14 INFO]: world
[17:49:14 INFO]: 624.0
[17:49:14 INFO]: 63.0
[17:49:14 INFO]: 509.0
[17:49:14 INFO]: WHEAT
[17:49:14 INFO]: false
``` as output of
```kt
println(randomBlock.location.world!!.name)
println(randomBlock.location.x)
println(randomBlock.location.y)
println(randomBlock.location.z)
println(randomBlock.type)
println(randomBlock.type == Material.AIR)
What about printing the age?
I'm doing it rn
I'm stupid
I was importing org.bukkit.entity.Ageable instead of import org.bukkit.block.data.Ageable
sorry for your time
and Intellij never said that it is impossible :/
because as far as it can infer, it isn't impossible
GDPR doesnt care what admins you have 
arent you supposed to use Block#setBlockData?
since afaik it returns a copy of the blockdata
This is Kotlin, so no
Hehe, didn't even notice ๐
Block#blockData = VALUE in Kotlin does the same as Block#setBlockData(VALUE) in Java
i see
in essence, it doesn't really matter if they can see IPs or not
ah
Player#isOnGround is deprecated in papermc. Any alternatives?
as long as you're not associating it with other personal information lol
yeah heres the issue
but for logging purposes and to provide a service (which is what the point of it being in the console is), you're all good
-> ip address with mc username and uuid
neither of those are personal information
the ip address is, isnt it?
yes, but as i showed above, you can log it easily no problem
as it's required to provide a service
and that's also just how the internet works
dunno, i know a bit about LDAP though
yeah i lately read more about novell and do you happen to know by any chance how data is stored?
like the public directories
you're going to need to elaborate more on your question
so im trying to connect via linux to my schools novell zenworks thingy but no luck, is there maybe a novell linux client or
odd question i know
you're trying to connect to a system management daemon?
probably idk
as far as i can tell, zenworks is just a thing for managing patches and stuff on devices
you'd just install it on your computer if you wanted it to be controlled by your school or whatever
or more likely you wouldn't because it's your computer lol
i just want to access the file server, i think that was somehow nextcloud in novell
so you need FTP?
is that ftp though?
hm alright
whats wrong with scp D:
According to OpenSSH developers in April 2019, SCP is outdated, inflexible and not readily fixed; they recommend the use of more modern protocols like SFTP and rsync for file transfer.[3] As of OpenSSH version 9.0, scp client therefore uses SFTP for file transfers by default instead of the legacy SCP/RCP protocol.[4]
not really, the value is entirely controlled by the client, so cheat clients can tell the server they're on ground when they aren't
for vanilla/non-cheat clients it's fine if that's a risk you're willing to take
sad
# When a command conflicts with another plugin, by default, Essentials will try to force the OTHER plugin to take priority.
# Commands in this list, will tell Essentials to 'not give up' the command to other plugins.
# In this state, which plugin 'wins' appears to be almost random.
#
# If you have two plugin with the same command and you wish to force Essentials to take over, you need an alias.
# To force essentials to take 'god' alias 'god' to 'egod'.
# See https://bukkit.fandom.com/wiki/Commands.yml#aliases for more information.
overridden-commands:
# - god
# - info
This is from Essentials config, how can essentials do that? Is there any way to do that in spigot API?
Hey guys, did anyone here work with MMOItems before? I need methods to access their items so i can edit their stats in my plugin. Do you know where i can get those?
Would you say ~ is a good symbol for a "Equals ignoring case"?
Currently use = which does a equals check and I want to keep that while offering a variant that ignores case...
~=
or = for ignore case and == for equals, like JS' === strict equal (whatever is called)
+1 for ~=
Would like to keep it at 2 characters... Also want to allow a negated option like !~ for not equals ignoring case... Currently already have != for not equals
its called straight equals iirc
Lame equals
The strict equality (===) operator checks whether its two operands are equal, returning a Boolean result. Unlike the equality operator, the strict equality operator always considers operands of different types to be different.
Might be gay
== is.
That's the most straight equal sign this side of the Mason Dixon
assert("1" == 1)
```how is this straight
One person recommended โ but I feel like that not everyone would know how to get it...
Yeah fuck that
yeah stick to characters that are on keyboards
lmao
What I could do is this:
~= for equals while ignoring case
== for equals while including case
!= for not equals... while ignoring case?
Like idk what to use for not equals with(out) case
why does it matter how long it is?
^
It would require me to completely rewrite my expression parser again
2 characters, 3 characters, same shit
My current Expression class: https://paste.helpch.at/igocexureg.java
yeah then go with what fits your code structure
Or fancy a rewrite ๐ฅน
a whole operator for a fairly niche string operation is a little odd
but yeah i guess ~ is fine
or do โ if you wanna be cool
i think hes saying an operator just for a single string operation is prob too specific to be an operator
A user just asked to make the = check case-insensitive
But I feel like there are people who want this case-sensitivity in their checks
Tho, I could also just make the current equals check case-insensitive and if people complain add this change...
no thats worse
that doesnt seem like a good idea
i cant name a single example of where "fuzzy equals as default" has been seen as a good idea in a language
== in java, js, php. all borderline useless and confusing to beginners
does anybody here knows how to work with vault and make a fine GUI shop and server economy that would be synced with towny aswell?
have a look at https://github.com/MilkBowl/VaultAPI
what is this?
its the vault api github? it has information on its main page how to interact with vault
Btw this is coding help
tho it seems only for getting already registered services, tho id assume its not too difficult to figure out how to register your own
does papi support 1.8 (not 1.8.8, just 1.8)? ping if reply
i asked in #general-plugins too (no reply) but its technically related to development so imma just ask here >:)
no
is 1.8.8 the only 1.8 version?
yes
1.8 is missing gson or some parts of it that are used by papi
alr
i could use 1.8 if i reflected placeholderapi ๐
wait no
then papi just wouldnt be available for 1.8.7 and lower
which is useless
why do you care about 1.8?
i just wanna see how low i can go lmao
ok..
you are indeed going low
im at 1.11 rn, gonna reflect some actionbar/title stuff to get to 1.8.8
i made a pretty cool item stack data manager using reflection (https://github.com/srnyx/annoying-api/blob/main/api/src/main/java/xyz/srnyx/annoyingapi/utility/ItemDataUtility.java)
use adventure
๐คข
ah that makes sense
wait what would adventure do
ยฏ_(ใ)_/ยฏ
thought it was just formatting stuff
oh wait yeah that makes sense
maybe i should start using adventure, idk
ik its better but last time i tried i got confused and gave up, we'll see...
BukkitAdventure#sender(CommandSender).sendMessage(Component)
does this look right?
Class.forName("org.bukkit.attribute.AttributeModifier$Operation")
mainly the $Operation part
probably, yeah
it has actionbar api
u have no say in this LLLLL

Could somebody help me with deluxemenu? I want to do a shop which has an item currency (for example emerald, which name is Coin) and I want to run a command and also take the item when buying the item
Anyone can help with my issue?:
My main minecraft world that's used in every plugin is named "world" also in server.properties level-name is "world". Me and my team build map on worldpainter created "world_build" with infinite ocean. Whenever i'm trying to remove "world" that's blank and rename "world_build" into "world" the infinite ocean regenerates into normal minecraft world like in survival. How to fix it?
If i change level-name into "world_build" the infinite ocean chunks still regenerates and i cannot use /mvrename world_build world because it says it cannot be done
When you change the level-name to world_build, do all the chunks regenerate, or just the new ones are vanilla?
uhhh
it doesn't matter what the level name is but existing chunks won't be modified
Sounds like the issue is that multiverse doesnโt know the new name and isnt continuing the chunk generation with the proper generator
well afaik the worlds called whatever the level-name is are handled by the server, not by multiverse which means any custom generation is lost
the only way to do custom generation is by setting the generator in the bukkit.yml
Probably best to just let the default world exist then
And handle player teleportation to the correct world through a plugin or something
Thats what I do
oh I thought you were asking the question
lol
I didn't see the message above
whoops
addAttributeModifier(). How.
Cannot resolve method 'addAttributeModifier' in 'ItemMeta', but my import is fine, i'm pretty sure?
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.attribute.AttributeModifier;```
Are you using IntelliJ
If you are, try File -> Invalidate Caches
Thatโs assuming that itโs an import issue and the method actually exists
What is unrellij lol
Oops typo (s)
i tried that, it didn't fix it, but i did just find the issue
the api wasn't being imported as a module, just a library
god knows how the rest of my imports didn't complain
Ah
try getAttributeModifiers();
your running this on a 1.19.4 server right?
hi i try to register enchantment on 1.8.8 but it scream at me, anyone got a tutorial on how to do it correctly?
trying to use enchantments to hold data for items
this is what i have rn: https://paste.srnyx.xyz/icofatafuj.java
error: https://paste.srnyx.xyz/umeyujadin.yml
I am no expert when it comes to enchantments but I'd argue that this error is likely a result of you registering the enchantment twice
java.lang.IllegalStateException: Enchantments have already been built!
How did I miss that ๐ญ
it happens
That's a Compton classic
Hello, when I try to change a player's nametag, there is a NullPointerException, here is the code:
NametagEdit.getApi().setNametag(player, prefix, suffix);
simple, and here is the error:
๐
Caused by: java.lang.ClassNotFoundException: com.nametagedit.plugin.NametagEdit
Depending on how you wanted to use the API, it's not available at runtime
what ?
The API must be either bundled or as another plugin
<dependency>
<groupId>com.nametagedit</groupId>
<artifactId>nametagedit</artifactId>
<version>4.4.16</version>
</dependency>
Send build.gradle or pom.xml ||๐คฎ||
๐
okay, now it's working, thanks bro
np
tuns out this wasnt the issue btw
try {
acceptingNewField.setAccessible(true);
acceptingNewField.set(null, true);
acceptingNewField.setAccessible(false);
} catch (final IllegalAccessException e) {
sendError("set");
e.printStackTrace();
return this;
}
Enchantment.registerEnchantment(enchantment);
Enchantment.stopAcceptingRegistrations();
item.addUnsafeEnchantment(enchantment, 1);
```error at `Enchantment.stopAcceptingRegistrations();` because bukkit already built all of the enchantments, so im not sure how i can register my own
figured it out, Enchantment#stopAcceptingRegistrations() has a check when building enchantments for EnchantCommand, so im just setting the acceptingNewField back to false after i register my enchantment instead of using Enchantment#stopAcceptingRegistrations()
help me [21:28:03 WARN]: [PlaceholderAPI] Plugin PlaceholderAPI v2.11.3 generated an exception whilst handling plugin message
look I'll pass you a catch
I send it to you by md?
ok
but he'll pass u a catch!!
can any people help me on a problem?
?help
ยป Give the helpers some details
ยป Ask suitable questions
ยป Be polite
ยป Wait
can u help me right now idiot?
im having trouble with using enchantments to store data cause of conflicting enchantment ids/names
if 2 items use the same data key name, then it break, cause the enchantment is registered twice :(
hurry up dkim omg so slow i hate waiting!!11111!!1!1!!!
what is data key name
i want data to be stored like a Map<String, String>, so the enchantment key (int) is the hashcode of the key string, and the name of the enchantment is the value string
it was made private