#development
1 messages · Page 143 of 1
What if someone wants that the placeholder returns something like &lHello
it will always return §lHello, no way to prevent this?
you could do some evil text replacement
eg
replace & with £:!@$J!U%!*'41
apply papi
replace £:!@$J!U%!*'41 with &
so that it doesnt translate the &
but then placeholder wont return &l
wait what?
i dont think that helps
if the placeholder will be used by other plugins
ok lets go back to the start

why do you want it to return &l and not §l?
just a tho
my placeholder for example
should return not parsed color nodes
but ofc it makes it return parsed ones
(which i think it shouldn't)
i mean, that forces all expansions to return parsed colors
which makes it impossible to return a string with &l (even wanting to)
but why
to be used somewhere else
where else
somewhere else
please can you just tell me the full context rather than making me ask such specific questions

because as always, context is important
yeah. this is a known problem and they're planning on removing that. idk when or how
there is not a full context
yes there is
my placeholder simply should return not parsed ones
there must be some situation where you actually need it to be & and not §
in case owners need it
i have normal, and not_parsed "version"
well, you never know, maybe a plugin requires it
or something
idk
really?
yes. I completely agree. but like as I've said, its marked as a bug
honestly if you cant think of an actual reason why you need this then it sounds like a waste of time
like yeah it's not ideal
ugh. using & in your message?
but you clearly dont have any actual problems right now
that's a good reason
i mean, the fact that devs/expansions cannot return whatever they want
what if my placeholder returns a minimessage string for example that I want to contain &
it's already a problem
translateAlternateColorCodes will work fine with a & b
they'll be replaced to section symbols and it will break them
yes. but I might be stupid and doing a&b
anyways it shouldn't be PlaceholderAPI's job to translate colros. and yeah its marked as a bug afaik. no idea when they'll fix it
lets say placeholder %theoptions%
returns Options: a&b
it will look only like Options: a
why would an expansion return something like that? god knows why
YEs it is, because if you were writing a plugin and using papi as an api then the original solution i described would've worked, but because you refused to actually give any specific information we wasted both of our time having to get to this point
but changing the output is the issue here
Why don't they fix it if it's only 1 line to change?
🤔
prob because many plugins dont use translate alternate colors after setting placeholders
which would "break" already setup stuff
i mean, they should be using it if they want color nodes parsed ni first place
breaking change
but i guess they are simply lazy
The thing is that changing output is not a valid thing, expansions should return whatever they want
i know that
papi bad
a&[zwj]b
but making breaking changes to papi isnt exactly gonna happen, and so i suggested a workaround
if you had given enough information from the start, i wouldve known that this workaround wasnt applicable
so please
just be specific
papi 2077
2069
well at least it's not such breaking change like when EZPlaceholderHook was removed
someone died last time breaking changes were made so
hope so too
Wait what
Hey, I'm updating a plugin that was made by another developer, it says this to unregisterExpansion()
https://i.imgur.com/scPI50G.png
What's the new unregisterExpansion()? I tried to find it on github
PlaceholderExpansion#unregister
Also I'm pretty sure you're supposed to unregister before setting to null
unregistering null, won't really work xD. will just give you a
NPE
Hello, i wanna reproduce the riptide animation movement just using velocity depending on the level. Obviously i've cancelled the riptide and everything that works lovely. I just wanna be able to now reproduce it. But with the math, i dont know where to get started 
Did someone say movement predictions?
d
help
import org.bukkit.Material;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BlockStateMeta;
import java.util.ArrayList;
import java.util.List;
public class Spawners {
public static ItemStack CaveSpiderSpawner;
public static void init() {
createSpawner();
}
public static void createSpawner() {
ItemStack caveSpider = new ItemStack(Material.SPAWNER, 1);
BlockStateMeta meta = (BlockStateMeta) caveSpider.getItemMeta();
meta.setDisplayName("Cave Spider Spawner");
List<String> lore = new ArrayList<>();
lore.add("Place this to get a Cave Spider Spawner");
meta.setLore(lore);
CreatureSpawner creatureSpawner = (CreatureSpawner) meta.getBlockState();
creatureSpawner.setSpawnedType(EntityType.CAVE_SPIDER);
meta.setBlockState(creatureSpawner);
caveSpider.setItemMeta(meta);
CaveSpiderSpawner = caveSpider;
}
}
why is it not changing the spawner to cave spider?
d;spigot BlockState#update
boolean update()```
Attempts to update the block represented by this state, setting it to the new values as defined by this state.
This has the same effect as calling update(false). That is to say, this will not modify the state of a block if it is no longer the same type as it was when this state was taken. It will return false in this eventuality.
true if the update was successful, otherwise false
import org.bukkit.Material;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BlockStateMeta;
import java.util.ArrayList;
import java.util.List;
public class Spawners {
public static ItemStack CaveSpiderSpawner;
public static void init() {
createSpawner();
}
public static void createSpawner() {
ItemStack caveSpider = new ItemStack(Material.SPAWNER, 1);
BlockStateMeta meta = (BlockStateMeta) caveSpider.getItemMeta();
meta.setDisplayName("Cave Spider Spawner");
List<String> lore = new ArrayList<>();
lore.add("Place this to get a Cave Spider Spawner");
meta.setLore(lore);
CreatureSpawner creatureSpawner = (CreatureSpawner) meta.getBlockState();
creatureSpawner.setSpawnedType(EntityType.CAVE_SPIDER);
meta.setBlockState(creatureSpawner);
caveSpider.setItemMeta(meta);
creatureSpawner.update(true);
CaveSpiderSpawner = caveSpider;
}
}
didnt work
I think you have to update it before setting the blockstate to the meta
How can i put all my warps into a GUi
with a for loop
looking for an example as ik i can do something like this public void getWarps(Player player) { StringBuilder sb = new StringBuilder(); for (String s : warpConfig.getConfig("warp", "warps").getConfigurationSection("Warps").getKeys(false)) { sb.append(s + ", "); } cmf.header(player, MessageType.INFO); player.sendMessage(cm.Colour("&aWarps: " + sb.toString())); cmf.footer(player); }
whats the actual question?
getWarps shouldn't return a list or something? I mean, it's a get thing
so you can use it somewhere else i guess
Bukkit.getScheduler().runTaskTimer(this, () -> {
for(Player allplayers : Bukkit.getOnlinePlayers()){
gconfig.getString("Announcement1.Announcement");
gconfig.getInt("Announcement1.Timer");
allplayers.sendMessage(A1);
}
},20*A1T,(20*A1T)+(20*A2T)+(20*A3T));
Bukkit.getScheduler().runTaskTimer(this, () -> {
for(Player allplayers : Bukkit.getOnlinePlayers()){
gconfig.getString("Announcement2.Announcement");
gconfig.getInt("Announcement2.Timer");
allplayers.sendMessage(A2);
}
},(20*A1T)+(20*A2T),(20*A2T)+(20*A3T)+(20*A1T));
Bukkit.getScheduler().runTaskTimer(this, () -> {
for(Player allplayers : Bukkit.getOnlinePlayers()){
gconfig.getString("Announcement3.Announcement");
gconfig.getInt("Announcement3.Timer");
allplayers.sendMessage(A3);
}
},(20*A1T)+(20*A2T)+(20*A3T),(20*A1T)+(20*A2T)+(20*A3T));
making an announcement plugin
not really understanding how i could make these go in order
instead of the odd delay and period times
String A1 = gconfig.getString("Announcement1.Announcement");
String A2 = gconfig.getString("Announcement2.Announcement");
String A3 = gconfig.getString("Announcement3.Announcement");
Integer A1T = gconfig.getInt("Announcement1.Timer");
Integer A2T = gconfig.getInt("Announcement2.Timer");
Integer A3T = gconfig.getInt("Announcement3.Timer");
I was told an array list would work but couldn't quite wrap my head around implementing that : P
what?
make them go one after another, because each timer could be different
actually im gonna make my life easier and just make one timer option configurable for all

// Initializes map to be used for saving announcement times and messages
Map<int, List<String>> announcements = new HashMap<>();
// Lines below add times and arraylists (of strings) to map.
// announcements.put(20, Arrays.asList("This announcement runs every second."));
// announcements.put(100, Arrays.asList("This announcement runs every 5 seconds."));
// announcements.put(1200, Arrays.asList("This announcement runs every minute.", "Yes multi-line messages are possible."));
// Creating a variable to use as a counter
int count = 0;
// Creates a variable to cache our annoucnement task
BukkitTask announcementTimer;
public void startAnnouncements() {
// Checks if our task is already running
if(announcementTimer != null) return;
// Initializes our task variable by creating a bukkit task
announcementTimer = Bukkit.getScheduler().runTaskTimerAsynchronously(<JavaPlugin>, () -> {
// Increments our counter
count++;
// Iterates (loops) through our announcement map's entries
announcements.entrySet().forEach(a -> {
// Variablizes our key and values
int time = a.getKey();
List<String> messages = a.getValue();
// Checks if the count is dividable by the announcements saved time then broadcasts the string list to online players.
if(count % time == 0)
messages.forEach(msg -> Bukkit.broadcastMessage(msg)); // Add chat color and such.
});
},0, 1);
}
```Written on discord adjust code as necessary.
thank you this helps a lot man, what is this called?
just so I can look it up and learn what's happening here
I just wrote it lol A simple way to broadcast on timers.
thank you again, much appreciated for your time
Np added comments to help you learn.
that helps so much, im a beginner and learning basics for me is just doing projects so this helps a lot also for figuring it out
really appreciative of the comments
👍
That’s not the full exception
at net.evilblock.cubed.command.CommandNode.invoke(CommandNode.kt:285)
yes?
i cant send screenshots but thats it
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.
that doesnt work either
import org.bukkit.Material;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.BlockStateMeta;
import java.util.ArrayList;
import java.util.List;
public class Spawners {
public static ItemStack CaveSpiderSpawner;
public static void init() {
createSpawner();
}
public static void createSpawner() {
ItemStack caveSpider = new ItemStack(Material.SPAWNER, 1);
BlockStateMeta meta = (BlockStateMeta) caveSpider.getItemMeta();
meta.setDisplayName("Cave Spider Spawner");
List<String> lore = new ArrayList<>();
lore.add("Place this to get a Cave Spider Spawner");
meta.setLore(lore);
CreatureSpawner creatureSpawner = (CreatureSpawner) meta.getBlockState();
creatureSpawner.setSpawnedType(EntityType.CAVE_SPIDER);
creatureSpawner.update(true);
meta.setBlockState(creatureSpawner);
caveSpider.setItemMeta(meta);
CaveSpiderSpawner = caveSpider;
}
}
im mad confused since i cant find it
do you have a package net.evilblock.cubed.command in your project?
I mean the last line is a caused by, with the actual stacktrace missing
true. didn't even notice that.
It's not my project I'm working around a base and there's errors like this im trying to figure out so I can't say if I do or do not
send the full error then.
as sirywell mentioned, there's at least 1 line missing at the end
that is the full error
Add me I'll send you a screenshot
I appreciate the help too 😄
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
var text = text
set(value) {
entity.customName = Component.literal(value)
field = value
}
does the var text = text trigger the setter?
and which order does the code run? initializing variables first then the init block?
a bit of research says that init fires after the primary constructor before the secondary constructor but im not sure where variable initialization lies in the order
No it doesn't trigger the setter
hey
Im trying to make a Spawner plugin
and is it possible to get the Spawner Item's Name or Lore which a player places and if It matches it then change the CreatureSpawner type
Trying to figure out why my cooldown restarts when the server restarts or the plugin reloads.
Cooldown Start:
https://paste.helpch.at/dijonawece.java
OnEnable/OnDisable:
https://paste.helpch.at/majasuhole.cs
Could anyone help me?
gotta be more specific than why your cooldown restarts
yes its possible
but like how can I get a ItemStack in a BlockPlaceEvent
I'm not sure why it restarts that's my issue
nah like what do you mean restarts?
like the original cooldown data is lost?
try
Block b = event.getBlock();
Collection<ItemStack> items = block.getDrops()
and then just
items[0].getItemMeta(); and do your checkings with it
If the cooldown is 30 seconds, i restart the server, the player still has a 30 second cooldown,
Example:
Start cooldown: 30 seconds left
cooldowncheckafter10seconds: 20 seconds left
restart server
cooldowncheck: 30 seconds left
cooldowncheckafter10seconds: 20 seconds left
but I wanna get the placed block
then do it with blockplacevent??
oh im sry I meant BlockPlaceEvent not BlockBreakEvent
probably because it unloads the classes when the plugin is disabled
gonna check the soruce code brb
but a better way is save the cache into yml whenever it stops
and then load them back into the static map whenver it gets enabled again
I save the cache in the yaml onDisable, then i take the info from the yaml and put it into the Map onEnable
onEnable:
if (!(playerJobsCooldown.contains("data"))) {
return;
}
for (String string : getPlayerJobsCooldown().getConfigurationSection("data").getKeys(false)) {
UUID uuid = UUID.fromString(string);
System.out.println(UUID.fromString(string));
JobsJoin.cooldownMap.put(uuid, System.currentTimeMillis());
}```
**onDisable:**
```java
for (Map.Entry<UUID, Long> entry : JobsJoin.cooldownMap.entrySet()) {
UUID key = entry.getKey();
long value = entry.getValue();
try {
playerJobsCooldown.set("data." + key, value);
playerJobsCooldown.save(configFile);
} catch (IOException e) {
e.printStackTrace();
}
}```
oh alr
on disable try setting playerJobsCooldown.set("data",null); before setting the whole map in
your situation may happen because there are some remnants that are not removed from like last last or last last last etc runs when the players complete the cooldown but the data still persists in the yml
oh ok thx
does anyone know when ClientboundLevelChunkPacketData is sent to the player instead of the ClientboundLevelChunkWithLightPacket
i did quite a bit of testing but cant find any instance of the first packet being used
?paste
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
why is the creature spawner isnt changing
I saw ItemMeta#getDisplayname() has @NotNull annotation, what it returns if nothing was set or null was set? returns empty string or what?
Probably vanilla name then
Ok
so cant retun "Black Stained Glass Pane" nor "Vidrio tintado de negro"
d; spigot ItemMeta
public interface ItemMeta
extends Cloneable, PersistentDataHolder, ConfigurationSerializable```
ItemMeta has 33 methods, 3 extensions, 3 super interfaces, and 21 sub interfaces.
This type represents the storage mechanism for auxiliary item data.
An implementation will handle the creation and application for ItemMeta. This class should not be implemented by a plugin in a live environment.
null

Really?
Spigot has less than the average brain cell count
Yes Zod
"null" or null type?
literally null, no object, nada
Because "yOu NeEd To ChEcK hAsDiSpLaYnaMe beFoRE cAllInG tHis MethOd"
That's dumb
d;spigot ItemMeta#getDisplayName
@NotNull
String getDisplayName()```
Gets the display name that is set.
Plugins should check that hasDisplayName() returns true before calling this method.
the display name that is set
@Deprecated @NotNull
@NotNull String getDisplayName()```
Gets the display name that is set.
Plugins should check that hasDisplayName() returns true before calling this method.
in favour of displayName()
the display name that is set
Smh
lol they reverted that?
Oh was it fixed before?
Yeah
Huh
Though the Component displayName variant is annotated as nullable
uh.. I guess I'm wrong? https://jd.papermc.io/paper/1.15/org/bukkit/inventory/meta/ItemMeta.html#getDisplayName--
I swear it was nullable lmao
Hm
maybe there are other not null methods that spigot fixed ¯\_(ツ)_/¯
That you confused it with
I wonder if paper would accept a pr to change that
I think only lore was nullable
because for some reason, null and empty are two different things to craftbukkit
What why is lore nullable but name is not???
Wait
If u create 2 items
But in one of them you add empty lore
Will u see a difference
I dont think so
Hm
No
Basically: if there is no lore, there is no list to iterate and get any json from; if there is lore but it's empty, there are no elements to get any json from
How would yall go about modifying the format of the console log of chat messages in console?
For instance, currently if I send a message chat, the message sent to the console will show[current:time INFO] <MrMcyeet> Hey, I am a sample message!
If I wanted to change that to show the player's level, like [current:time INFO] <MrMcyeet [lvl. 8]> Hey, I am a sample message!how would I go about that?
if it is your code it should be very simple
well
i mean if youre making it yourself just parse the text and put it before the second > or if youre doing anything special just break it up into sections like [name] [lvl] [message]
I got that, but what method or whatever do I need to use to actually edit what is shown in console (but not in game)
personally id say cancel the event itself and send your own text to the game and your own text to the console
that might be the wrong approach tho... by wrong i mean just bad practice but i havent found anything in the API that would work for what you want
https://docs.adventure.kyori.net/serializer/ useful for extracting text from components assuming your using a newer version of the api
this should actually work out, it shouldnt send the message to the console if yolu add this line and in that case you can send your own message straight to the console
@EventHandler
public void onChat(AsyncChatEvent e) {
e.viewers().remove(Bukkit.getConsoleSender());```
Should I reregister Placeholder Expansion on my plugin's reload command?
No
so it allows "players to have a limited amount of life"
but how about a limited amount of death
after the player dies x times they can't die anymore
very good idea would implement

@dusky harness cpp = best
True
So, I use the same testing setup for most of my plugins, and I decided to make a small gradle plugin where I could define some test servers with different versions, then create a task for each (e.g. testOn1_18_2) which would take the jar from shadowJar, put it on the plugins folder of the specified server and then start the server.
This is the Server class https://paste.helpch.at/utumenuyih.java and this is where the extension is registered https://paste.helpch.at/jiwehedetu.java, but for some reason getPaper() is false, even though I set it to true
testServers {
create("1_18") {
version.set("1.18")
paper.set(true)
}
}```
you sure you didnt forget the this.paper = paper? xd
paper.set(true)
ahhh it was gradle xd
well yeah, it is certainly using that, but I don't know why
ah, guess what, calling that method inside getTasks().register() returns the right value 🥲
serverContainer.all(server -> {
System.out.println("paper() is " + server.getPaper().getOrElse(false)); // false
final String name = "testOn" + (server.getPaper().getOrElse(false) ? "Paper" : "Spigot") + server.getName();
project.getTasks().register(name, Copy.class, task -> {
System.out.println("paper() is " + server.getPaper().getOrElse(false)); // true
task.setGroup((server.getPaper().getOrElse(false) ? "Paper" : "Spigot") + " testing");
task.from(shadowJar);
task.into("./servers/." + name.replace("testOn", "") + "/plugins");
});
});```
I will just guess that what I'm trying to accomplish is not possible
Alright so I need help with something much more important xD
So, for some reason, on older versions, a variable "lose" the link to player's item in a certain circumstance.
I got this vouchers plugin and it has a confirmation feature where a GUI is opened when you try to use the voucher. The item I get from PlayerInteractEvent I pass to the confirmation GUI, and after the player clicks on "Confirm", the redeem() method is called and at the end of this method, 1 should be subtracted from item's amount.
PlayerInteractEvent
final ItemStack item = getItemInHand();
if (voucher.hasConfirmation()) {
openConfirmation(player, item);
} else {
redeem(player, item);
}```
> openConfirmation();
- Create GUI
- Add all items
- Set the action for the "confirm" button to call redeem(player, item);
> redeem();
```java
item.setAmount(item.getAmount() - 1);```
Now, the problem is that when confirmation is enabled, the stack amount remains the same. The only difference between "with confirmation" and "without confirmation" is the GUI, but inside the gui I call the same `redeem()` method.
looks nice to read, but too much text xd
yeah lol
easy
grab one item, open the menu
listen to close event, if not redeem, return the item
(i think i'll make a vouchers plugin, looks fun)
Smh guys
That could cause issues with crashing
right now i'm working on adding inaccuracy for guns in my game. the idea is that i have a direction in which a bullet is shot, and inaccuracy adds on to that. in cs for example, it's measured in the farthest distance a shot is guaranteed to hit a 30cm plate. this means that max offset is (0.3/2)/distance. to generate randomness like this, the easiest way is with a polar coordinate grid, with this code: java float theta = (float) (r.nextFloat() * 2 * Math.PI); float random = r.nextFloat(); Vector inaccuracy = new Vector(random * Math.cos(theta), random * Math.sin(theta), 0); this generates a random position along the x and y axis. my problem is that i need to add inaccuracy to a vector called direction, but i first would need to rotate the inaccuracy vector, and this is out of my mathematical knowledge and google hasn't been much help. if anyone could lend a hand to the problem that would be nice. i'm currently just spawning particles to simulate the endpoint of a shot.
how xd
solved
If the server crashes while the player is in the confirm menu, they lost a voucher that was never actually redeemed.
Any math pro or whatever that can help me? I have a start location, and a direction, I need to check if at a certain distance following that direction from start location there is a block, anybody knows?
Raycast?
at a certain distance or up to a certain distance?
I am making a plugin that needs to efficiently check if a player passes through a very small 3x1 passage. I know how to do it with the PlayerMoveEvent, but that doesnt seem efficient. There will be mutliple of the passages, so checking each one doesnt sound too great. Is there another way I could about this? (I dont want to have to use WorldGuard or any plugin like it)
Would packets instead of events be a viable option?
I´m confused abut this error https://paste.helpch.at/atanugorud.bash I know the error, but not way it print error. Look more like the method spigot/bukkit use ignore the if check I have and try load every class in the method i have.
Show some code
The error is happening because the subclass Particle.DustTransition only exists on 1.17 and above
and somewhere
it needs that class
I think in config?
whatever config is in SimpleYamlHelper line 138
Do you have particles in your config
Yeah and I check for that, but somehow it compliantly ignore my if check.
can post that also, but that method only load the file.
I added some debuging but that not help at all .
https://paste.helpch.at/qucamatuzo.java
The SimpleYamlHelper , I know is little messy (working on improving that class) https://paste.helpch.at/imayanovil.java.
There seems to be some invalid syntax in your config! You can paste it into https://yaml.helpch.at/ in order to find out where your issue is!
Yes that are the plan 🙂 it should right now only load on 1.17+ (but ignoring the check right now).
No problems. So should not have this two as final or split this classes to other class?
can I see your config?
I have a feeling that a DustTransition is deserialized in there and when the file is loaded it can't find that class
this.customConfig = YamlConfiguration.loadConfiguration(file);
I don´t have DustTransition or DustDustOptions in the file. So only way it can read that classes thru the ParticleEffect class
ah, I think I see
You are checking if the server version is newer than 1.16, which 1.16.5 (or what 1.16.X version you have) is, but the class exists only on 1.17
Change the check to "newer or equal to 1.17" or something like that
don´t worry about that detail it count all 1.16 versions.
I don't think it does
I my own custom method so 🙂
Also, is that the only config you have?
yes this is only this file some have this type of saving with ConfigurationSerializable . I mean it not even read my debug message and when remove DustTransition from deserialize it works.
when you remove what?
From ParticleEffect and inside method #deserialize() (at least not connected to that method).
System.out.println("ServerVersion.newerThan(ServerVersion.v1_16)######## " + ServerVersion.newerThan(ServerVersion.v1_16)); is this false?
yes but it even not read that line when get this error java.lang.NoClassDefFoundError: org/bukkit/Particle$DustTransition
Look like this if I commit out DustTransition.
[16:58:09 INFO]: deserialize Particle effect
[16:58:09 INFO]: ServerVersion.newerThan(ServerVersion.v1_16)######## false
[16:58:09 INFO]: deserialize Particle effect
[16:58:09 INFO]: ServerVersion.newerThan(ServerVersion.v1_16)######## false
and if you add that commented out method back?
I get same error again and it not even start read the method, at least not trigger System.out.println().
it fails when looking up the method via reflections
might be related to how stack frames etc work
you could try to move the Particle.DustOptions dustOptions = null; into the if block
I suspect it could be the case.
ah wait it's the transition class that is missing
you could probably extract that part into a different method, and pass the map and the builder to it
more likely new class, because new method not work ether (even then it complains).
or why not just use 1.16 api?
that sounds odd
Because want it compatible with any version 🙂
I don´t know if I have to make the method static is the issue or if it read whole class.
With spigot, you should always use the lowest version that you want compatibility with, ex 1.8 api for 1.8 - 1.19
unless you want to make a specific feature like 1.17 and above only
This way seams to work at least https://paste.helpch.at/bedagemoji.java
I know, but is not the issue here. Is how java read a class some is the issue. I rarely have issue I can´t simply fix with simple version check and the error is gone.
well the method needs to be static if you want to call it from a static context
but an extra class shouldn't be needed
yeah, but it seams to read whole class when use reflections. So need hide it from that lookup.
yeah should be only that method. I also see it do others lookups in the ConfigurationSerialization class if first option is null.
I try now add #getsomething inside the class https://paste.helpch.at/dupotukoju.java and get same error https://paste.helpch.at/pijikatide.bash So it clearly not like classes some not exist 🙂
that's why I said you should pass the builder and the map to the method
I try https://paste.helpch.at/sugoratipe.java and get the error. So seams I can´t have missing classes in that class at all if I shall use bukkit serialize methods.
can you share the exact exception for that code?
https://paste.helpch.at/agoqiganim.bash It will not point directly to right class, is way was hard to find the issue first.
Guys, im really lazy and I don't want to initialize all those fields. The value of those Strings is the same as the name of the constant lowercased and all _ turned into dashes. I know this is fucky but can I just do this out of pure laziness: https://paste.helpch.at/relehetobi.java
enum (if the value is constant)? or what is your plan?
i cant use an enum here
Well i mean
Yeah no i cant
I mean I could make a separate enum class for it perhaps
And then do something like getKeyName() or something
but i prefer using actual String constants instead
what is it you plan use this class for or idea you want to use this class?
and the values never shall change data?
OutputConfigurator is an abstract class.
VLCTranscoderOutput is a "marker" class. It also holds constants specific to VLC
I think its fine tbh
I mean marker class as in like something similar to marker interfaces
OutputConfigurator must be abstract class as it contains method logic (with maps ands tuff)
So I can't use interface and define constants in interface
You could use set also (i think that are little faster and get the fields that way ). I the some problems at least when use that method an assess it reapply.
oh cmon it'll only take like 1 minute :((
or do you want to keep it
wait but does that code actually work
but I forgot that it only does that for methods
🥴
it'll take longer to write code to write code than to not write code to not write code so you should not write code to write code and instead write the code
but that's just my thought about writing code to write code which may or may not take longer to write code without writing code to write the code for you
code some is never get written is the fastest code XD
tongue twister
lol
🙃
Copilot:

Seams like only way I can do it (if I not move the logic for ConfigurationSerializable to other class or made my own serializer (I think is not to hard, but I think that will be some challenge to get it work with spigot api)) https://paste.helpch.at/ahegulezon.http .
So moved both DustOptions and DustTransition to other class (i think older mincraft versions don´t have DustOptions ether (need check that up too)). Need do some more clean up, but have at least some sort of baseline now.
more of an architecture question, i am making an api for armor stand holograms
since holograms are player specific (aka packet based), whats the best way to cache them?
keep holograms cached per person (the ones they can see) or store uuid of people that can see under the hologram objects?
both dont feel proper for some reason cleaning after players as they leave with the second option is a pain and with the first one deleting the holos becomes a pain
In the basic is holos armorstands. I guess you shall use the nms approach?
thats already handled, question is more about how the code should be structured rather than how to do holograms
Yeah,I was little confusing about "player specific".
Ether way if you want to handle the holos after you "spawn" it you need store it in some way (but when is packets you use you can send new packet when you need update it). Depends if you spawn real armorstand or not also.
currently my hologram object wraps a fake entity and sends its to whoever needs to see it
but i am not sure if i should store the players that can see in the hologram object or store the holograms under internal player wrapper objects
I think find out way, of some reason check java all methods some take arguments (not only that one you specify you want to use).
I think is how reflection works it search for all methods some has argument (if you have specify that) and that´s way you can get problems.
Yaml should only look for 1 of 3 methods for deserialization though
A static method "deserialize" that accepts a single Map< String, Object> and returns the class.
A static method "valueOf" that accepts a single Map<String, Object> and returns the class.
A constructor that accepts a single Map<String, Object>.
reflection still looks up all methods internally
Oh really?
In current implementations, yes
Hmm, annoying
Id suggest to use a proper storage instead of YAML. And if thats not a storage, the default serialization looks disgusting imo (==: path.to.Class)
Yeah , I will test something later and see if that will fix it.
Add a if check on the second method.
Yeah standard yaml look pretty odd. Map is ? For example.
Even more fun when spigot try convert unknown class.
You get yaml error when start the server xD
Yeah but in the jdk
Oh, that you mean
You seams to have right.
I try this , give me error (even if this return false , but somehow java ignore it )
public Particle.DustOptions something(ParticleDustOptions options) {
if (ServerVersion.newerThan(ServerVersion.v1_16))
return new Particle.DustTransition(Color.FUCHSIA, Color.AQUA, 1);
return null;
}
So I try something stupid and the error is now gone.
public Particle.DustOptions something(ParticleDustOptions options) {
if (false && ServerVersion.newerThan(ServerVersion.v1_16))
return new Particle.DustTransition(Color.FUCHSIA, Color.AQUA, 1);
return null;
}
I think they should use better method to get deserialize() method an blindly try find it.
There is no better way than that when using reflections
I mean for events you need to use @hazy roostenhandler and ConfigurationSerializable contains only serialize() way not also conclude the method deserialize()?
hm lol was not my plan to ping random .
Because you cant implement/override static methods
well there it looks at every method too :p
Wait, is that caused by Class#getMethod ?
alright that explain the issue then 🙂 need change how I instantiate that class then.
yeah but it never complains about the serialize() even if that contains DustTransition class.
The problem was your method that returns the class that doesnt exist, I believe you can just get rid of that method - since all it does is to call a constructor
yeah and it what it should do (so it not need create it on runtime (should be less load on the server)) or yeah it will be recreated if you use /plugin name reload ofc. I will say the particles are big mess from beginning to the end in spigot api (when you shall spawn it in the world or player for example).
I mean, replace that method with the constructor call
sry, working whole day on this, so are bit slow. you are right could solve it that way 🙂
Thanks for the help, give me more understanding how reflection works. I never think on it check more an you think it should do 🙂
yes
i have a for loop: ```java
for (float d = 0; d <= distance; d += accuracy) {
System.out.println(d);
if (d >= distance) {
System.out.println("reached distance");
}
}```
why is the if statement never reached?
bc if d is 10 and distance is 10, d is lower equal than distance but also greater equal than distance
and?
in that case the if statement would be called and "reached distance" would be outputted
but it's not
Well, is the last value printed >= than distance?
no
it's distance - accuracy
i'm using the values distance = 40 and accuracy is 0.2
last value printed is 39.8
Probably a problem caused by decimals
yea but how do i fix it
That doesn't look like the full code
Does it just recurse infinitely then?
Yeah I think it'd because it's equal and then exits before looping again
what
d == distance
that's not in my code
No its not
the loop hits 39.8
loops, hits or goes above distance
and then terminates
nvm i figured it out
you were right
wait
yea i think what's happening is it's reaching 39.8, rounding error happens, goes to > 40 so it's not run again
k thanks
No
The for loop is incrementing after the loop, so the boolean condition is checked then, and doesn't loop again
Your if statement can never be reached
isn't that exactly what i said
You said it was a rounding error, that is not the case
the condition is false because it goes over 40
the value wasn't exactly 39.8
38.800076 [13:55:48] [Server thread/INFO]: 39.000076 [13:55:48] [Server thread/INFO]: 39.200077 [13:55:48] [Server thread/INFO]: 39.400078 [13:55:48] [Server thread/INFO]: 39.60008 [13:55:48] [Server thread/INFO]: 39.80008
Oh I see now
consider using BigDecimal
That's illegal
Use that method you think is easiest work with. Is at least hard for me , some don´t know your code.
Hey everyone I was wondering if anyone knows an easy way to modify player attributes with KubeJS, I want to make a simple system for scaling player health, adding and keeping additional permanent hearts after death
Please ping me @grave wind
The observer pattern is a software design pattern in which an object, named the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.
It is mainly used for implementing distributed event handling systems, in "event driven" software. In those s...
yeah, but the issue is that player observes the hologram yes but also the hologram is dependent on the state of the player
👉 👈
the code does what its supposed to do
which is weird now that I think about it
but it shoots that exception every time I write a letter after I do the command
Which is the line of the error?
So either the sub command name or args[0] is empty
oh
Thought you said compile not complete
if(args.length > 0) will always be true, and right after you type a space it will be an empty string
so it gets trolled
so charAt(0) fails
ohhhh
it doesnt throw the error if I do a letter
thats why
what should I do to check that?
or do I just ignore it
epic
O(1)
I try to be creative https://paste.helpch.at/jihavasele.java but get still same error, is really strange even this this.particleDustOptions is currently null (so should not check rest in the constructor ether) so i need do it other way to set this classes. is clearly it not like classes some not exist. I have to set this instead in other class (little annoying).
im getting this in mc chat once i try to give myself a custom pickaxe
An error occurred while processing your command
Message: IllegalArgumentException:
java.lang.ClassCastExpception@781f94a2
Exception: java.lang.reflect.InvocationTargetException
Details:
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Not the full error, would assume there's an issue with your command class then
Hello, I've been trying to make this Server List MOTD thing in my plugin but I don't know how to make a multiline MOTD that is using the config.
For Example:
Config
motd:
- "&c&lLine test number 1"
- "&a&lLine test number 2"
Append \n after each line and it should split them, or whatever the splitterator for motds is
Is there any loop that checks all the strings in Motd and automatically adds a splitter?
loop through the config lines and add it?
yeah
@EventHandler
public void onServerListPing(ServerListPingEvent e){
StringBuilder motdList = new StringBuilder();
for(int i = 1; i < utils.getConfig().getList("motd").size(); i++){
motdList.append(utils.getConfigString("motd") + "\n");
}
String motdappear = motdList.toString().trim();
e.setMotd(utils.translateColors(motdappear));
}
motd:
- "&c&lTEST Number 1"
- "&a&lTest number 2"
It doesn't work
public void onServerListPing(ServerListPingEvent e){
StringBuilder motdList = new StringBuilder();
for(int i = 0; i < utils.getConfig().getStringList("motd").size(); i++){
motdList.append(i + "\n");
}
String motdappear = motdList.toString().trim();
e.setMotd(utils.translateColors(motdappear));
}
This is the new code
it does separate the line but it doesn't get the strings and type it as
0
1
yeah obviosly
String.join("\n", utils.getConfig().getStringList("motd"))
^
where should I type that
Replace what's above e.setMotd with that
and what should I type inside the e.setMOTD?
I'm new to java coding and I'm trying my best so sorry if I don't really understand what you're saying
String motd = String.join("\n", utils.getConfig().getStringList("motd")); and then use this instead of motdappear
What that String#join does is to combine all the string together and add a "\n" in between
So I should keep the loop right?
no
Is there any way I can center the motd text?
spaces
I have another question. I'm trying to make this PvP Stats thing but I don't know how to make multiple HashMap stuff like HashMap<Player, Kills, Deaths, KD, Cash>
You can't, so you'd have to make a class called like PlayerData for example
then the map would be HashMap<UUID, PlayerData> (don't use Player because it can invalidate itself whereas the UUID can't)
The PlayerData class would look something like ```java
public class PlayerData {
private int kills;
public int getKills() {
return kills;
}
public void setKills(int newKills) {
kills = newKills;
}
}
and It'll work?
lemme check 🙂
thanks
Should I edit the code to this?
private int kills;
public int getKills() {
return kills;
}
public void setKills(UUID player, int newKills) {
kills = newKills;
}
}
initialize kills
With?
can you message on me private ?
If you want
?imgur
You won't be able to upload images here directly to avoid spam, so please use https://imgur.com/upload to upload images/screenshots.
You can also use a screenshot service like gyazo or jinx and post those links here.
Oh shit is yappers going to click a link
sending remove entity packet followed by entity spawn packet to update an entity seems to sometimes make the entity disappear clientside
does anyone know why that happens?
(only seems to happen at older versions)
i'm currently using BoundingBox#raytrace to check if a a block was hit, and my problem is that the bounding box for stairs is a cube, not actually a stair. anyone know how to fix this or get around it?
what version?
1.17
help
public static ItemStack CaveSpiderSpawner;
public static ItemStack Placeholder;
public static ItemStack SpawnerItem;
public static void init() {
createSpawner();
}
public static void createSpawner() {
ItemStack caveSpider = new ItemStack(Material.SPAWNER, 1);
BlockStateMeta meta = (BlockStateMeta) caveSpider.getItemMeta();
meta.setDisplayName("Cave Spider Spawner");
List<String> lore = new ArrayList<>();
lore.add("Place this to get a Cave Spider Spawner");
meta.setLore(lore);
CreatureSpawner cs = (CreatureSpawner) meta.getBlockState();
cs.setSpawnedType(EntityType.CAVE_SPIDER);
meta.setBlockState(cs);
caveSpider.setItemMeta(meta);
CaveSpiderSpawner = caveSpider;```
why does this only work when im in creative mode
:what the:
when I place that spawner in creative mode it works but when I place it in survival mode it doesnt
im confused
why does that happen
why do your variables start with a capital letter
how is it related to my problem
- get help (joke)
- show the full code
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player p = (Player) sender;
if (command.getName().equalsIgnoreCase("spawner")) {
if (args.length == 0) {
p.sendMessage(ChatColor.RED + "Please enter a MobType!");
}
if (args[0].equalsIgnoreCase("cave_spider")) {
p.getInventory().addItem(CaveSpiderSpawner);
}
}
return true;
}
}```
@Override
public void onEnable() {
// Plugin startup logic
Spawners.init();
getServer().getPluginCommand("spawner").setExecutor(new Commands());
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}```
thats all the registered code
in survival mode what happens? is it just a pig spawner?
or whatever the default is
yes
but when im in creative mode it changes the spawner entity type when placing the spawner
I mean when I place the spawner in survival mode its a pig spawner but when I place it in creative mode its a cave spider spawner
hi, how can I remove a mod item from the player's inventory using a plugin? (I'm using mohits) ?
This is the true solution
error: cannot find symbol
} else if (slot == com.github.retrooper.packetevents.protocol.player.EquipmentSlot.CHESTPLATE) {
^
symbol: variable CHESTPLATE
location: class EquipmentSlot
Does anyone have any ideas what could be causing this? It was working perfectly fine and suddenly it stopped working, and IntelliJ doesn't give any warnings.
When I try to compile, I get that error.
Did I just do something dumb or something?
Please ping me if you respond
try CHEST_PLATE
Its from PacketEvents, not Spigot
in packetevents (at least in the latest version) it's CHEST_PLATE
in spigot it's just CHEST
jitpack
maybe refresh gradle dependencies 🤷
IntelliJ might not have updated since it was changed recently
I guess invalidating caches didn't work
Yep that worked, thank you!
how do I remove a ItemStack from player's Inventory when its stacked
like more than 1 of the item
item.setAmount(item.getAmount() - 1)
public void onClick(InventoryClickEvent e) {
if (e.getClickedInventory() == null) {
return;
}
if (e.getClickedInventory().getHolder() instanceof SpawnerInventory) {
e.setCancelled(true);
Player player = (Player) e.getWhoClicked();
if (e.getCurrentItem() == null) {
return;
}
if (e.getCurrentItem().getType() == Material.GREEN_WOOL && player.getInventory().containsAtLeast(CaveSpiderSpawner, 1)) {
player.getInventory().remove(CaveSpiderSpawner);
Block block = player.getTargetBlockExact(4);
player.sendMessage(block.getType().name());
CreatureSpawner cs = (CreatureSpawner) block.getState();
cs.setDelay(cs.getDelay() - 1);
cs.setRequiredPlayerRange(cs.getRequiredPlayerRange() + 1);
cs.setMaxNearbyEntities(cs.getMaxNearbyEntities() + 1);
cs.update(true);
player.closeInventory();
}
}
}
}```
how do I use it in my code
I used player.getInventory().remove(CaveSpiderSpawner) which doesnt work
If its a specific ItemStack (including the amount), use Inventory.removeItem()
thankss that worked
Quick question, is having for example 2 PlayerJoinListeners bad practice? should i just have one with all my code in it or does adding another one cause problems?
having separate listeners for separate things for the same event is totally fine
i think all mobs can have armor equipped
i believe so
might not be visible tho
yeah
if (entity instanceof EntityInsentient || entity instanceof EntityArmorStand) { equipment = new CraftEntityEquipment(this); }

Block#getLocation().getX() always returns number like 100.0 right?
not 100.4, 200.54, always 200.0 with one decimal (which is 0) am i right?
dunno
dunno
but if you want the .0 just use the int version
I mean
i dont want
you can also check the javadocs
i wanna know if it returns .0 or not
if it returns an int or a double
I thought that it always rounds to .5 ¯_(ツ)_/¯
getX returns double
Idk, haven't touched it in a while
question is if its .0 or .5
why does it matter?
because some dumb dev "stringified" location like getX + getY + getZ + world name

and i wanna "process" it to convert to something like
getBlockX;getBlockY;getBlockZ;worldname instead
and?
^
or if you so pleased, you could just store the entire Location object
"100.040.01200.0world"
then that looks like your question is answered
wow, wouldnt have imagine it
woah
alonso i dont get what your question was
dude im so confused rn
i guess i'll simply check if it returns .0 always and use some regex or something
breh
to split strings, parse to double/int and then save it again
you couldve just tried it by now
^
why cant you just change the stringify method...?
use the console lmao
make it place a block
just pick a random block in the world and try it
then get the position
fun fact
hoo lee sheet I dont know how to talk
was asking cuz i dont wanted to start the server
bruuuuuuh
yeah, you got the idea
alonso what is the capital of hungary
or one like of terminal
im not good at math
if u + x = 12 then u must be 2 because u are a 10
wait true
this is waht the dev did
return (l.getX() + "." + l.getY() + "." + l.getZ() + l.getWorld().getName()).replace(".", "");
imagine
believe it or not
it returns
98405609850world
omg, this is impossible
nvm, i'll remove old data
¯_(ツ)_/¯
why doesn't that contains . now?
:))
because it replaces . with empty
i tho i could use the point as a reference
butits simply impossible
Cant you just change the system to use like ; or whatever?
yeah, but saved data
i really wanted to convert it to the new format
but since it doesnt even have periods to recognize the numbers
its simply impossible now
Is there no deserialization method?
ofc no
current method is
return (l.getX() + "." + l.getY() + "." + l.getZ() + l.getWorld().getName()).replace(".", "");
Get rid of the replace
if string contains only three zeros
would be possible
but if it contains more than 3
not possible
think is not how to make it look better or work correctly
thing is how to convert data created with that format
into something readable x;y;z;name
as double was used, means that numbers had a .0
so if 98405609850
if will be 984.0 56.0 985.0
does the saved data contain the dots?
What about split(".0")
but if 90405609850
how to know if its 9.0 4056.0 985.0 or 904.0 56.0 985.0 or any possibility
you need to escape the . but yeah
you notice there is no periods there right?
current method saved data like this
Get rid of the replace, I said it before
man
issue is not how to format
is how to transform already created data
into the new format
.
How does that person even use the data wtf
And the main issue is:
if 98405609850
if will be 984.0 56.0 985.0 = easy
but what if 90405609850
how to know if its 9.0 4056.0 985.0 or 904.0 56.0 985.0 or any possibility
i seriously dont know
and i dont even try to understand why would someone even do that xd
there's no way to do that correctly in all cases
that's why I asked the question which you ignored
if more, impossible
Ye, too many posibilities
I think this method is used for saving
Ywell ^
yes
thats the current method
why, man, i ask the same
when i wake up
Search for a reading method, I assume they saved the coords for a reason
yeah, ofc, but why in that way
i mean, there were so many ways
location could have been stored
Thats not your problem
doesn't matter if there's a method to read it, because it will definitely yield wrong results
i wnt to support old data
but i guess it's not possible
if it only had one symbol or sth
Maybe they came with a solution to their stupid idea, Ywell
well there's no correct solution
definitely not this
What are these coords for anyways?
My point is, you dont just store some coordinates, there should be a reason, and also a reading method imo
10101010 if you want a simple example, there are three possibilities what it could mean
see
String getLocationName(Location l) { return (l.getX() + "." + l.getY() + "." + l.getZ() + l.getWorld().getName()).replace(".", ""); }
Is this shit on github?
to save:
that seems stupid.
String name = getLocationName(player.getTargetBlock(null, 25).getLocation());
files.getSaved().get().set("path." + name, delay);
when needed:
Listening to CreatureSpawnEvent:
String name = plugin.getLocationName(spawner.getLocation());
if (plugin.getFiles().getSaved().get().contains("path." + name)) {
Wew
how are you going to retrieve the location from that serialization?
they don't
Man this is fucked up lmao
they simply serialize it the same way
I didn't read the whole conversation. I just thought its your idea xD
Where do you get this from, duh?
Is it a public plugin?
ppl asked for help with it some times
Link?
😦
i made it short -> https://alonsoaliaga.com/thecode
No
don't ask me why i want to understand the code, ok?
Just send the link ffs alonso
let me search what ffs is
shhh
had to close the link after reading the few lines
hahaha
No way

And the real name?
thats the name
Ok
Hey,
So I want to place blocks with a delay but it gives me error when i use runTaskAsynchronious thingy. is there a other way?
you can't place blocks asynchronously
needs to be done on the server thread
(I mean if you go deep enough, you "can" but you're gonna break more stuff than what you're trying to solve)
i mean you can
but if you want to avoid corrupting your world you have to do
- go to another thread (runtaskasync)
- do stuff (if you are doing heavy calculations etc)
- go back to main thread
- place blocks
yeah the actual block placement needs to be on the server thread
chances are the thread switching you are doing is more costly than just doing it on the main thread if you only need a delay with no big calculations
and the fact you need to wait until the 50ms tick period is over for the task to run 
if a BlockBreakEvent has priority LOWEST and in it you .steCancelled(true) and setType(AIR),
if another BlockBreakEvent has priority HIGHEST, it would return getType() == AIR right?
Seems right
So basically, there is no way to know what type it was originally i guess
Where should the variable expansion problem go?
I seriously don't understand the question
i assume they are talking about a placeholderapi expansion so #placeholder-api
Quick question, if you were to make a rank/group plugin and you were to display the rank next to the name everytime they wrote something (anywhere, private chats etc) what would be the best way to do it? Maybe to replace getName() or getDisplayName() somehow?
This doesn't answer your question
but that's really not something you should be doing
it's out of scope for a permissions plugin
it's the job of the chat plugin
your plugin needs to provide a method to get a player's rank, for example through placeholderapi, or through vault
Doesn’t answer my question? What do you mean? Why would i answer my own question?
what I said doesn't answer your question
i was asking if there was a more efficient way of doing it
if i dont wanna use placeholderapi or vault
those were examples
there was a message before the examples, that's what I want you to consider
again it's not a matter of efficiency, moreso that it's out of scope for a permissions plugin to be doing that
there's no question of efficiency in regards to chat
it's not a demanding part of the server
I would prefer not having a method called all the time
why?
Permission plugin stores prefix/suffix/other stuff, and a chat plugin (EssXChat, ChatChat, ChatControl, and about a dozen more) gets them from the permission plugin to put it n chat
there are a lot of methods called all the time
Millions
ONE BILLION
https://paste.helpch.at/mapoloxedi.cs
its not adding the enchantment
ive tried it in another class and it works there(its literally the same way of adding the enchant)
i didnt add the full code because there are alot more lines doing the same thing with another enchants. i know its inefficient
the problem is this item.addUnsafeEnchantment(Pit_Gui.fletching, 3);
stop the count
one TRILLION
I genuinely don’t care about that, it’s about me having to add that method everytime im doing something with the chat.
My question still remains unanswered
Theres no way the only way to do this is through a method like that
Because using getName() on some permission plugins displays the rank but getDisplayName() doesn’t
I really don't understand your issue
Can u read it again then...
@sterile hinge
maybe try setDisplayname
I mean if you "genuinely don't care" and you don't care about compatibility with chat and tab list plugins, Vault and all that, then stop asking for advice and do whatever you want
if you do want to retain compatibility with other plugins so they use your stuff then you gotta do that
i don’t care about using a method everytime im doing something with chat if theres a more sufficient way?
getName and getDisplayName represent different concepts. You should always use the display name if you want to, well, display the name. But including additional information in the display name might result in unexpected behavior
You are adding the enchantments to the ItemStack, but that is later overridden when you call ItemStack#setMeta, use the ItemMeta#addEnchantment with the ignore level restriction boolean parameter instead
getName: the actual name of the player (not changeable through bukkit api)
getDisplayName: the name that is displayed in the chat (this is changeable)
theres my answer i think.
Thank you
Usually display name is for stuff like custom nicknames rather than chat prefix/suffix, because when someone runs /nick it will be replaced
it's almost as if there's a reason permissions plugins dont do this
What do permission plugins do?
permissions
can you explain in a short way just regarding the chat?
.
do they call a method everytime somebody sends a chat?
a "proper" perms plugin doesnt have anything to do with the chat
you'd use something like PAPI to get the player's prefix or whatever and put it in your chat format
I guess i will just go with a method
thanks you are a legend
well im making a permission plugin, but the permissions will also be dependant on the rank they have, so lets say they send a message and their permissionlevel is 4 which is rank owner then i want to display the prefix of owner in chat
okay right
it would be a hell of a lot easier to just use a pre existing chat plugin and hook into that in some way
either through vault or papi or whatever
so you're making both a permissions plugin and a chat plugin combined.
haven't read context but why are you making a perms plugin
that is also a good point
LOL true
in a closed environment basic implementation is easier imho
"everything custom!!"
rather than hooking up third party stuff
nah, but you dont need half the stuff a plugin like luckperms provide
if you only need ranks
still won't hurt to have it
except that it does
remaking all the features of a fully fledged chat plugin is significantly more effort than the few lines of a papi placeholder or vault hook
way easier to maintain
except that it doesn't
then just dont use them? xD
You don't know you need something until you need it
And it's nice to have them there when you do
Rather than having to implement it yourself in your own system from scratch, potentially needing to refactor half the plugin
i would expect someone working on a custom server to at least know what they are building and will be needing
even so, what's the point?
And Hypixel uses WorldEdit too, so they are not custom made?
what do you actually get out of spending hours rewriting something when there's a perfectly good existing solution
Not necessarily talking about LP specifically here
i could understand if LP was really slow or something, but it's not
its more that its a solution you dont need especially in a custom setup
ok, so what? it's still much easier to use that than rewrite your own system
permissions is more of a "i will need to use third party plugins" situation
I want the knowledge
Why are you guys even arguing
imagine not knowing
I asked a question
Is there a way to reset commits on a repo if I've already pushed?
And you got it answered
like... force push?
a simple question: random.nextint(3) is from 0-3?
iirc it's exclusive so no
so its 1-3?
0 to 2







