#help-development
1 messages · Page 668 of 1
No
There's more to it
Knowing every engine and car type won't make you a good driver
I have 2 years of practice if that's what you mean
no
hes saying by knowing the entire bukkit api wont make you a better plugin developer
time making plugins and using the features and learning them as you need will
ticks and 20 is pretty known, I'd say second
hell if I read the documentation I would make a plugin for spawning structures 2 times faster
first one if i was new to bukkit
faster != better
it will go faster but not better
i think
Usually you learn a lot while coding. It's not like I got all my knowledge about best practices by constantly reading documentation and guides
but if there is practice, then it will definitely become better because you already know 50 percent how everything works
I spent a week on the plugin due to ignorance of damn 1 event like so
the most important thing for me is to acquire a certain programming logic, which I think you develop by coding.
But how do you like the idea of taking 1st class at the docks and using it for practice, and so every time until the end?
teach class - practice - teach class - practice
yes, but I'm still a beginner in programming. I'm saying what I think I understand, but maybe that's not it.
Nobody reads the docs, they are not a book lol
Also they are huge. If you think something you currently need could be part of the api, you google and find the docs (or not)
If still unsure you can always ask here
yes, we often understand better when we find forums with people who have already had our questions
I mean most of the time we even answer questions that could be answered if the person typed their question into google.
yeah
do you know if bungeecord has an official doc? is that? https://javadoc.io/doc/net.md-5/bungeecord-api/latest/index.html
?jd-bc
is the same
i have a quesition with serverinfo.senddata. I've been looking for 3 days but I don't understand. serverinfo.senddata() sends a message plugin to all players on the server in question? or a random player on the server?
im trying to use Class#getResourceAsStream but i seem to be unable to actually get to a resource in my jar file. I use this method on my main class which is located in Plugin/src/main/me.athlaeos.plugin. If I want to get a file in my resources folder which is in Plugin/src/main/resources. When I use getResourceAsStream I understand it attempts to find a file within the module the class is located in, and this would be Plugin I understand right? so the path to enter to go to that file in resources should be src/main/resources?
or would the modile in this case be me.athlaeos.plugin in which case i need to go up a folder first
getResourceAsStream("plugin.yml") for src/main/resources/plugin.yml
In the doc ? And in the end it's the same as taking the first player from a server and sending it to senddata?
what do you mean with clean build? like remove targets?
getResourceAsStream("/skills/smithing.yml")
any reason for not using JavaPlugin#getResource also
it will queue if no players are currently online
np
not really its just what came up
Is it possible to send a Packet to the player that only plays the effect of an explosion but not the sound? (1.20)
isn't the effect just a particle?
I think
there's spawnParticles for that
Player#spawnParticle will display particles to only that player yeah
or do you want it to do damage and do knockback also
so just an explosion minus the sound
Oh i must think more simple. xD I try it.
how to clear player's server resourcepack?
With player#senddata it's not possible to queue? in the parameters of the event function(onpluginmessagerecieve) the player will also be accessible even if it has been chosen with serverinfo#senddata?
the NMS Explosion class has a method finalizeExplosion(boolean) that, when the boolean is false, does not play any sound
but bukkit doesn't seem to have a method for that
nvm I am stupid
what the heck is Level.isClientSide
Does the packet get send to the server or only to the client? I think to the client because of Clientbound
Single player world stuff
when you're running a singleplayer world it creates an internal server
and sets that to true for some special special checks
just spawn particles with either EXPLOSION_HUGE or EXPLOSION_LARGE or EXPLOSION_NORMAL.
weird, what special checks does it need lol
count is 1, the offsets are all 0
I think there's some client-sided preditions that the client does
Like this for shears
weird optimizations or it'd look clunky with predictions
There's also a class for debugging that's just left empty on the server
yeah well but if the client "predicts" the explosion on a normal server, why not just also let the client "predict" it for the builtin server
network latency perhaps?
Particle.EXPLOSION_LARGE and Particle.EXPLOSION_HUGE are the only 2 particles that work. The other is a small cloud. Idk why.
vanilla uses HUGE for explosions greater than 2.0, otherwise it uses LARGE btw
wa
But what is normal, I never saw an effect like this in vanilla.
"normal" explosion seems to be used when a living entity spawns lol
or when an entity steps on turtle eggs lol
I test it
that's from PathfinderGoalRemoveBLock
idk where the "eggs" part comes from, I only read that in the craftbukkit comment
Must there be an other Entity as the player that steps on the egg?
found it - the zombie is the only entity that uses this goal, and they are having TURTLE_EGG in the constructor for that pathfinder goal
so it seems like zombies walk to turtle eggs on purpose and destroy them lol
i didnt know that
yeah they attract zombies
Ah i heard about it that the Zombie has this pathfinder goal from an youtuber.
or, well, the other way around I guess lol
what do zombies have against turtles
Ah i see, but it is a very low chance that this effect appears. I think only by the last egg.
small
They are both green haha
true
This effect seams that they have a 10% chance to spawn this particles.
Is it fine to name a main class Main (standalone application) lol
But they only hate the eggs not the turtle self.
sure
i'm looking for a public repository to host my apis, which one is the best?
I have seen many turtles in my life but i never saw a turtle egg tbh
central?
Maybe i‘d also step on it
I think, sometimes i use Main as my main class name and sometimes the application name.
Central
haha
Application name is already used as class name
Than should Main be fine.
I only ever use (AppName)Application lol instead of main
or plugins I do (PluginName)Plugin
I think I definitely should don't say anything about this, I name my implementation classes all "CraftX" where X stands for the object.
I usually use Spigot if I have to do something really close to server level
Spigot(Implementation)
This is also a good idea.
CraftEvil
CraftMine
CraftCraft
CraftCraftingTable implements CraftingTable
can you ever craft enough
can you?
can you ever cast enough
never
1.5s
I heard you people like casts #help-development message
wtf
this debug?
Ye
code debug?
tell me how you can get a specific block in the dungeon in AsyncStructureSpawnEvent. Relative what
public class Bone {
private Vector start;
private Vector end;
private double length;
public Bone(Vector start,Vector end ,double length){
this.end = end;
this.start = start;
this.length = length;
}
public void moveTo(Vector target){
double distance = target.distance(start)-length;
end = target.clone().subtract(start).normalize().multiply(distance);
}
public Vector direction(){
return end.subtract(start);
}
public Vector getStart() {
return start;
}
public Vector getEnd() {
return end;
}
public void apply(BlockDisplay disp){
Transformation transformation = new Transformation(
disp.getTransformation().getTranslation(),
disp.getTransformation().getLeftRotation(),
new Vector3f(1.0f, (float) this.length, 1.0f),
disp.getTransformation().getRightRotation()
);
disp.setTransformation(transformation);
disp.teleport(disp.getLocation().clone().setDirection(direction()));
}
public BlockDisplay summon(World world){
Location loc = start.toLocation(world);
BlockDisplay disp = loc.getWorld().spawn(loc, BlockDisplay.class);
Transformation transformation = new Transformation(
disp.getTransformation().getTranslation(),
disp.getTransformation().getLeftRotation(),
new Vector3f(1.0f, (float) this.length, 1.0f),
disp.getTransformation().getRightRotation()
);
disp.setTransformation(transformation);
disp.teleport(disp.getLocation().clone().setDirection(direction()));
return disp;
}
}
``` when i use apply(BlockDisplay) it throws IllegalArgumentException (pith not finite) how do i fix it?
how is a bone a block dispaly
pitch not finite means the vector is infinitely long
so your math is weird
Probably a divide by zero somewhere
the only math is here```java
public void moveTo(Vector target){
double distance = target.distance(start)-length;
end = target.clone().subtract(start).normalize().multiply(distance);
}
public Vector direction(){
return end.subtract(start);
}
public static HashMap<UUID, List<Bone>> boneMap = new HashMap<>();
public static HashMap<Bone, BlockDisplay> displays = new HashMap<>();
@EventHandler
public void onMove(PlayerMoveEvent evt){
final UUID uid = evt.getPlayer().getUniqueId();
final Player pl = evt.getPlayer();
if (!boneMap.containsKey(uid)){
List<Bone> bones = new ArrayList<>();
for (int i = 0; i <5; i++){
bones.add(new Bone(pl.getLocation().toVector(), pl.getLocation().toVector(), 5));
}
boneMap.put(uid, bones);
for (Bone bone: boneMap.get(uid)){
displays.put(bone, bone.summon(pl.getWorld()));
}
}
for (int i = boneMap.get(uid).size()-2; i>=0; i--){
Bone bone = boneMap.get(uid).get(i);
BlockDisplay display = displays.get(bone);
if (i==boneMap.get(uid).size()-2){
bone.moveTo(pl.getLocation().toVector());
} else {
bone.moveTo(boneMap.get(uid).get(i+1).getStart());
bone.apply(display);
}
}
}
``` maybe math is weird here?
https://www.spigotmc.org/threads/x-is-not-finite.462496/
Probably when you normalize()
if the magnitude is 0 then normalise throws that error
hello
fleet :steamhappy:
are you not extending JavaPlugin?
I heard Fleet's diagnostic is a bit scuffed
fleet was completely useless garbage when I last tried it, but that was months ago
Such as showing errors where there shouldn't be
the javaplugin part is also red
it compiles just fine lol
are you using maven or just a jar?
than IJ cant decompile the dependency
amven
i cant even import fileconfiguratio
fleet is just bad
im gonna have to switch back to eclipse
i just want to move away from eclipse and intellij
How to hide or remove command like /plugin-name:command
And leave only /command?
ill probably test out vs
did u reload pom?
try netbeans
the ui is a lot like eclipse
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerCommandSendEvent.html remove all commands you don't want
declaration: package: org.bukkit.event.player, class: PlayerCommandSendEvent
Oh ok thanks
the player will still be able to execute them right?
you would have to listen for commands if you want to disable that as well
I just want to disable tab completion of commands like /pluginname:command
ok
yes
What's wrong with intelij idea?
try IntelliJ without the minecraft development plugin
i like having multiple projects on in the same window and intellij bsods me sometimes
i uninstalled it
pretty sure i was still crashing
huh but IJ can do that
I would love fle eclipses file system in intellij
idk im just tired of ij a bit
IJ can open different projects in one window
but weridly only when it's on fullscreen
When i was trying to do something with Eclipse it was too uncomfortable..
eclipse's ui is ass
yeah but IJ's new UI is also shit
But we don't have any replacement except intelij idea & eclipse
ij is a grey spot in my mind so i cant comment
i wonder right now, does java prehash records so that hashcode() would return the same hash code internally without having it to compute everytime
no i actually like it
seems like a cheap way to optimize hash based objects
i wish eclipse just commissioned better icons
It takes up much more space and many useful buttons are gone
you have to hover over everything to get a vague idea on what it does
shortcuts for life
when hand eye coordination at 5am fails on you
its good wtf
Haha it would be great if eclipse would add custom themes
i dont get the hate for new ui
the only thing i dont like in new ui is this glint
you went from seeing 70 classes to 60 or something right?
compact mode exists
he talked about that too
Still waste of space
why dont you put your whole desktop with icons
Thats just one thing. The whole top bar is unused
its a waste of space right?
i prefer new ui since you could easily more focus on the code
new ui better
Yeah thats nice
tell me did you used all those buttons
i dont know what any of those buttons do
that were provided there
i prefer context menus, at least they tell me what they briefly do
No, but some. Now they are all gone
not all of them
all this is useless. I mean, why don't they at least get rid of this bar completely then
the editor window could at least be bigger then
now it just displays a completely empty thing
where is that?
there is neither a push nor a pull button in that menu
they have moved it into the menu at the top so you now need an extra click. and it's also the only useful button in that whole unused bar at the top
why are you not using maven or gradle?
and where's your plugin.yml
i hate eclipse mostly because i just click a random button and my project explorer, problems or something else just disappears and i have to spend a few minutes clicking random buttons for it to reappear
Is that not a pull button on the left
you should use maven, otherwise nobody can clone your project without manually setting up a thousand things
no, that's "Update selected" and it's always greyed out
what does jeff-media do
oh
yea you should use either maven or gradle, since those can store your build setup for the next contributor or cloner
pay corporate taxes
trust me its better than what i've saw here before 😄
i will apply to work at jeff-media when i turn 18
we're already full
will you still be full in 3 years?
how so
those bordered white edges literally makes my eyes out of focus
huh
ultrawide issue
idk I didnt make that website lol
yeah well but I didnt do the website
the blog uses a bought theme
those are fine
idk if the main website theme is also bought or whether one of the other dudes made it
it just not comfortable to focus
all I remember is that the blog theme costed like 100€
grayish borders would be better imo
if I could decide, the blog wouldn't even use dark mode
visit the blog again now
this is how I'd make it look
i never understood why everyone is so obsessed with dark mode lol
if your brightness is at 100 and you hate the sun then dark mode is fantastic
how to place features with spigot like /place feature birch?
what features are there? for trees there's World#generateTree
use spigot api
oh thank you
hey i have a little question, i'm developing a minigame server and i'm on bedwars and skywars i had a question the best is to make a world by map with multiverse core or everything on the same one and best for optimization ?
each map is new server
javasockets
bungee cord
The plugins do it basic to the configuration of a map?
use java sockets or whatever for communication
ok thanks i will look into this
also nats but sockets are built in java
If you wanna scale on it def use a more sophisticated service like rabbit or kafka
how would i go about changing a user's skin? cant find any tutorials on it or gameprofiles online
doesnt really sound like something you can do easily if at all
the player info packet includes the skin
it won't work for yourself, ofc
and you'll need signed texture data
so yeah ClientboundPlayerInfoPacket is what you'll need I guess
/skin notch
is playerconnectionvar.a() the correct syntax for sending packets
no
the correct way is Connection#send(Packet<?>)
yeah I'd rather change my underwear than using obfuscated mappings
im confused, connection.send() doesnt exist?
I keep getting this god damn warning
[13:12:05 WARN]: Nag author(s): '[SnowzNZ]' of 'SnowReports v1.1' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
Use in my code:
getLogger().info("Discord Integration is enabled but webhook-url is not set!");
?nms
if it doesn't exist, that means you're not using mojang mappings, although you should
paper issue
it didnt use to happen
it will not happen on spigot
you're using paper
anyway, what is getLogger()? your plugin's logger?
org.bukkit.plugin.java.JavaPlugin getLogger()
idk then. but as said, this message is from paper, not spigot
You should be able to see the sysout message right above it
Theres nothing
just some debugging stuff for sqlite which im not using getLogger for
🤦♂️ thats why
We need a rubber duck emoji

fuck ducks only coconuts 🥥
no don't fuck ducks
but coconuts better
reddit reference
"and then it runs the next line of code"
"and then it should work"
how much wood
Kills: 1, Kills: %kills%, Kills: %kills%, Kills: %kills%, Kills: %kills%, Deaths: %deaths%, Deaths: 5, Deaths: %deaths%, Deaths: %deaths%, Deaths: %deaths%, Streak: %streak%, Streak: %streak%, Streak: 0, Streak: %streak%, Streak: %streak%, Gems: %gems%, Gems: %gems%, Gems: %gems%, Gems: 3, Gems: %gems%, Combat: %timer%, Combat: %timer%, Combat: %timer%, Combat: %timer%, Combat: 0 thats the output, why does it duplicate it so much?
also tell me if there is a better way to do this
you loop over all lines and then add 5 lines everytime
for(String line : translatedLines) {
linesWithStats.add(
line.replace("%kills%", kills)
.replace("%deaths%", deaths)
.replace("%whatever%", whatever)
);
}
sth like this
hi
any idea why when I serialize a item stack to byte array and then deserialized it back to a itemstack it changes the lore?
i will do that but i meant a better way to do the whole method
how do you serialize it?
code
sec
byte[] serialized = player.getInventory().getItemInMainHand().serializeAsBytes();
just adds it sqlite db for later use
uh oh
yea
anyways
how do you do it?
try {
ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(base64));
BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream);
ItemStack[] items = new ItemStack[dataInput.readInt()];
for (int i = 0; i < items.length; i++) {
items[i] = (ItemStack) dataInput.readObject();
}
dataInput.close();
this.items = items;
} catch (ClassNotFoundException | IOException e) {
e.printStackTrace();
this.items = null;
}```
serialize ^
i need byte arrays 😦
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);
dataOutput.writeInt(items.length);
for (ItemStack item : items) {
dataOutput.writeObject(item);
}
dataOutput.close();
return Base64Coder.encodeLines(outputStream.toByteArray());
} catch (Exception e) {
e.printStackTrace();
return null;
}```
uh
remove the base64 stuff
oh yeah
do i have image perms here?
swag
you need to verify
you can use imgur
ight sec
so thats the item before serialization
then thats after its been retreived from the database
paper issue
yea figured
rs = LobbyManager.sqlCon.createStatement().executeQuery("USE Players; SELECT Lang FROM 'PlayerData' WHERE UUID = '?';");
How could I replace the ? with a string
does paper have a bug report?
ight appreciate the help.
preparedStatement.setString(1, uuid.toString());
tyvm
dont use paper api for development
simplest and easiest fix
duly noted
how do I get a prepared statement from a connection?
does anyone know how i would create an effect similar to how the treecapitator works on hypixel skyblock: where if i mine a block it will iterate over the connected blocks of the same type and break them
Flood fill
try (PreparedStatement preparedStatement = connection.prepareStatement("USE Players; SELECT Lang FROM 'PlayerData' WHERE UUID = '?';")) {
}
.
what's the correct repository for remapped mojang
this works
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
this doesn't work
``` <dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>```
tyvm
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
uh
If you need to access NMS classes from inside your Spigot plugin, it is a very good idea to use the so called Mojang mappings. Disclaimer: This post is obviously written for 1.18.2. If you use another version, you of course have to replace every occurance of “1.18.2” with the version you actually use. What...
PreparedStatement preparedStatement = LobbyManager.sqlCon.prepareStatement("USE Players; SELECT Lang FROM 'PlayerData' WHERE UUID = ?;");
preparedStatement.setString(0, playerUUID.toString());
Cannot resolve query parameter '0'
Cannot resolve query parameter '1'
remove use players;
Is there a way I can add custom items to loot chests for a specific structure?
Using ChunkPopulateEvent perhaps?
Or is there a way I can just eedit the loottables of a specific strucutre via a plugin
LootGenerateEvent
Is there a way I can check for the name of said loottable?
Get the loot table and then get its Namespaced key
Awesome, ty!
why, when using remapped mojang, does nms not work?
?nms
follow this tutorial to use nms
https://paste.md-5.net/lomebihano.sql
public static String getMessage(UUID playerUUID) { String language = null; ResultSet rs = null; try { PreparedStatement preparedStatement = LobbyManager.sqlCon.prepareStatement("SELECT Lang FROM PlayerData WHERE UUID = ?"); preparedStatement.setString(1, playerUUID.toString()); while (rs.next()) { language = rs.getString("Lang"); } return language; } catch (SQLException e) { throw new RuntimeException(e); } }
why is language null?
followed it but still cant get nms to work with remapped mojang
Use try-with-resources, i don't see your execute statement, rs is null.
https://paste.md-5.net/equxetediz.xml
org.spigotmc:spigot🫙remapped-mojang:1.20.1-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
Try to run Maven import with -U flag (force update snapshots)
what errors
you need to run build tools
?bt
remapped mojang builds fine but i get errors like
[ERROR] symbol: class PlayerConnection
[ERROR] location: package net.minecraft.server.network``` as i can't access net.minecrat.server anymore
reload your intellij maven project
show your pomxml
use java 17 first off
its just a nickpick, but you should be using java 17 with later minecraft versions
why do you need mojang auth lib?
also you sohuld beable to just reload your project and it should work
uhh gameprofile and properties
for skulls?
spigot has PlayerProfile API now
oh
declaration: package: org.bukkit.profile, interface: PlayerProfile
though for your actual issue you might need to reload your project
if that doesn't work invalidate caches
bump
what command did you use to run buildtools
java -jar BuildTools.jar --rev 1.20.1
are you trying to make remapped or just create a server jar
remapped
you need the remapped flag
the gui will be easier for you one second
delete all old BuildTools related folders created from past runs
download that jar file
tyvm
select you're version from the drop down
in options tab click generate remapped jars
go back to general and click compile then wait. A menu will popup when build tools has finished
thank you so much lol
did you delete all BuildTools related directories as I said
etc Work, Spgiot, BuildData, Bukkit, CraftBukkit, build etc
no
alr
nms is back to not working? was fine for a minute or two and then just broke
close the gui before you do that then reopen
Intellij is so fucky sometimes just keep trying to invalidate caches make sure you're using java 17 and on latest spigot, not depending on spigot api on top of the server jar
alr its loading
do i change 1.8 to 1.17 in the pom.xml?
just 17
mb yea 17
?jd-s
im pretty sure it needs at least location float
you should probably learn java
you need to specify the blast power
or atleast learn how to utilize your IDE properly
💀
Is there an event that triggers when a player loads in a chunk already loaded? What I mean is, for example, if player B was in a loaded chunk, and player A just got the chunk in their render distance. Is there a way to efficiently detect when a player gets a new chunk sent to the client?
are you suuuure you know how to read javadocs
declaration: package: org.bukkit, interface: World
this is the exact sort of thing javadocs could have helped with
that too
this is the second day in a row you have suffered from a javadocs solvable issue
unsure, i keep trying and after restarting i have to wait for like a minute before it updates and then nms doesnt work
do you get any errors from maven
oh god not again
nah its chill im kiddin
but yeah if you are confused about how to get info from a class
or how to run a method
just nms not existing. none from maven
or what params it needs
javadocs coulda helped with knowing how to get the damage cause yesterday and what parameters you needed just now
try removing the spigot repository and reloading your maven projectg you don't need that repository anymore
pls use them before asking here from now on lol
close and reopen
oh okay, so no repositories?
still nothing changes
after restarting intellij?
yea
wait send your dependencies
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
</dependencies>```
https://imgtr.ee/image/bcM7j is there a better way to do this? I recall you can make a list or two lists, and one list says the block the other list says how much it increases the double.
are you sure you have no maven errors
when reloading
the project
rebuilding or reopening?
switch statement
reload ur maven
I will google, thank you
Does anyone know of good resources for listening to packets sent out from the server? The problem is I need to use the mojang remappings.
i don't think so?
did you build 1.20.1 with buildtools?
yep
and you reloaded and have no errors
i don't get any maven errors, just project errors
and you closed and reopened intellij and it sfill doesnt show
This tutorial works with the mojang remappings?
the channel duplex handler is the same
switch statement isnt what i remember but its more neat than what I am doing so i will use it instead. Thanks!
the other stuff might not be now that i think abt it
ill send you an example from my own ckde
still doesnt work
public class Glowing {
private final JavaPlugin plugin;
private final HashMap<UUID, PacketListener> listenerMap = new HashMap<>();
public Glowing(JavaPlugin plugin) {
this.plugin = plugin;
}
public void glow(Player user, Player badGuy){
PacketListener listener = listenerMap.get(user.getUniqueId());
if (listener == null) {return;}
listener.addGlowing(badGuy);
ServerPlayer itemUser = ((CraftPlayer)user).getHandle();
ServerPlayer badBoi = ((CraftPlayer)badGuy).getHandle();
badBoi.getEntityData().refresh(itemUser);
new BukkitRunnable() {
@Override
public void run() {
listener.removeGlowing(badGuy);
badBoi.getEntityData().refresh(itemUser);
}
}.runTaskLater(plugin, 100);
}
public void startListener(Player p) {
PacketListener handler = new PacketListener();
listenerMap.put(p.getUniqueId(), handler);
((CraftPlayer)p).getHandle().connection.connection.channel.
pipeline().addBefore("packet_handler", p.getName() + "-skyglow", handler);
}
public void stopListener(Player p) {
listenerMap.remove(p.getUniqueId());
Channel channel = ((CraftPlayer)p).getHandle().connection.connection.channel;
channel.eventLoop().submit(() -> channel.pipeline().remove(p.getName()+"-skyglow"));
}
}
obviously it wont do the exact thing u want rn
but you can sorta see whats goin on
public class PacketListener extends ChannelDuplexHandler {
private final HashSet<Integer> players = new HashSet<>();
public void addGlowing(Player p) {
players.add(((CraftPlayer)p).getHandle().getId());
}
public void removeGlowing(Player p) {
players.remove(((CraftPlayer)p).getHandle().getId());
}
@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
if (!(msg instanceof ClientboundSetEntityDataPacket packet)) {super.write(ctx, msg, promise); return;}
if (!players.contains(packet.id())) {super.write(ctx, msg, promise); return;}
List<SynchedEntityData.DataValue<?>> values = packet.packedItems();
byte bitMask = 0;
boolean adjusted = false;
for (Iterator<SynchedEntityData.DataValue<?>> it = values.iterator(); it.hasNext(); ) {
SynchedEntityData.DataValue<?> value = it.next();
if (value.id() != 0) {continue;}
bitMask = (byte) value.value();
bitMask |= 0x40;
it.remove();
adjusted = true;
break;
}
if (adjusted) {values.add(new SynchedEntityData.DataValue<>(0, EntityDataSerializers.BYTE, bitMask));}
super.write(ctx, msg, promise);
}
}
the listener itself
the startlistener, stoplistener, and the packetlistener is the important stuff
sorry for text wall
https://paste.md-5.net/leqehiquce.coffeescript
this is not affecting my compile I just want to know what this means
it means that multiple jars have a manifest.mf
and its only gonna use one
for spigot plugins it basically means nothing
how can I remove the warning though? its annoying
well the manifest.mf
means nothing
the other stuff could possibly be more concerning
Thanks so much! I’ll take a look at the code
you should relocate your dependencies
so that they dont overlap
if you want to know what the code overall does, when the glow is called it makes the second player glow for the first player for 5 seconds
not sure if that helps you but overall again the main thing you really need to understand is the ChannelDuplexHandler and the start/stop listener code
i will say my handler only uses "write" so only when a packet is sent does it detect it
for incoming packets use the "channelRead" method
similar overall concept in that case where you can use instanceof to differenciate and act on it
the reason i call super.write before returning in all the spots where i return is if you return WITHOUT calling that it wont actually write the packet
same thing for super.channelRead if you are reading packets, the server will basically not know the packets exist if you return without calling super.channelRead
where do i go from here
is it still not working
what exact command did you run in buildtools
java -jar BuildTools.jar --rev 1.20.1 --remapped
did you watch the guide i sent you rye?
this is frustrating
yeah im sorry idfk i have actually no clue this all seems legit
you set the result set to null and then tried to use it
yea i got remapped to work except i couldn't get nms to work
preparedStatement.executeQuery(); returns result set pretty sure
wdym by couldnt get nms to work
alr and then what about setmessage
nms just doesnt work
what are you trying to do?
set args[0] to the string in sql
stuff like import net.minecraft.server.network.PlayerConnection;
i dont think that that's mojang's mappings
can you put import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
in your imports
okay the set works but the get doesnt
public static String getMessage(UUID playerUUID) {
String language = null;
try {
PreparedStatement preparedStatement = LobbyManager.sqlCon.prepareStatement("SELECT Lang FROM PlayerData WHERE UUID = ?");
preparedStatement.setString(1, playerUUID.toString());
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
language = rs.getString("Lang");
}
return language;
} catch (SQLException e) {
throw new RuntimeException(e);
}
}```
i thought the issue was seeing nothing in autocomplete
yea i already had that imported
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalArgumentException: message cannot be null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer.sendRawMessage(CraftPlayer.java:317) ~[paper-1.20.1.jar:git-Paper-108]
at org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer.sendRawMessage(CraftPlayer.java:312) ~[paper-1.20.1.jar:git-Paper-108]
at org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer.sendMessage(CraftPlayer.java:329) ~[paper-1.20.1.jar:git-Paper-108]
at me.lobbymanager.commands.testcmd.onCommand(testcmd.java:29) ~[Lobbymanager-1.1.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
... 23 more
does it work
maybe intellij isnt set to your local maven repository
public```
have you considered that maybe no lang exists with that uuid
it does
are you suuuuure
where should it be set to?
can you send the full pertinent code
where does buildtools install your spigot jar
So what I’m gathering is in the ChannelDuplexHandler class, I use the overridden method write to view packets to be sent out. I can check the packet type using instanceOf, and if it meets criteria, edit it. My goal is to change blocks in a chunk sent out. Which packet should I use with mojang remappings? ClientboundLevelChunkWithLightPacket?
in the main plugin folder
@wary topaz i suggest using completablefutures if you are going to be saving to mysql while there are players online
huh?
sounds abt right
why?
alternatively run it async with bukkit scheduler
why not run it on a new thread?
bro
why use a thread lol
what
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class LobbyManager {
private static Executor databaseExecutor = LobbyManager.sql
public static java.sql.Connection sqlCon;
public static CompletableFuture<String> getMessage(UUID playerUUID) {
return CompletableFuture.supplyAsync(() -> {
String language = null;
try {
PreparedStatement preparedStatement = sqlCon.prepareStatement("SELECT Lang FROM PlayerData WHERE UUID = ?");
preparedStatement.setString(1, playerUUID.toString());
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
language = rs.getString("Lang");
}
return language;
} catch (SQLException e) {
throw new RuntimeException(e);
}
}, databaseExecutor);
}
public static CompletableFuture<Void> setMessage(UUID playerUUID, String msg) {
return CompletableFuture.runAsync(() -> {
try {
PreparedStatement preparedStatement = sqlCon.prepareStatement("UPDATE PlayerData SET Lang = ? WHERE PlayerData.UUID = ?");
preparedStatement.setString(1, msg);
preparedStatement.setString(2, playerUUID.toString());
preparedStatement.execute();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}, databaseExecutor);
}
}
dont shorten language to lang
why not?
there is literally no reason to shorten it other to confuse other people
bukkit cant return valuest outside the runnable
oh
i dont use mysql sorry
ohhhhhh
but its still supposed to be lowercase
still works for some cases though
i think you're lying
wtf rude

Why would I lie 🥺
help
hence alternatively
they both work
where should it be installing the jar? i think it might be working now? but it does not have stuff like playerconnection.
Message.getMessage(player.getUniqueId()).thenAccept(player::sendMessage);
buildtools says where it installs it when you run it im pretty sure
so does it not matter where it's installed?
what
Message.getMessage(player.getUniqueId()).thenAccept(player::sendMessage);
why it doing this
im not getting any message sent
you were talking about my local maven repository and then asked where my buildtools spigotjar was located
buildtools puts a jar in a maven repository
if your intellij isnt set to that maven repository then it wont work
CompletableFutures like to do this thing where it eats exceptions
thenAccept() just won't run if an exception is thrown and nothing will be shown to console. I suggest using whenComplete() if you want to handle the error
Message.getMessage(player.getUniqueId()).whenComplete((language, e) -> {
if (e != null) {
e.printStackTrace();
return;
}
player.sendMessage(language);
});```
You might just have some malformed SQL or something and it's being hidden by your CF
please
nms is working but i don't have things PlayerConnection
that's spigot mappings named
version: 1.20.1, hash: d908ed1f24
you'd be looking for using ServerGamePacketListenerImpl
you can obtain it by getting ServerPlayer using CraftPlayer#getHandle() then using ServerPlayer#connection
oooh, alright, and then i have the .send() to send packets. tysm!
How can I convert a chunk to a LevelChunk?
most bukkit classes have handles
whether they are exposed or not
Chunk -> CraftChunk which has a handle for LevelChunk
usually the handle is in a #getHandle method
there are some weird cases where some bukkit classes don't always have to be their Craft equivalent, this is common with ItemStacks so just be aware
In 1.20, craftChunk#getHandle() takes an argument ”ChunkStatus”. What should I put? ChunkStatus.FULL?
I was making a PR i'll see since I have my IDE open this time
my best guess is the entire chunk
fuck around with it tbh
I did ChunkStatus.FULL
And it works in the past
not sure what you are trying to do but I believe it accesses the full chunk as opposed to chunk columns maybe??
Thats what I would guess
grid of sand
tbh from the looks of it you can retrieve specific features from the chunk with this filter
ChunkStatus.BIOMES, ChunkStatus.STRUCTURES
ClientboundLevelChunkWithLightPacket is the packet to send chunk blocks right?
yes
ohhh fake blocks are fun :P
I wrote an entire system for tehem
you can do some pretty crazy stuff with fake blocks
I believe Illusion has a pretty good fakeblock thing that he made
I was making a per player prison mine system all in the same error
Alright. My end goal is to listen for said packet, and edit the blocks. How can I do this?
that's cool
but I had soem issues with concurrency and the way I handled stuff (Using packet events)
gh? or priv
you'll have to inject into the netty listener I've never done this so no clues
PacketEvents is real nice
you'd have to ask usually his stuff is priv for work
oh yeah I forget about them even though retrooper made it
I'd prob use PacketEvents if I ever did have to do that stuff
Can I use ChannelDuplexHandler?
Wdym
like use protocollib or packet events if u are trying to ujse packets
trying to set the player's skin with playerprofiles. when i execute this, the first time i got. there are no errors but i can visibily see on tab i was removed, but i don't get added back.
ServerPlayer plyr = ((CraftPlayer)player).getHandle();
plyr.connection.send(new ClientboundPlayerInfoRemovePacket(List.of(((CraftPlayer)player).getUniqueId())));
profile.getTextures().setSkin(new URL("http://textures.minecraft.net/texture/b3fbd454b599df593f57101bfca34e67d292a8861213d2202bb575da7fd091ac"));
plyr.connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, plyr));```
This is a really weird way, but what if I get the X and Y of the chunk in the packet to be sent. Then I get the chunk from the world, provided the coordinates, and copy it, then edit the contents. Afterwards, I create a new packet with the updated chunk. Does this seem like a good way?
you'll probably need to also send an EntityDataPacket
is it good practice to specify a default when getting a value from the config? e.g
config.getString("discord-integration.embed.title", "Report")
edited it to this
GameProfile profile = plyr.getGameProfile();
plyr.connection.send(new ClientboundPlayerInfoRemovePacket(List.of(player.getUniqueId())));
profile.getProperties().removeAll("textures");
profile.getProperties().put("textures", getSkin());
plyr.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(plyr)));```
the skin changes on the tab, but i have to relog on other accounts for the actual skin to update. and the skin never updates on the account im changing the skin of. what would i have to do to fix this so it auto updates for everyone?
you have to send the update to all players
for (Player otherPlayer : Bukkit.getOnlinePlayers()) {
ServerGamePacketListenerImpl connection = ((ServerPlayer) NMSUtils.getServerPlayer(otherPlayer)).connection;
connection.send(playerInfoRemove);
connection.send(playerInfoAdd);
if (player != otherPlayer) {
connection.send(new ClientboundRemoveEntitiesPacket(serverPlayer.getId()));
connection.send(new ClientboundAddPlayerPacket(serverPlayer));
}
connection.send(setEntityData); // dual layered skin.
}```
i have to send both of the packets to all players?
anything can be a command sender right?
pretty sure that's how entities work internally
it works tysm, i'm going to assume it's not possible for the player to see their own skin change?
yes they can
you have to send a respawn packet to the player for their own skin
you have to do a few things to perform a skin change
things like inventory and op break
?paste
tysm, almost done, but i'm getting an error on my respawnpacket
plyr.getCommandSenderWorld().dimensionTypeId(),
plyr.getCommandSenderWorld().dimension(),
plyr.getCommandSenderWorld().getWorld().getSeed(),
plyr.gameMode.getGameModeForPlayer(),
plyr.gameMode.getPreviousGameModeForPlayer(),
plyr.isReducedDebugInfo(),
isFlat,
(byte) 1,
plyr.getLastDeathLocation()));```
it matches the constructor so i don't know why it's saying cannot resolve constructor
how do i work hibernate with hikaricp ?
Thats what I do
I store a map of the Players UUID and then a map of Location Block
is Bukkit.getworld case sensitive?
all worlds are indexed to lowercase
i put "World" inside bukkit.getworld not "world" is that my problem
probably not
Errors on a diff line guessing it didnt compile right
it shoudl lower case for searching
Or you forgot to compile
how do i make it compile right
i didnt
i saved
maven package
3 times
clean then build again
Decompile it and see what the code looks like
i did that
omg im stupid
i compiled the wrong project
Lol
hi bro do u know hibernate ?
is hibernate also a connection pool?
am i need hikaricp ?
how long is 180000l?
I assume that's in ticks. So: 180_000 ticks / 20 = 9_000 seconds
Since there are 20 ticks in a second
Okay so it was right 15 minutes just seems like forever because I'm tired. I celebrated making the presidents list by finishing the project I was working on on Minecraft... Everything works just... It takes a minute
Hibernate is caching, nothing related to connection pools
so am i need add hikari to hibernate cfg ?
hibernate has cfg file
and it hosts my database username and password
Hikari should support hibernate out the box
Theres a special class you need to use iirc
actually i ask chatgpt
and showed
btw i can't import
sessionfactory
at new versions
why =
what api can be used for mysql to make it convenient? Is there a popular optimized api?
jooq is pretty nice
database access shouldnt be on server thread anyways
so it shouldnt affect the server speed that much
need to spend a lot of time
never had issues with jdbc personally but to each their own ig
the problem is not in the JBDC itself, but in the fact that it takes a long time to write requests and is cumbersome
cumbersome
I have 1 database class takes an hour while writing code
oh well could just be that im not exactly a sql magician anyways so havent done any crazy fancy requests
(hikari)
pool?
hikari is responsible for pooling SQL connections
so you don't open and close them all the time
but properly reuse them
JOOQ is a helper utility for writing the SQL
how to place a villager house to a location?
worldguard API + schematic
Something im trying fixing
Event: https://paste.md-5.net/amaceyeyir.cs
runner: https://paste.md-5.net/woruqipoqu.cs
This code is used for checking a pickaxe and giving it the correct EXP so like a leveling system but showing on the bar for checking i used the PlayerLevelChangeEvent, the problem comes when I'm switching when i switch from something i have my EXP (40LVL) but in the pickaxe, i have 2 levels so my plugin gives the reward and everything to the other user
(Fixed)
extracted structures from minecraft 1.20.1 jar and i'Ll load them
i dont understood platte in Structure.place
ok thank you
what is the name of the section of Spring working with the database and what dependencies are needed?
Hibernate?
ahaha
just a question, i imported the vault api and then "cannot find symbol" just appeared, its not only in the Vault Api but on class inside the project like other classes im trying to import (im using intellij last Ultimate)
and there are jigsaw blocks
did u import the jar file?
no obv
im gonna hope maven or gradle
you get air location?
maven
thats how loot tables are generated
reload maven and wait a minute
seems to not fix it
here
cannot find symbol is showing on classes inside the project so i don't think the pom is really giving problems
because importing it works fine
invalidate caches and restart
jitpack isnt down if invalidating caches didnt work no idea what the issue is
ok intellij is strange
if i import it calling the main class it works but calling it with import static no (im using lombok)
wtf
ok it works, so wtf happened is strange but thanks it works
How can i remove all players from a luckperms group?
Hey can anyone make a plugin lien I wanted not custom you can put in on your spigotmc page
Hey there! I'm making a command that summons an entity but cant find anything on how to do that.
can somebody please help explain how I can set the type of entity?
Creeper creeper = world.spawn(location, Creeper.class);
if you need to modify the creeper use the consumer method
yup
Creeper creeper = world.spawn(location, Creeper.class, creeper -> {
creeper.doStuffHere();
});
it'll set before it is spawned
so you don't see the changes happening
why does this code not work? when i right click no event happens i get no errors in console and i registerd it in the main class
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.sveaty.items.coustumitems.ItemManager;
public class onRightClick implements Listener {
@EventHandler
public void OnRightClick(PlayerInteractEvent e) {
if (e.getAction() == Action.RIGHT_CLICK_AIR) {
if (e.getItem() != null) {
if (e.getItem().getItemMeta().equals(ItemManager.PotionWand)) {
Player p = e.getPlayer();
p.getWorld().createExplosion(p.getLocation(), 6f);
p.sendMessage(ChatColor.GOLD + "Explosion Activated!");
p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 3, 50));```
i get error that IsSimialr is non static method
e.getItem().isSimilar
it also says expresion expected at e.getItem
?learnjava duh
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
so add the brackets
fixed ty
is there a way to make snowball to pass through entities?
Player player = (Player) sender;
// Summon a custom skeleton at player's coordinates with Netherite armor
Skeleton skeleton = player.getWorld().spawn(new Location(player.getWorld(), 205.5, 126.93750, -75.5), Skeleton.class);
// Disable skeleton's AI
skeleton.setAI(false);
// Set skeleton as invulnerable
skeleton.setInvulnerable(true);
// Create and set the Netherite armor pieces
ItemStack helmet = new ItemStack(Material.NETHERITE_HELMET);
ItemStack chestplate = new ItemStack(Material.NETHERITE_CHESTPLATE);
ItemStack leggings = new ItemStack(Material.NETHERITE_LEGGINGS);
ItemStack boots = new ItemStack(Material.NETHERITE_BOOTS);
// Set the armor items for the skeleton
skeleton.getEquipment().setHelmet(helmet);
skeleton.getEquipment().setChestplate(chestplate);
skeleton.getEquipment().setLeggings(leggings);
skeleton.getEquipment().setBoots(boots);
new BukkitRunnable() {
int ticks = 0;
int degreesToRotate = 360 / 8;
int lastFuseTicks = 0;
@Override
public void run() {
if (ticks >= 3 * 16) {
this.cancel();
skeleton.remove();
return;
}
skeleton.setRotation(skeleton.getLocation().getYaw() + degreesToRotate, skeleton.getLocation().getPitch());
Snowball snowball = skeleton.launchProjectile(Snowball.class);
skeleton.setCollidable(true);
snowball.setVelocity(new Vector(snowball.getVelocity().getX(), snowball.getVelocity().getY() - 0.125, snowball.getVelocity().getZ()));
PersistentDataContainer container = snowball.getPersistentDataContainer();
container.set(new NamespacedKey(TikTok.getInstance(), "skeleton_snowball"), PersistentDataType.BOOLEAN, true);
TNTPrimed tnt = snowball.getWorld().spawn(snowball.getLocation(), TNTPrimed.class);
if (ticks > 0)
tnt.setFuseTicks(lastFuseTicks - 3);
lastFuseTicks = tnt.getFuseTicks();
snowball.addPassenger(tnt);
ticks += 3;
}
}.runTaskTimer(TikTok.getInstance(), 0L, 3L);```
Try to cancel ProjectileHitEvent
Hello I have 1 question. I have pack that is adding things via mcpatcher/cit folder. Is there a way to make it work on bedrock?
Hello will this method work on settings armor peace too?
player.getInventory().setItem
in here?
but won't it just cancel the hit?
i'm using it to cancel the snowball particles if it hits the wall
can i check there if the snowball hit an entity and cancel it appropriately?
i don't know but
there may not inventory, you may need to use player.getEquipment
iam on old version
Isn't
if (!(sender instanceof Player player)) {
return;
}
UUID uuid = player.getUniqueId();
supposed to be working? Someone said it would work but my IDE is screaming at me that I can't access player since it's not in the if-block.
Just remove brackets
alr thanks
doesn't seem to fix it
If that doesn't work, you might be able to use the indexes directly
yes u can only write player.getUniqueId
why u did this ?
example
it's about accessing player outside of the if block
had a discussion yesterday and noobdog said that would be my correct code (pretty much)
oh i see
noobdogs code was just wrong
what are u trying ?
long story.. wait let me get my original code lmao
aight
basically my code was one big arrow
and that was a problem
wait i can just send a different command bc i gotta refactor all of them anyway
can you briefly explain, what is your problem?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
early returns ig?
a bit hard to explain bc i myself still have to wrap my head around that bc it's new structure for me
i was used to this (at least in mc projects)
in my opinion u need do this code with early returns
your code will be more readable
thanks
example for permission if
if (!sender instanceof Player) return;
if (!p.hasPermission("serversystem.activate.norain")) {
p.sendMessage(Errors.getPermissionError());
return;
}
if (args.length == 0) {
sout("usage message")
return;
}
the instanceof needs double brackets
yeah i get that. the problem is now: there's different stuff happening depending on if a player uses the command and if a console does that
yes don't forget that
if (sender instanceof Player player) {
//player code
return;
}
console code
Is there a way to check if there's a full moon?
can u help me for hibernate ? btw
i can't use sessionfactory
i dont use it
so more like this here? https://pastebin.com/dDuYcDF5
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
the args error is in both so do that first, before the instanceof
and make this a method
but the concept is there
What is global boolean utils lol
hi bro do u using hibernate?
Well only in spring
spring boot using hibernate 6 ?
bcs i can't use sessionfactory
i mean i can't import and do anthing
it worked
ty
btw
how can i do this on primed tnt?
tnt prime event
alright, so more like this? https://pastebin.com/75KXH18M
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Wait
private void handleDeathCange(CommandSender sender) {
if (isDeathEnabled) {
GlobalBooleanUtils.setDeathEnabled(false);
sender.sendMessage(ServerSystem.getPluginPrefix() + "You successfully §aactivated §3noDeath§7.");
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (onlinePlayer != sender) {
onlinePlayer.sendMessage(ServerSystem.getPluginPrefix() + ((sender instanceof Player) ? ("§b" + sender.getName()) : "An §4administrator") + " §7has §aactivated §3noDeath§7.");
}
}
} else {
GlobalBooleanUtils.setDeathEnabled(true);
sender.sendMessage(ServerSystem.getPluginPrefix() + "You successfully §cdeactivated §3noDeath§7.");
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (onlinePlayer != sender) {
onlinePlayer.sendMessage(ServerSystem.getPluginPrefix() + "§b" + sender.getName() + " §7has §cdeactivated §3noDeath§7.");
}
}
}
}
for the bottom method
wait this can be shortened even more
how can i cancel collisions for tnt primed
i checked that event
but it doesn't say anything there
oh, no clue for that
private void handleDeathCange(CommandSender sender) {
GlobalBooleanUtils.setDeathEnabled(!isDeathEnabled);
sender.sendMessage(ServerSystem.getPluginPrefix() + "You successfully " + (!isDeathEnabled ? "§aactivated" : "§cdisabled") + " §3noDeath§7.");
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
if (onlinePlayer != sender) {
onlinePlayer.sendMessage(ServerSystem.getPluginPrefix() + ((sender instanceof Player) ? ("§b" + sender.getName()) : "An §4administrator") + " §7has " + (!isDeathEnabled ? "§aactivated" : "§cdisabled") + " §3noDeath§7.");
}
}
}
this
that's some nice advice. much better than yesterday. thank you all so much :D
i don't want the sender to get the message
can you even compare player objects with ==
bc the sender already gets the message above
yes
i'd compare their uuids instead tbh
Do I have to calculate moon phases myself, or is there something that does it for me?

use notepad++