#help-development
1 messages · Page 1187 of 1
yeah but it looks scrumptious for making guis
How bad of an idea is it to do dumb stuff like this.
Creating public static final variables inside of an interface.
The reason is "it's faster to type".
-# pls tag, me go to sleep soon
I mean, for a Class field it'd be pretty dumb lol
but it isn't particularly wrong to have a public constant, people just tend to avoid doing that in the java world
mainly because it makes the code inextensible, but there are use cases where it is valid
hey anyone think they could help me with a issue im having?
ask away
In #help-server they don’t bother to ask
The people who can use the command are configable
are you able to make different classes for sum commands?
so like if theres /party join /party invite /party disband soo I could make different classes for join, invite and disband
please just use a command framework
xD true
which one?
maybe cloud
yes
I prefer command-api rn
yea I might look into that cloud seems very confusing
I cant understand anything
good part of capi is its VERY well documented
alot of examples too
Acf still ftw
wuts acf?
annotation? eh
this is sort of what I was doing with CAPI
public class PartyInviteCommand extends CommandAPICommand {
public PartyInviteCommand() {
super("invite");
withPermission("mungeons.party.invite");
withArguments(new PlayerArgument("invitee"));
// Console sender
executesConsole((sender, args) -> {
sender.sendMessage("player only command");
});
// Player sender
executesPlayer((sender, args) -> {
PartyManager manager = Mungeons.getPartyManager();
Player player = sender;
String playerArg = (String) args.get("invitee");
// Invalid arguments
if (playerArg == null || playerArg.isEmpty()) {
player.sendMessage("invalid args");
}
assert playerArg != null; // We performed the null check above.
Player invitee = player.getServer().getPlayer(playerArg);
// Not a valid / offline player
if (invitee == null) {
player.sendMessage("not a valid player");
}
if (!manager.isInParty(player)) {
// Player is not in a party...Creating one
Party party = manager.createParty(player);
InvitationRequest request = InvitationRequest.from(player, invitee, party);
} else {
// Getting the instance of party
Party party = manager.getPartyByLeader(player);
if (party == null) {
// Player is not the leader
player.sendMessage("Not the leader of current party.");
}
// Player is the leader
InvitationRequest request = InvitationRequest.from(player, invitee, party);
}
});
}
}```
I will take a look at ACF rq
Can do that in like 10 lines in acf
Some people just dont like annotations which is fair enough
I love them
which is why I was looking at ACF rn
It majorly reduces boilerplate which is why I like it
Like you dont have to do those checks if player exists etc, it will do it for you
You can also have custom resolvers for other classes
O: it has a thing for sub command
Yeah you can do super nested sub commands with ease
All auto resolves for you with command completions
But again, take with a grain of salt. Everyone has their opinions on command frameworks
I really love annotations based frame work
but I will change it l8r
at the end of the day i want clean code
oh I forgot....
ty for mentioning
b4 i was using normal bukkit one soo I had returns but then I copy pasted it
🤷♂️
if i want to get the name of an item is Material#name() sufficient if the item's meta has no display name?
i'd like to make a placeholder retrieving the item name exactly how the player sees it, i'd prefer if could be translated too but i reckon the best way to do that is for the server admin to change their servers language
is there any api that allows getting a translated item name
There is Material#getTranslationKey()
So the best way to go about this would be to create a text component with that translatable and drop that into the placeholder, but I don't know placeholder enough to know if it supports this.
The other way I think is to just hold all the translation files yourself and look up the name there
You can use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#getLocale() to know which language the player has set.
can u use EntityDamageByEntityEvent to detect damages? by player to a mob
Yes, check if the damager is a player
alr thanks
the issue is I have to use this placeholder in an item's display name or lore
and that doesnt work with components on spigot
it seems that the only solution is to either store the translation files in the plugin itself, which is not practical, or to use some api
but i dont know of an api that is good for translating items like this
automatic translators like google translate often make mistakes because the text is very out of context
NMS is an option
it should work just fine
im fine with using nms, what should i look for?
usually you don't do automatic translation but rather provide a resource pack with the languages your server support
You’ll need to use reflection to access the displayName field in CraftItemMeta
wait, why would you need to do that
doesn't itemName get you the default item name if they haven't changed it
Don’t think so?
getDisplayName() returns null if no specific display name is set
actually i think it might even throw an exception considering hasDisplayName() exists
and using a resource pack for the plugin im making is very unpractical, its a big measure for whats essentially 1 tiny feature
I mean, if the server is providing translations then usually they'd have one anyway but well, server-side translations are an option too
getItemName is @notnull
thats what im looking for but i also know that changing server translations isnt the easiest thing for most people
But it says to check hasItemName first
I mean, surely you could split the resulting string from placeholder, put it in a component and throw in the translatable item name, no ?
(or does spigot still not have support for components in item name/lore)
i know paper supports it with their adventure shenanigans
last time i heard spigot doesnt support it yet
Spigot has a PR open for it but yeah, it isn't merged yet
Who do we yell at again ? :D
obama
whenever it is, you'll be able to do someMeta.components().setDisplayName(bungeeComponents)
no, that isn't available yet as the PR hasn't been merged
if you want to do it now, I'd assume you'd have to do it to the handle directly
Yup
And you need reflection shenanigans because CraftItemMeta is private
Well, package private
wait, is it?
Yes
you can just use CraftItemStack#asNMSCopy and edit the ItemStack handle directly rather
I forget that meta is a bukkit concept lol
good thing because im reading the item directly from a packet
so i can just do that
True
I just use CraftMetaItem because I already have an instance and I don’t want to waste time making a copy, editing it, and then mirroring it back to a CraftItemStack
I mean, applying that meta is already a process so both approaches aren't particularly pretty anyway
I don't get what the heck the item name is supposed to be
how does it differ from custom name besides the fact that it can't have styles
No idea
You can just add a permission to your command
Do so in your plugin.yml
I which version the PDC came? in the 1.14?
yes
okey thanks
If you're talking about the two vanilla componnets:
item_name exists for items like Banners, the illager banner has different name, or burried treasure maps. They used to be itallic which is incredibly inconsistent. Now they just use that component instead. It is also used by every item, it only references the translation.
custom_name is the name given in anvil, and it is itallic by default.
wdym it was inconsistent with itallic
all other game items dont have italic names
It was basically presented as a "special" item, even tho the base was normal banner.
It having italic name just looked off.
ye thats better answer
but yeah its for names that arent from anvils or from the translated material names
so basically only really useful to data pack people
Wdym, it's literally used in vanilla
And if you make custom item, I would always recommend you use that component instead of custom name
why would I use that component if it can't have colors
in any case one would use a combination of the two I guess
Can you not ?
Then I guess they inherit the color from Rarity.
it also doesn't look like the server respects this lol, I am gonna have to check
you can actually, my mind jumbled things together when skimming some wikis lol
Why use it over display name though
Display name at least is more backwards compatible :p
who cares about backwards compatibility at this point
it is permanent to the item I guess? One would usually use PDC to do that
item_name is also not shown in item frames, so that's pog :)
True
so it essentially acts as if the item doesn't have a custom name
I wonder
I am not sure I can make much use off that tbh, I'd rather just use display name
If you rename the item, then remove the custom display name (empty name in anvil) does it go back to the custom item_name
yes
that's useful
the item_name becomes the item name
Item name is no longer hard coded, that is just how it is defined, with that component
So it’s kinda like actually adding a new item with its own name
because it doesn't exist anymore
we mean custom name component by display name
Yeah
I'll never call it custom name tbh, I'm too bukkit coded
nowadays there are only few hard-coded things for items
custom behaviours like bow, trident, fishing rod. But this will change soon too.
Tools, item name, item model are all components and can be put on any item
I do like that you can make custom items that support renaming though
Now give us block components Mojang <3
Yep, it's awesome
Soon we will not need this tho, custom items are on the horizon (probably)
does it inherit the rarity color if you don't use any colors in item name? I wonder
I do believe so
Someone can send me the link to the lib for blocks pdc. I can't find it. I think it was made by mfnalex
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
yep
that's nice
thanks
yeah this isnt as simple as i'd hoped lol
wtf is a codec
and how does it translate to a name
You do not need to touch Codecs at all
But to answer your question:
Codec is how the game serializes objects from/to json/nbt
It can also validate inputs and it throws errors on incomplete input
It is part of the DataFixerUpper library.
In the past I made NMS way to put raw json into lore
Should be easy to make this into item name instead
https://github.com/steve6472/StevesFunnyLibrary/blob/7ac1e99a51a05f577b40c570c226f74c7c9e16b8/src/main/java/steve6472/funnylib/util/NMS.java#L132
sick, thank you
Oh I don't think this was ever updated to components
The NBT access will be incorrect
@hushed spindle
darn
I don't recall how to get the data components from NMS stack
But if you go through some vanilla item code, you should be able to figure that out yourself
getting them is fine but setting them is weird
You gotta replace. You can't modify the component object itself.
I remember that part.
yeah you do ItemStack#set it seems
you give it the type you want or in this case DISPLAY_NAME
and you set a value to it
but the value is weird
i originally thought it wanted a codec but clearly thats wrong
Isn't it just a record with TextComponent ?
Man, if only I had private MC decompiled repo
yeah it does
it expects a type of Component
but how to convert a display name to text components and then pass it onto it i dont know
(I found decompiled, deobfuscated MC code on github, public repo)
You can pass Component.translatable("item.minecraft.lodestone_compass")
You get the translatable string from Material#getItemTranslationKey()
getItemTranslationKey
and how would i prefix and suffix something alongside it
You can use GitCraft to make your own
because i dont want the item to be just called the item
I'm aware, I just never published it to github
A component can contain other components
So you'd have 3 components, one for the prefix and as a container for the other two
then add the translatable and suffix to that
and you can just add regular strings to it with Component.literal i think
yes
That will make a text component
If you want to make things easily configurable I recommend you use the Adventure API 
(with MiniMessage)
i couldnt find how to do it there either lol
If MiniMessage allows you to serialize the text to JSON, you could use the Text component codec to decode it into a Component object.
Probably
But that may be overkill
how would i combine these 3 components by the way
seems like MutableComponent has create method ?
sorry if i ask too much im having a hard time wrapping my head around it
it does and it expects a ComponentContents argument
ok not that sorry
Here's how you'd do it with Adventure
final TextComponent textComponent = Component.text("Prefix ")
.append(
Component.translatable(Material#getItemTranslationKey())
)
.append(Component.text(" Suffix")
.build();
and to set it as an items display name?
Try Component.create(literal).append(translatable).append(literal) ?
I mean I didn't notice it either :D
where do you guys see all of this btw because i'd hate having to ask these types of things a lot
yeah but where specifically because ive looked through adventure docs and didnt find anything lol
Adventure doesn't have a direct adapter to nms components as far as I can see. So you'll need to gson it and then parse that using nms
alright, ill probably end up using that
though this components system is rather new, how to set json to an itemstack lol
1.21.3
Let me start my dev env 1 sec
i appreciate this a lot by the way im not saying this enough
I found
ParserUtils.parseJson(this.registries, stringReader, ComponentSerialization.CODEC)
That's paper internals though iirc
converting components to json is no issue, its putting it on an item that is
This is vanilla MC source code :)
Dude I thought that said PaperUtils
I'm losing it
Maybe I should put my glasses on lol
It literally does normal codec decode.
ComponentSerialization.CODEC.parse(JsonOps.INSTANCE, jsonElement).getOrThrow()
Is what you should be using to turn Json to Vanilla Component that you can put on the itemstack
(I should be doing my actual job instead of this lmao)
The parseJson only wraps the JsonOp with some context, like nbt, entity scores.
It basically does what I sent.
-# I think
Fuck magic annotations (spring is the only place where it's acceptable)
Since when are text components codecified damn
I thought the codec was private?
https://paste.md-5.net/veyazelimu.bash cloud >>>
Codecs are almost always public static final
And since few versions back
Also, Codec is part of the DFU Library
I'm aware of that
Just that they're sometimes private because fuck you
Text.Serialization.toJsonString(text, MinecraftClient.getInstance().networkHandler!!.registryManager)
``` is what I do
It makes sense to make private codecs for parts of the codec, but like the resulting codec should be public.
last time I checked the text serialization one was private
though it has toJsonString and fromJsonString methods
text components use codecs ever since network serialization of text components uses nbt for them, although they are still stored as json, so there is just one codec and they can serialize to both formats
in internet exists lib for getting info obaut player by circumventing his online presence?
i want the cooldown of the diarrhea to be changeable using the /pa gui and i want to make it so if you disable one (for example: diarrhea) and you use /poop it doesn't spam the fucking message 'This command is disabled by the admins!' also its the otherway around for poop aswell also since i gave the code to AI in a desprate way of helping me idk what it did and even if it kept all the functions the same or not im just lost pls someone help me.
The code:
https://paste.md-5.net/xuxifukuce.java
please if someone can help me do so im really lost and can't even think of anything to do i don't even know what the code does anymore
What the fuck did I just read
jesus fucking christ
I have sneak on control, and run on shift
Does that mean I will "poop myself" whenever I run ? :D
no it detects when u crouch
Well your message says "shifting" so L
I... I don't think you'll be getting help for a while just be patient. Maybe you'll get lucky
i don't need yall to write the code or anything just need to know what to do
This code will spam players with "This command has been disabled by the admins!" whenever they toggle sneak
Which I don't assume is wanted.
You have the same thing on the second one
Best would be to just.. not do anything I think
Yeah you should just early return if poopEnabled is false
Or you could send the message you can't poop right now!
yeh honestly don't even care about that part i just need to know how to fix the diarrhea cooldown
Please read this to learn how to do GUI, checking name is bad
Another thing: storing Player in a Map is bad too, store UUID only.
Half of your code does that
This is useless, just put
Can you please walk me through how the thing you don't want happens ?
?cooldowns
well first off there is this gui i made which was meant for admins to edit certain functions like disabling diarrhea and pooping and stuff like that but when you shift click on the brown concrete which is for editing the cooldown of diarrhea it just ends up staying in ur inventory before getting cleared after the gui reopens now another thing is that diarrhea cooldown won't change and i will get rid of the message aswell
for the GUI, again, please read the link the bot sent
second, check for the click type, cancel the event and early return if it's anything but left click (pickup_all) or something.
It's only bad if you cause it to leak
It's a bad practice in general and only really works because spigot reuses the Player entity across dimensions, if such behavior was ever reverted, which could be required eventually your fun little entity falls apart
UUID is far better and you can still leak memory with a UUID too it's just less memory
hello, how to use UseCooldownComponent properly, like how to set cooldown for certain item by method for ItemMeta setUseCooldown(UseCooldownComponent cooldown), I dont really know how to create this useCooldownComponent
you can get it from getUseCooldown
similar to how the itemmeta system works
oh thanks
hashCode and equals just wrap the UUID. Equals also checks the entity id, although respawning the player with even a new entity id is nonsensical and would break tons of API. The GUI not working would be ones least fear
how can i prevent cheats?
I would say only invite those you trust, but even then you can't prevent cheats
You don't
Just look at big servers, they can't do that either
xd what 😭
how can i reduce cheating on my server?
Are you planning to create your own cheat detection plugin?
If not, you may receive plugin suggestions at #help-server
please no 
example custom client
or anticheats
but i need learn other ways
custom client won't get you anywhere
so am i need develope anticheat?
please don't make one yourself, that'll probably end up badly
i thought about it
just use one of the already existing ones
what do u prefer btw?
I don't use one, I don't really know many
aight ty
anyone understand gradle things in IntelliJ IDE im tryna change the source code verison for the plguin so i can use it but idk how + when its in IntelliJ IDE i just get like 120 errors anyone know how to not have this happen and change it
i think its 1.17 rn but change it to 1.21.1
your own plugin?
bro my brain is dying leave me be
no
well how did you expect to update it across 4 versions without any errors
if its just the api there shouldnt™️ be that many
you update the api version and the gradle repos to the ones you want
and then fix the errors in the code
probably mostly like renamed constants or whatever
https://gyazo.com/515cc317c918da88cc40af2bebc2bc4d this is just in the API thing they have
what? leave me be?
those are all iridium skyblock errors
yes pls
that means leave him alone
lool
and im stupid and dont know almost anything ngl so i dont think i can fix this or sort it lol
dont disturb
yes pls download at
https://www.spigotmc.org/resources/poop-plugin.120984/
since i worked my ass off for this plugin
:(
xD
its funny though
where is code>>?
i guess you did work your ass off if its about diarrhea
wdyn where is code
sure 1sec let me get it
okay
?paste
yes
wdym
why are you sending decompiled code
then how would i send it?
the source code???
THAT IS THE SOURCE CODE ITS THE UNCOMPILED SOURCE CODE BRO
you wrote that?
with the help of chatgpt yes
jfc go learn java
@hushed spindle I didn't follow the conversation, did you figure it out
i know java i just get help from chatgpt whenever im stuck
Top Poopers
fucking
from what I looked it was just setting the data component on the item stack
what is Poop.BlockSnapshot
xD leaderboard bro
i doubt chatgpt uses decompiled variable names
reverting blocks after diarrhea
i got it to work with components but not with minimessage yet
try {
FileWriter writer = new FileWriter(dataFile);
try {
Map<String, Integer> dataToSave = new HashMap();
Iterator var4 = this.poopCounts.entrySet().iterator();
while(true) {
if (!var4.hasNext()) {
(new Gson()).toJson(dataToSave, writer);
break;
}
Entry<UUID, Integer> entry = (Entry)var4.next();
dataToSave.put(((UUID)entry.getKey()).toString(), (Integer)entry.getValue());
}
} catch (Throwable var7) {
try {
writer.close();
} catch (Throwable var6) {
var7.addSuppressed(var6);
}
throw var7;
}
writer.close();
} catch (IOException var8) {
this.getLogger().severe("Failed to save poop data: " + var8.getMessage());
}
like that cannot be your code
if it is
but htere is no class Poop or like anything called Poop
?learnjava!
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
gonna mess with that later i fucked up my code as to where players cant even join lol
dude i just opened intellij idea went to my code and copy and pasted it wdym
no you didn't
the class is called Poop
oh im dumb
gonna post a lil resource on spigot showing it off because i imagine translating things with components can be very useful for people
invalid format most likely
and blocksnapshot?
??? am i getting something wrong that ur saying
and because its async with packets im not getting a full exception log
scroll down
ah right you were also doing something with packets
You did not send your code, not the original source code.
This is decompiled. Just look at variable names and formatting.
I believe that is what part of this convo was
oh dude i don't have the source code for the original one i don't save them i rewrite them every time i want to update (i know its dumb and i should make a github or something)
are you just editing your decompiled source code all the time 
recaf is my favourite ide
no not the decomplied one
i just rewrite whatever was the original one
?paste
?paste
what is even the issue here
hmm weird i can't save it
i don't even know at this point
how to use UseCooldownComponent properly to set cooldown for certain item, when I getting it form getUseCooldown() it always shows 1 sec cooldown
yay it finally saved
https://paste.md-5.net/okowobumoj.java
this is the current code im working with i just rewrite this everytime i want to update the code
get it, change it and set it back again
why do you need the exact same link twice
idfk i've been working so much on my shit that my last 2 brain cells are fighting for 3rd place
yes but there is no cooldown animation like when throw enderpearl and also when I set this cooldown to some value it is static, shouldnt it work like it time of cooldown is decreasing
That trait sets the cooldown that will be set on use
It doesn't trigger the cooldown
so how to trigger
declaration: package: org.bukkit.entity, interface: HumanEntity
setCooldown for HumanEntity works like setting cooldown for all material even when I use setCooldown(ItemStack)
What version are you on
1.21.3
Is the client also on 1.21.3
That's why
oh okey thanks
is there any posibility of doing that for clients form older versions?
no, since the feature didn't exist until 1.21.3
no
"on my shit" quite literally I guess
I wonder who is the market for this plugin
I'm pretty sure 8-10 year old boys aren't supposed to have spigot accounts
hi, would anyone be able to help me? im extremly new to plugin development and im trying to figure out how to export my code into a .jar instead of making a java thingy. the tutorial i watched was only for if you have a server on your computer and then you can use that to test it but my test server is a pebble host server
can anyone help with that or does that not make sense
are you using maven?
yes
then just run the package task
Ctrl + Ctrl in IntelliJ then write mvn package on the popup
sorry, but how do i do that?
^ this works
i think that worked but idk where the code went, how do i change the output location
it should be somewhere in the target folder, I don't remember how maven does it lol
it is on target indeed
i found it, thank you guys so much for the help
and sorry for being an absolute noob lmao
wait will the jar file automatically update when i change the code?
or is there something else i have to do to save
im not used to intellij
you can make it so it compiles every time you save but you probably don't want that
just recompile every time you're done with your thing
hey, can you create a world, delete it and recreate a world with the same name as the one create before, but change the seed?
if you want to be able to see your changes live, you'd have to setup hotswapping though I don't know how that works out on shared hosts since they don't let you choose the jvm distribution lol
is recompiling just doing the ctrl thing and typing "mvn package"?
yeah, though now that you've done it once, there should be a button on the top right corner
yes, however I wouldn't recommend doing that
or if you do that, have a set of seeds already pregened at least
umm okay
its not there weirdly
nevermind, it seems like it only creates a run configuration for gradle tasks, I never noticed till now
you can recompile by doing Ctrl + Ctrl and then writing mvn package like before, or you can also do it inside this menu if you're more comfortable with that
okay thanks
question
if you have a list and want to sort it, but most of the elements in the list aren't affected by the sort comparing function, will they remain in the same order?
"most" ?
like if i have a class A with properties x and y, both numbers
if all elements of A have different values of x, but most of them have the same values of y, will sorting them based on y mess up the order of A's with different x's
i want elements with a different y property to be shifted to the end of the list without disrupting the order of the list for the other elements
Sounds like you’d just do two sorting functions, one for the Y aspect followed by your general sorting function
the values of x are not in order though so i cant sort based on them
oh ill just test it, sec
SortedList with a comparator
regular sorting seems to work just fine
what you wanted is called stable sorting btw
oh cool
nice one
will doing the ctrl ctrl thing and mvn package update my plugin.yml aswell?
hmm okay
im trying to add a command and its not working
like its not even popping up in chat for auto finish the command
@blazing ocean can you help, this is my code but the command isnt even showing up
name: TestPlugin
version: '1.0-SNAPSHOT'
main: me.makwil.testPlugin.TestPlugin
api-version: '1.21'
commands:
resetdamage:
description: Resets your attack damage to the base value.
usage: /<command>
show your code
package me.makwil.testPlugin;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
public class DamageCommand implements org.bukkit.command.CommandExecutor {
private final TestPlugin plugin;
public DamageCommand(TestPlugin plugin) {
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (command.getName().equalsIgnoreCase("resetdamage")) {
if (sender instanceof Player) {
Player player = (Player) sender;
AttributeInstance attackDamageAttribute = player.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE);
if (attackDamageAttribute != null) {
attackDamageAttribute.setBaseValue(1.0);
plugin.getConfig().set("players." + player.getUniqueId() + ".attack-damage", 1.0);
plugin.saveConfig();
player.sendMessage("Your attack damage has been reset to the base value.");
} else {
player.sendMessage("Failed to find your attack damage attribute.");
}
} else {
sender.sendMessage("This command can only be run by a player.");
}
return true;
}
return false;
}
}
ive been getting help from a friend so this is mostly his
holdup lemme get the other code
?paste
i think i am with the main code
but i dont really know cause my friend is doing most
are you sure your server is using the latest compiled version of your plugin
yes, the server is using 1.21.1
also i get this error:
[18:50:00 INFO]: [TestPlugin] Enabling TestPlugin v1.0
[18:50:00 WARN]: [TestPlugin] Could not find the resetdamage command.
[18:50:00 INFO]: [TestPlugin] TestPlugin has been enabled.
in console on my server
is your file by chance called paper-plugin.yml
Its possible to set a slot on an inventory that works as a furnance fuel slot?
when we get spigot 1.22 ?
once mc 1.22 releases
huh no?
is there any fixes or am i cooked
how can i get that
thats the full folder if thats what you were refering to
i love §x§f§f§0§0§0§0M§x§f§f§6§6§0§0y§x§f§f§c§c§0§0t§x§c§b§f§f§0§0h§x§6§5§f§f§0§0i§x§0§0§f§f§0§0c§x§0§0§f§f§6§6 §x§0§0§f§f§c§bE§x§0§0§c§b§f§fn§x§0§0§6§5§f§fa§x§0§0§0§0§f§fb§x§6§6§0§0§f§fl§x§c§c§0§0§f§fe§x§f§f§0§0§c§cd§x§f§f§0§0§6§6!
i have no idea what that is im pretty sure its to do with mythic mobs
are you absolutely sure there is no file named paper-plugin.yml in your resources? you might want to try a clean build (mvn clean package)
idk how to check
and what does that do?
does cleaning the package reset my code or anything
wait im stupid
yes
i have paper-plugin.yml
and it is setup
rename it to plugin.yml
shouldnt that be done by default
?
like if thats something i need to do shouldnt it have just been done
did you select a paper plugin when you created the project
yes
welp those don't allow commands in their yml
i just changed it to plugin.yml and its not working
your issue is checking if the command exists if its not null or whatever
that method you are using returns null if that command doesn't exist
therefore your registering of the command never happens
declaration: package: org.bukkit.command, interface: CommandMap
relevant api section of the method you are using that states it returns null if it can't find a command
does anybody know why I could be getting a permission denied here? I can run that script just fine. ls -l says .rwxrwxrwx@ radstevee
it's just a regular GH actions runner
wait so then how do i fix it
frosty any ideas
github prs down for anyone else? i cant create one, i just get an oops 500
my friend helped me with the code so idk what to get rid of to do that
still
what did you +x to
because it is failing to execute runsvc.sh
also, it does say it failed to locate the executable, are you sure it is there
did you end up fixing it, feel like people sent you all sort of things lol
it is
can you send the sh file
is it a restricted file system?
I hate almalinux ffs
no idea tbh I didn't set up this dedi
its a permission issue with SELinux, I can't be arsed to go over how to fix it. Personally I keep SELinux disabled permanently
as I have never found it useful
caused me more issues then anything else
ideally you'd adjust the SEL context with chcon instead but eh, disabling it isn't going to be the end of the world probably
you can help them if you want lol 🙂
but yeah its not going to be detrimental to anything, not like they have a bunch of users accessing the box
or they are just randomly running unknown stuff
#IReallyKnowWhatImDoingISwear
you can do sudo ausearch -m avc -ts recent to check if it was indeed a SELinux issue
I am NOT using nix for a production server 😭🙏
that is literally the best place to use nix
nix would have the exact same issues
not really
it would, because rad wouldn't be the one setting it up lol
what
rad mentioned earlier that he wasn't the one who configured that dedi
well, you are aware of how nix works right
so it means whoever did enforced selinux polices in the filesystem, and they'd have done the same had they done it in nix or not
that everything is in a configuration file, listing exactly how the system is configured right
it's just default almalinux 9
it means he could have at least figured out what they did
they wouldn't, since they wouldn't know it was a selinux issue to begin with
nix isn't some magic tool, it is just really a fancy dockerfile
they would, because in the nix config they would explicitly turn SELinux on
real and based
again, no
it is not just a fancy dockerfile
I mean it is, but not quite! 😂
yeah but you don't go looking onto the system configuration when you find an issue running a script lol
you do, specifically because it is a fs issue
you can go to journalctl ig and see the issue
if it's a file in say /etc/ you know it's a config issue
it isn't a config issue
ike you are not convincing me to ever use nixos again btw
SELinux (Security Enhanced Linux) is a security program that restricts access to system calls and resources at the kernel level. When you have a system that is setup with SELinux you are supposed to setup permissions in a certain way as well as use alternative commands/arguments to run otherwise it fails
the problem with the failing is that it doesn't really tell you its a SELinux issue and why lol
hi frosty :3 where's my lego
idk, I didn't know I was getting lego's
you said you were gonna add it to the list
oh right, well its not christmas yet either
couple weeks away
wdym it isn't christmas yet, I've already set up my christmas tree
already bought a bunch of xmas gifts
I don't have a tree, waiting till I get a house to do such things
get a potted plant and put dolla bills under it
but I am not buying a new one
oh thought it was real
well I guess if you have one of them older ones they are sometimes nice too better then newer ones
I hate them newer fake trees
Its possible to save data from different types under the same namespacedkey? With PDC
yes and no
(╯°□°)╯︵ ┻━┻
sounds like you're doing something wrong
you could use the container PDT and save your data inside there
PDT?
PersistentDataType
var PDC = item.getPersistentDataContainer();
var container = PDC.getAdapterContext().newContainer();
container.set(SOME_INT_KEY, PersistentDataType.INTEGER, 10);
PDC.set(SOME_KEY, PersistentDataType.TAG_CONTAINER, container);
that's how you'd do it
var
it is either that or creating a custom PDT for your class
var a = 1
I like var, I use it a lot so maybe people find compelled to use it more lol
i dont like var 😾
I'm using kotlin
Val >>>>>>
Var var = new Var(new var)
Replace var with val and ur there
but what tag container is like an array of values? or how it works
Enjoy your Map<String, Map<String, Map<String, Map<String, Object>>>> my friend
It's a map
yessss i love that
it is just another PDC
a pdc inside a pdc
yeah, basically
same way enchantments do Enchants:[{id:"minecraft:dumb",level:69420},...] though this one would be a tag container array
what if you put a list inside the list
then list[0] == list[0][0] == list[0][0][0] ...
?
that sounds cursed as hell
yes
but it could be done as well
i tried that in python in school and i printed it and it was [[...]] or so
Hey guys, how to set aliases for a command in code (With PluginCommand object)
.setAliases() doesnt work, only plugin.yml :(
what is that
js ahh
js ahh??
array
Array is primitive
array is monkey
this is weird, I made it print its aliases every time its executed, and they're here, but don't work???
https://i.imgur.com/uaDFwzB.png
https://i.imgur.com/rzy5Tlw.png
If you don't know about memory arrays can be confusing but that's as low as you can go data structure wise
In Java they're kinda objects you can do List<String[]>
kinda
I resolved it by using reflection
CommandMap commandMap = plugin.getServer().getCommandMap();
PluginCommand pluginCommand;
if(commandMap.getCommand(this.name) == null) {
Constructor<PluginCommand> constructor = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
constructor.setAccessible(true);
pluginCommand = constructor.newInstance(this.name,plugin);
}
else {
pluginCommand = plugin.getCommand(this.name);
}```
I cant give it tab completer
@Override tabComplete
is there a way to print to a player all the commands sent by the console?
there is a pre process event you can listen to
the pre process is only for players or it works for console too
but, is there another way?
i want to make a anti-abuse system
console abuse?
friend's only server
better regulate who has access
if they have console access there is nothign you can do to prevent them "cheating"
Only server admin should have console access
ServerCommandEvent btw
oh yeah I didn;t look that well
but my statement still stands. No one shoudl have console access other than admin
especially if you suspect they may abuse it
thank u
does anyone know how i can remove the natural particles from a snowball when it hits something?
When you call the custom recipe to require another custom recipe and it turns into a base player head missing all its info
This is the link to the code files, i know a bit of java so if you can help id appreciate it
https://github.com/SnowSnakz/ElementalFoods/tree/main/lib/src/main/java/com/elementalwoof/foods
This was coded by someone else with my idea, im just trying to fix this bug
Its missing about 3 of its components but they are all there in the section on the left
if I remember correctly Minecraft doesn't handle that type of NBT requirement well
Yeah its weird, it shows up fine in the recipe book, but not when you need to choice it if that makes sense
Loses its name, lore, pretty much anything that would let you know what it is
12 components in the recipe book, 9 components when called
Yeah the game doesn’t like ingredients with components when it comes to showing the recipe ghost items
Or when trying to auto move items into the crafting grid
Is there a way to fix/work around this?
Not that I know of
Thats not good
Do other recipe plugins do recipe where items call other custom items?
if so i wonder...
I’m sure they do
I guess an alternative to this would be using a variated crafting table
that doesnt show recipe forms
which means you cant use the normal crafting table
and that explains why slimefun does it that way
smh
Thanks 😭
"only materials are support by base recipes"
This is coming directly from how its setup. Man..
Could i listen to PrepareItemCraftEvent and redo the lore?
I need to order my pcie to m.2 thingy so i can get my plugin out of it. I made one where it uses an alternative table and works just fine, but the laptop died 😄
is there a way to disable the recipe book
just the ghost forms
not the whole thing
nvm dumb question
There’s a packet for it
Ill just have to get my files
Not sure what happens if you cancel it
well theres really no point, then people wouldnt know how to craft it lol
i think i can totally get my files man, it has an OS on the thing
brb 🤯
You don’t need the ghost items to know how to craft it
You can just look in the book
I spent days if not weeks working on a custom food plug-in that works, and I found all the codes
Literally estatic
I assure you this does not work
Dsmn it's not even compilable 💀
Wait nvm bro casted it's okay it'll just crash on run

thas sum real shit
I went for working not clean that was when I started getting into more advanced code and as you can see, I knew nothing
🤣
gonna look for my first plugin and decompile it and send some screenshots in a bit
its cursed asf
If I remember right, this custom food plug-in opens a custom crafting table so that way it doesn’t deal with the ghost items
It’s fully working besides being able to set up all the foods in the config I think
Gonna find out 💀
Successful recovery. Now this laptop can get bent literally
how would you detect when a player is the first person to open a naturally spawning chest. Is there an event for that?
or is it just interact
If the chest has a loot table it’ll fire a LootGenerateEvent
alright thanks thats what I was looking for
also is there an event on xp bottle splash where I can set xp
or do I have to just do a projectile land event
how do you spawn an xp orb
ExpBottleEvent
ty
for a BlockPlaceEvent is e.getBlockPlaced() the same as e.getBlock() or do they return different things?
the former
don't even know why that method was added tbh
I guess to match the placed against method and the replaced state but still
is a LootContext instance of a Chest (nvm it isn't, so what is lootcontext?)
also is there a way from a LootGenerateEvent to
A. see if it was a chest generated
B. get that inventory
hello. Im trying to compile a plugin, but Im having problems with dependencies. this is my first time doing this. Ive tried browsing for solutions but couldnt find any answers. Some of the dependencies that are local are showing up in red, and I dont know what to do with them.
In 1.20 I am using this line of code ResourceKey<Biome> resourceKey = ResourceKey.create(Registries.BIOME, new ResourceLocation(newBiomeName.toLowerCase()));, but in 1.21 ResourceLocation has private access. Does anyone know what can achive the same effect?
if anyone was wondering, got it working from this thread:
https://www.spigotmc.org/threads/lootgenerateevent-setloot-clears-the-chest-loot-even-if-the-collection-is-populated.562028/
🫠
are you making custom biomes
use ResourceLocation#withDefaultNamespace method
Thanks!
https://www.spigotmc.org/threads/1-21-3-register-custom-enchantments-with-nms.651347/
this post does much of the same registry modification even though it is for enchantments, you probably want to take it as example
Asked this in another community and the guy basically called me an imbecile, so I appreciate it when people simply provide help
Ah ok cool!
what, why lol
inb4 it was paper and they told you to use registry modification API instead
He said I should have been able to figure it out myself by looking at the class
Which is fair
That's kinda how nms is tbf he never called you dumb
I mean, there's plenty to get lost on these decompiled classes, can't blame them
Though Javier is a sweet and helpful person <3
at some point it all just looks like noise
Especially Codec
You both have a point
NMS is a lot of nitty gritty looks at the internals
But man is it a lot LOL
I feel that, the other day I was trying to figure out how the heck chunk generation worked exactly, even when stepping through the debugger, it didn't help much lol
at some point I just stare at the thing thinking maybe I'll have an eureka moment at some point lol
Same here lol
Chunk gen is insane
I can't blame you there
It really is
I've learn the hard way that it just takes being patient really, accepting that I won't get it on the first go
Those are free as hell though quick move can be a tad confusing but otherwise free
then slowly figuring out and annotating what I do get
But that’s still something!
And VERY important
the only downside is that minecraft is moving very fast currently so it only gets harder to keep up
I do wonder how md even handles all of it
^^^
I can't wait till we get menu builders
I'm like doing ass at actually addressing comments atm
That’d be awesome.
Finals are a bitch
Barely
Answer: They barely can lol
Luckily dif for 1.21.4 wasn't that huge from what I've been told
they pretty much just finished the winter drop with it so yeah, there wasn't much left I imagine
Yeah that’s good. I was really curious about the creaking and how it would work because maybe it wouldn’t move even if you look at it in third person, which would mean we’d get view data to the server, but alas
I had hoped they'd make the creaking more interesting tbh
My only wish was adding a bit of fog to the biome
like, at least make its AI smarter so it teleports when getting stuck in a 2x2 hole lol
But you can just tweak that with a datapack
Oh I know I wish it woulda climbed out of holes all you need to beat them is a fist and the will to dig down 2 blocks
or since it is tall, they could've made it able to jump high or smth idk
I'm assuming mojang doesn't think that would be possible in practice though or something because they expect you to be dealing with other mobs too
hopefully someone releases a datapack which makes it less of a dumb mob
I'd say that but I feel like I probably don't have room to criticize I haven't played minecraft properly in ages
I haven't played any other version of minecraft other than 1.8 in like 5 years
I just keep up with the changes because somehow that became a hobby of mine
it is kinda hilarious sometimes because since I don't really try to understand the mechanics, just the technicalities behind them so sometimes I'll have some funny misunderstandings
like the other day someone was asking something about the breeze mob, I did know the mob existed but I never actually bothered to check what it was but since it was called breeze I just thought it was some kind of new projectile
turns out it is an actual full-fleshed mob lol
Can someone give a tutorial on custom enchants plz? All the ones on the internet are outdated for latest version
heyyyy, is there a tutorial or documentation about the worldgeneration? i want to know how plugins like Plotsquared or PlotME works with generation of Plots. 🥺
How do you support hex codes � in TextComponent? show example, honestly tried a lot
i have it working with legacy hex codes but i need normal hex
it says i dont have access to that link
https://paste.md-5.net/morefisoka.js This is what im using now, which places a X in between each letter, BUT this code works for any other type of message. only not TextComponent
Not sure im understanding where you would like me to use < > in the code, my item uses name �
gang can someone tell me how the actualy fuck im supposed to compile this shit into a .class
dm if can hlep
would be greatly appreciated
cause cant send code here for some reason
That's for minimessage
Hello, which packets are required for creating disguises?
Disguises as other entities? other players? or both?
i want to disguise players as other entities, e.g chicken
i found this, but i'm yet to receive response from ahmed https://github.com/iiAhmedYT/ModernDisguise/blob/master/VS-1_12_R1/src/main/java/dev/iiahmed/disguise/vs/VS1_12_R1.java
The easiest way would probably to use the hidePlayer api and then manipulate an nms entity object
i'm not trying to disguise entites as other entities
i want to disguise players themselves
so why do i need a nms entity object?
Helps with the packets
Otherwise you'll need to call of them manually which will be a pain
And so does Libs
yeah, it makes sense now
probably it comes with the entity data and such on change
that has to be per disguise, hmm
hmm
i might consider just using libs disguise for now
probably a good idea
"all usage of MaterialData is deprecated and subject to removal."
What do we need to use instead?
Try reading the rest of that sentence
all usage of MaterialData is deprecated and subject to removal. Use BlockData.
ah thanks I didn't see that on the spigot page sorry
Hello, can anyone link a good plugin for GUI's? For 1.21!
?gui
or if you're not making a plugin you should move to #help-server
invDeath.setItem(8, getItem(new ItemStack(Material.OAK_DOOR), "&9BACK", "&aClick to go back to main menu", "&ago back to main menu"));
I'm stuck with this. I can't understand how BlockData works.
I want a material type
What do you want to use BlockData for?
The code above doesn't exactly specify
nor does it look relevant?
or are you just confusing Material and MaterialData
I want to replace Material.OAK_DOOR with something new because it is deprecated
oh I see haha, I just need another function to get the material type
?
I can't use it like that I just get errors
What's the error
Like my IDEA can't find Material
Update Intellij
?paste
Hello everyone, I was trying to figure out how the WE API works and couldnt figure out how to paste cuboid selections into the world, does anyone know how to?
this is my code
public static void returnArena(){
com.sk89q.worldedit.world.World world = BukkitAdapter.adapt(Spleef.w);
try (EditSession editSession = WorldEdit.getInstance().newEditSession(world)) {
CuboidRegion cr = CuboidRegion.makeCuboid(new CuboidRegion(new BlockVector3(66, -30, -50), new BlockVector3(166, 21, 50)));
BlockArrayClipboard cb = new BlockArrayClipboard(cr);
ClipboardHolder CH = new ClipboardHolder(cb);
Operation operation = CH.createPaste(editSession).to(new BlockVector3(-50, -30, -50)).ignoreAirBlocks(false).build();
Operations.complete(operation);
} catch (WorldEditException e) {
throw new RuntimeException(e);
}
}
no problem 😄
you have to copy and then paste
your code seems to mix the 2 steps resulting in issues
yeah probably
ty so much
🙏🙏
dont want to look stupid so gonna close discord for now, had exams today (name is "Итоговое сочинение" )
YEAHHH
BABYY
IT WORKS
THANK YOU SO MUCHHH
@lilac dagger U're the GOAT 🙏
i'm glad i could be of help 😄
gotta love my school wifi
bro is writing plugins at school
God this is why I modded my chromebook heavily
School security is annoying
BTW, i have another related question, so how do block patterns work in WE API?
have you considered asking them
why are you writing plugins at the school😭😭
im on dorms so this sucks ass
yea
sounds like you need a vpn or somethin
i mean i just use mullvad vpn cause minecraft.net/mojang.com websites are blocked too
so i cant even log into minecraft
i couldnt actually figure out how it works lmao so forgot about it
all i can see is this https://worldedit.enginehub.org/en/latest/api/concepts/patterns-and-masks/
same
i suppose there is a method ima check
maybe create pattern or something
yeah, it says to use your ide
i'm pretty sure there's a method during paste somewhere
WOW.. thats actually fucked up of the dev to do that
😭
sometimes documenting everything is not doable
oh yeah, i need that not for paste but for cylinder creation (there is something i want to make player dependant)
real
during creating should be a way to apply a pattern i think
exactly, it needs a pattern
and i dont know how to create one
it says to use block states but uh
yea
TypeApplyingPattern ?
what does dis mean (im not dumb i swear its the exams)
is extent we api only thing?
Extent?
ye
public interface Extent extends InputExtent, OutputExtent {
BlockVector3 getMinimumPoint();
BlockVector3 getMaximumPoint();
List<? extends Entity> getEntities(Region region);
List<? extends Entity> getEntities();
@Nullable
Entity createEntity(Location location, BaseEntity entity);
}
uhhh
Extent doesn't mean much unless i have a bit of knowledge with world edit
which i don't
it looks like it's a selection for entities
what the fuckk bro



