#help-development
1 messages · Page 1741 of 1
"meta info," contains information about the files in the jar.
.
e.g. the main class, the signature used for signing the jar's classes, etc.
Open it up in an archiver like WinRAR or 7zip.
oh ok
But yeah Oracle loves renaming zip files.
does
(this file is how the compiler identifies the standard library, by the way)
ok the plugin does have the yml what to do now?
Hm, any errors when the server starts?
hey maow when did u started java
2 years ago.
2 months ago.
Right around the start of COVID-19.
Okay so, to clarify, does the server show the plugin if you type /plugins?
Huh...
no errors in the start right?
start a brand new project because maybe it would waste our time
shall i send the whole start?
maybe yes
YOU SON OF A
wym?
do you have an eye to track whenever it is an error or normal log?
i only need 1 eye, at least 1 eye
to notice the error
and you dont even have one

dude im using cmd how tf am i supposed to know
💩 
🍺
There should be no problems with your plugin tbh.
so how do i fix it?
use other java to run ur server
use something like directly put ur java path into ur batch file
or just uninstall the other java and use only one java
i have only 1 java wym?
im new to java give me something more in-depth lol
Google your question before asking it:
https://www.google.com/
i use cmd to run it most of them are for eclipse
Are u using eclipse?
Dunno how 2 change intellij compiler setting
Google is your friend
File > Project Settings will allow u to change jdk version IIRC
Is it possible for 2 teams on the same scoreboard to have the same entry or are they removed when you add the same entry to two different teams?
Im making a skywars server
But i need to make two npcs
First npc gonna teleport player to solo game
Second npc gonna teleport player to team game
Help pls
anyway ^
nvm javadoc says #2 is right
hello, how can i create a block object of chest xd
Look at the javadocs to see if Chest is a sub interface of BlockData or BlockState, then get the relevant and cast to Chest
the error says that its compiled in an unsupported java version
unsupported by the JVM running your server
what version are you running?
and developing the plugin for?
1.16.5 uses Java 8
nope
im trying to remove an item from a players armor slot but its not working, what am i doing wrong? https://paste.insprill.net/onagijawug.csharp
so im taking it this PacketPlayOutBlockAction doesnt seem to work on displaying opening barrels. works fine on chest, trap chests and such but when I do a barrel.. it doesnt seem to do anything about open. do I need to use a different packet, or .. ? (I do want this per player, otherwise I would of just used lidded#open(), etc)
Try just reducing teh stack size on the ItemStack. It doesn;t matter where it is
what do you mean?
got to get their equipment
You don;t have to test every armour location, just set the stack size on your ItemStack to zero
player.getEquipment().setBoots(null);
how to change comiler in InteliJ?
Presumably you use a proper build framework such as gradle or maven
Which can handle this in a plain configuration file
i have maven
In which case you simply specify the target version ?
im thinking of completely rewriting this
i wrote this like a year and a half ago
i just made a repo for it
Are you publically hosting a spigot jar 👀👀
Guys
I'm making a rank sys
So
How to make owner on the top
I tried way of Scoreboard teams
Didn't work
how can i make a dropper always face up?
Also how to set the display name that other players see to another color
Setdisplayname don't work
Can't you write it all in one sentence instead of one by one?
Sorry , but how to make them
@sand rune top of what? Tablist?
@quaint mantle yeah
oh ok got it
I would do it with packets
where can i find it?
In your project
My "event type" enum is remaining null
Setting the enum
https://paste.md-5.net/jekuluvemi.cpp
Getting an instance of the class
https://paste.md-5.net/ronurositu.java
Class I have to check the current event that always returns null
https://paste.md-5.net/eyuyuyuket.java
Enum class
https://paste.md-5.net/elitikuzip.cpp
Calling the method and setting it
https://paste.md-5.net/rikoyuroku.java
hi everyone! i have a question: i have this method for creating items:
public static ItemStack createItem(String name, Material mat, List<String> lore, int cmd) {
ItemStack item = new ItemStack(mat,1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(name);
meta.setCustomModelData(cmd);
if (!(lore.equals(Collections.singletonList(null)))) {
meta.setLore(lore);
}
item.setItemMeta(meta);
return item;
}```and i want to add a blockstate part to it, so i can set the item's blockstates for when you place the blocks, how do i do that?
Like chest contents for example?
So basically I am wanting to check blockbreakevents if the block broken matches a set of blocks from an array.... BUT I want to do it as efficiently as possible, and (while I may be quite dumb) I believe a for-loop is not the best way to go about these things. Anyone got some tips as to what I should be doing?
You can do a binary search
public class breakevent implements Listener {
String[] blocks = {"DIAMOND_ORE", "DEEPSLATE_DIAMOND_ORE", "EMERALD_ORE", "DEEPSLATE_EMERALD_ORE"};
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
String b = e.getBlock().getState().getType().name();
for (int i = 0; i < blocks.length; i++) {
if (b == blocks[i]) {
Player p = e.getPlayer();
p.sendMessage("You broke a " + b);
}
}
}
}
what I'm working with currently.... I feel like this is definitely not the most efficient way to do it
That code won't work
add Materials to as Set, then just call .contains
can one of you please help me with this
kinda does so idk :kekw:
Could you expand? Not sure what you meant by "as Set"
HashSet
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
thx
Comparing strings with == shouldn't work??
String::intern 
idk what to say it worked when I ran it
awesome. I found the same article when I searched for it, but this is literally exactly what I needed. I tried using Contains earlier but didn't know about HashSet
bump
@chrome beacon i have been trying to fix this problem for days tysm
Are you setting it before the command is ran
I'm setting it when the event starts and then when I run the commands after it has been set then it still doesn't work and returns null
Could you just put the entire thing on github
I don't want all the code to be public
there is some stuff I need to keep private
aka my utils
ik but I just rather not make this code all public
if you want anything specific lmk
but I dont wanna share everything in it
I’m not the one assisting you but it ought to be a hell for the one who’s helping you if you’re not willing to give them what they need 
I'm willing to give all the code they need but I don't want to share the whole repo
That makes 0 sense tho
how?
If you give them all the code, then that’s basically the repo
there is alot of stuff apart from what I need help with
I didn't comment on it as theres simply not enough code to tell if you are doing any of it correctly
What part do you want?
More. A couple of lines of this and that tells us nothing
Do you get teh message that it is null in the test?
?paste
here is the whole event manager class https://paste.md-5.net/reqodadayo.java
Do you get the message you were sending on null? or are you getting an NPE?
the enum is null
im returning fine
but the enum is null
This? prints null? https://paste.md-5.net/eyuyuyuket.java
yes
and it also does on the sb
sb?
I'll assume you truncated the code as theres a very odd switch in your EventManager
where?
I don't think I use a switch
line 42
omfg lmfao why is that there
it should work, its just... odd
idk why it was there
Even though I write, team members can hit each other.
red.setAllowFriendlyFire(false);
blue.setAllowFriendlyFire(false);
how do i fix it
this gives no information
ill try without it 1s
you just need to fix it by typing in code
@fading lake
@crude charm
https://notes.io/Gg1y
If I use the /takimyap command, the ones in this code work.
@eternal oxide it works now LMFAO im so dumb, I wrote the code at 3am so no wonder but I think it was because I used to use a switch to check for the event times but I cleaned it up after I tested if it worked
I looked and thought thats a pretty shopping list.
wtf is this font
Even though I write, team members can hit each other.
red.setAllowFriendlyFire(false);
blue.setAllowFriendlyFire(false);
how do i fix it
https://notes.io/Gg1y
If I use the /takimyap command, the ones in this code work.
Thats a nice guest list
Wonderful wedding invite list
thats a nice inventory list
stocks formatted very well
What a beautiful bukkit list
wouldn't go that far, bukkit lists r messy asf
?
p
a
s
t
e
wow
such a nice spelling list
pasta
WOW
Can you stop kidding and help?
you're not funny, toxic kid
do you not see whats wrong?
nah
You are not setting scoreboard for the player
yeah you missed that out on your beautiful list of notes
also you're not checking for a command
not needed in that context
@eternal oxide I think I understand.
thanks
if hes done setExecutor("command") then itll only execute on that command
fr?
yep
WOW
That shouldn’t even work
setExecutor(string)
its only the JavaPlugin onCommand that fires for all registered commands
its a very basic imincollegecantactuallycheckit explanation lol, you get the gist
Yeah I just had to 
:angery:
mfw when they posted their code I went to thinking "what version is this? #addPlayer is deprecated in recent versions"
my new fav gif
why cant I use external emotes >:I
why cant I send my fav gif
ZoiBox this is not the channel for those gifs
what channel
Heh
Well probably not in this discord
😦
It’s kind of inappropriate
what discord
I’m serious
ok
/ban

Heh
I can send you a server that accepts it if you want
ive scarred the poor child

what is the best way to save a building?
Schematic, worlds file, slime world,…
ok
Hi, i am getting Error occurred while enabling XpBorder v1.0.0 (Is it up to date?) java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getHighestBlockAt(int, int)" because the return value of "org.bukkit.Location.getWorld()" is null
this is the code, where the error came from:
spawnLocation = spawnLocation.getWorld().getHighestBlockAt(0, 0).getRelative(0, 1, 0).getLocation().add(0.5, 0, 0.5);
}```
Idk how to fixx it..., can you help me please?
read it
it tells you EXACTLY what is wrong
send class
NullPointerException return value of "org.bukkit.Location.getWorld()" is null
^
read the FULL error
your instance of the world is null
Run Java Snippets in your Browser
public Location spawnLocation = new Location(Bukkit.getWorld("world"), 0, 0, 0);
@manic crown
Bukkit.getWorld("world")
should be
Bukkit.getWorld.getName.equals("world")
so the "world" is missing
?
What what you're doing it's looking for smth else
you need to check for the name
hehe already ready with my exercice while everybody is still busy
There probably isn't a world named "world"
there probs is
I've had this issue in the past
it's because you need to check for the name
not just get the world
is there a folder called "world"?
^
yep
but the errorcode is only while starting, not on /reload
?
on reload everything works fine
idk
what's even the issue?
I've told you what is wrong
on serverstart is the error
can't you just get plugin.getServer().getWorlds().get(0)
i am trying right now
I give up
ok
the npr is at Location#getWorld() so the location is null
How can i prevent that this happen?
https://i.gyazo.com/33c8367a45266aa9a09d8c7031f2c75f.mp4
check if current xp is over the required xp, then optionally call the level up code after you added the xp
Just remember to check after you've added the xp, not before.
🇩🇪
how does one set a blocks' blockstates?
i want to change a placed block in a BlockPlaceEvent blockstates
I believe the blockstate class has an update method
huh?
?jd
wha- what do i do with this
Hello anyway to get access on org.bukkit.craftbukkit.Main mainclass ? I ran buildtool but crackbukkit doesn't appear in m2
call it and you have set the blockstate
to what tho?
your blockstate object
huh
do you even have an blockstate instance?
idk what that is so i'mma go with no
then what is your question about?
i just want to change the powered blockstate, the instrument blockstate and the note blockstate of a noteblock when it's placed
also is there a way to make it so it doesn't update the blockstates? so like if you place a block near a powered noteblock and there's nothing actually powering it, the blockstate will change
and i want it to not change
var state = block.getstate();
// Optionally cast state
// Modify state by calling methods on it
state.update();
i don't know how to use this or what it does
can someone please explain to me how to do this?
run a BukkitTask 1 tick later to set all your NoteBlock settings
ok but idk how to set the blockstates
anyways i'm gonna eat now, i'll be back with the same question when im done eatin doe
probably somethign like java NoteBlock note = (NoteBlock) block.getState(); //change settings on the note. note.update(false);
I didn;t bother to check if its a state you need or BlockData. You need to check that
Im creating my own plugin for my server and i wanted to create a border every time someone joins the server using WorldBorderAPI. I coded everything, but the method .setBorder() doesn't work, it doesn't throw any error and Java go forward in the code.
Gist: https://gist.github.com/EnderF5027/1cc283e02b08caf6ddae93a08aae5828
I created an Issue on their github but i didnt get any reply (2 Days)
how do i code java? im trying to make a plugin but that part is difficult and idk how thank you

Can you give me a code where I can get half of the players to another team and the other half to another team?
with "/scoreboard teams join <team> <player>"
I will assign this to a command.
this is a joke right?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
thank you for your help :D
First off, you can;t teleport teh player inside the PlayerJoinEvent, you will have to delay it using the Scheduler.
I suggest you to learn first the basic of Python because is simple and you can understand easily the base concepts of Object-oriented programming
Second, make the logger the same as you did the config. get it from your Main
but make it a Field in teh Class so you are not fetchign it every time a player joins
ElgarL the G
with a public function that returns the logger?
Lastly Location is Serializable so you can just playerData.set("WorldBorderInfo.Center", location); and playerLocation = playerData.getLocation("WorldBorderInfo.Center");
main.getLogger()
if you create a Field in your Listener class it can be private, as you'll only access it within the class
One LAST point... Don't call your plugins Entry Class Main. Applications have a Main, these are Plugins and as such should not. Name your Plugin Class the same as yoru plugin
?main
idk how to use this
Then learn
you'd need to look at their API probs
Prob headDB
and uhhh
we can't really help you with their API
bc not everyone is fucking omniscient
Be patient
bruh i sent the first message about this topic an hour ago
Complaining won’t get you help faster, I can assure you
elgarl you just sent me code and when i didn't understand it you told me to learn
this IS how i learn
You want to set the data on a NoteBlock when it is placed.
and to cancel any updates to the block apart from breaking it
or setting it to another block or air
So you schedule for 1 tick after the block is placed (as you don;t want to trigger any updates.
then you do as I showed you in teh code block, inside the runnable
idk what a runnable is and idk how that works
or how to use it
so if you could be kind enough to explain how it works that would be great
inside the runnablejava NoteBlock note = (NoteBlock) block.getState(); //change settings on the note. note.update(false);
i don't know what this is, what it does, what a runnable is, or how to use this
i think i've already used this before
yep, i have
then create a BukkitRunnable for 1 tick after the NoteBlock is placed, pass it the location
from that Location you can get teh Block and make all your adjustments
all i know how to do for that is to make a thingie that only works after a tick
Bukkit.getScheduler().runTaskLater(pluginInstance, () -> {
//do stuff
}, 1L);```
yes, but don;t use a lambda
idk what a lambda is
no
public void onBlockPlace(BlockPlaceEvent event) {
final Block block = event.getBlockPlaced();
if (block.getType() == Material.NOTE_BLOCK) {
new BukkitRunnable() {
@Override
public void run() {
NoteBlock note = (NoteBlock) block.getBlockData();
// Make changes here
note.setInstrument(Instrument.BASS_DRUM);
}
}.runTaskLater(plugin, 1);
}
}```
Will probably work
can use this: ~ in a command to get a position?
how do i set the note
really?
Try some of those keys on the big pad in front of you
there's flat and tone and sharp and idk what all those do
Hi, how can I check if button is powered?
btw ur code does not work
musician Maow is acting why there is both flat and sharp...?
Correct, I left out one line specifically so you would be forced to fix it
no
then i have no clue what you're talking about, sorry
all the code there is correct (bar plugin instance). There is one line you have to add to make it all work
you have to update the data back onto the block
ah
no work
update is red
no, thats ancient
as I said before you had to check if it was state or BlockData, as it turns out its BlockData as you can see in teh code I recently showed you
block.setBlockData(...
block.setBlockData(note); ding ding ding or no ding ding ding?
yes
yay!
okie but how 2 set note and also stop it from updating
dis is for a resource pack btw
what have you tried for note?
uh idk i deleted it
don;t care, I've never used a resource pack
sheesh ok
note.setNote(...
ye i did that
and?
but idk how to use it
it has sharp and tone and whatnot
why cant u just set it to a number lol
if you look at teh auto complete suggestions as you type its quite simple
for ma smol brain it is not simple
it requires a Note, which is comprised of an octave (int) and a Tone
eg note.setNote(Note.natural(5, Tone.C));
wat da tone do
try it and see
or look it up
It gives you one of the 12 notes in music
abcdefg
Isn’t this Ultra Spoon feeding?
yes
isn't there like 24 notes per noteblock instrument tho
Man, if you don't know music u probably shouldn't be making it in mc
Yeah I’m surprised I would’ve tossed my phone by now
2 octaves
Agree
I wouldn't go that far, but I would at least do some research beforehand
am not makin music, noteblocks are just good for custom blocks since they have like 700 different blockstates
how 2 do harp instrument tho? it's not suggesting me it and when i put it in it red
My suggestion would just be to learn Java before because he didn’t even know what A lambda is
this is how i learn
there is no specific Harp, try them all and see what you prefer
This Ain’t learning Java, this is learning the API of Spigot. You’re having issues with basic Java terms.
i need harp cause that's what i use for the current 5 blocks i have
whatever you are using its one of those listed in the Enum
I've no idea what a "note 3" is
Wouldn’t A Note Block if HARP in B# be one state and Another one In Bass B# be another state?
by the way, JUST from checking out the javadocs there's even a contructor of Note that just accepts an integer like you want
which will give you the nth note
idk what a constructor is
oh my
i think i knew what it was but then i forgot
ok then you really have some Java learning to do
perhaps we shoudl start at the beginning
oh ye i saw that, it did not work sadly tho
what "didn't work" about it
Java consists of letters and numbers laid out in a specific order...
seems to do exactly what you want
it was red and stuff
well...
I'm guessing the harp is like a banjo
that means you probably made a syntax error
Or something
and that's wrong
😄
because that's not using the constructor
Judging by the fact that derpy has no musical knowledge, it's probably mistaken a harp for something else
it literally just says setNote(Integer) in the docs
no its doesn;t
am i reading the wrong thing
kinda
my brain is just pure confusion, please tell me what im supposed to read
read up on what a constructor is
I've given you full working code now, play with it until you have exactly what you want
is JavaPlugin a mutable class or nah
but there's no harp instrument and the note is different from what i put in
idk how music works so idk what im supposed to put in for the note
what's a "mutable class"?
🤔
I think u should contact google baba he might know the answer to that question
AAARGH
im guessing i need C then?
??
No
do you know how hashing works?
it has some mutable properties
However it uses its name’s hashCode iirc which is immutable
the opposite of unmutable 🌝
?
the server runs on the main thread so what
is multithreaded packets possible ?
Oh I was replying to the wrong message my bad photoshop
is multithreaded packets possible ?
ah no worries
You can send them async sure though they’ll be queued and handled like the ones you send synced I’m pretty sure
waah @quaint mantle you're here too
you mean immutable?
I m everywhere
hashmap is O(1)? 🥺
It’s really not
Most cases yes
ye
i found harp
But it can in worst case be O(n) for stuff like remove, contains and put with the presumption that every key in the hashmap has the same hashCode
apparently it's Instrument.PIANO
although it's recommended to support databases if select portions of data are required
ah ye, buckets
am i supposed to try all of the tones until i find 0?
Yeah lol
that's easily solved by having a decent hashCode impl, which IDEA can gen for you
player data what
not sure what you mean by that tbh
If it’s immutable then it’s automatically thread safe 
I meeean it's not that hard to just implement a ReentrantReadWriteLock
no lol
if(Output === "15000$ have been taken away"){
ispatchCommand(Bukkit.getServer().getConsoleSender(),"GMC");
else{
Sytem.out.println("say Not enough money to revive")
}
any help is Grateful
code:
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.concurrent.TimeUnit;
import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime;
import java.util.concurrent.TimeUnit;
import static java.util.concurrent.TimeUnit.*;
public final class HardcorePurge extends JavaPlugin implements Listener{
@Override
public void onEnable() {
// Plugin startup logic
System.out.println("------------------------------------------------------------------------Hardcore purge was started Initialisation was success No problems were found--------------------------------------------------------------------------------");
int x = 1;
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onDeath(PlayerDeathEvent event) throws InterruptedException {
//Even for Dying
System.out.println("Player Died--------------->");
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "say Oh no , player has Died! There they go to purge!");
String PlayerName = event.getEntity().getName();
//setting GMS
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "gamemode adventure " + PlayerName);
//sudo
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(),"eco take " + PlayerName + " 15000");
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}```
ok so i want to make a hardcore revival system that makes it so that i can use Essential X's economy to revive the player for this i want to read console & make an if statement like this:
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
True, but I mean if you get the chance to have stuff immutable then no need for locking mechanisms
Lol
Don't, use the API
use EssentialsX API, must better
I mean immutability would have no overhead as opposed to locking
can u lmk the name?
also is reading the console possible? will need it for future
how so? wouldn't you need to recreate the data object every time you wrote to that player data?
object instantiation, especially large objects, are expensive
if you put initialisation was success before the execution of code then it will always be "success":kekw:
can someone please tell me how this works? or like a website with minecraft noteblocks note numbers converted to octave and tone?
if you are going to change it anyway, yes. I think they mean that an object being immutable just means you don't need any locks and thus don't have the locking overhead
Yes but I said if it’s possible to have certain data immutable it automatically infers you don’t need to mutate the data.
ik just made it user friendly!
okay, Demon, if you don't even know what an API is, stop asking about asynchronousity, you will break things.
ah, fair
what's that?
also i still don't know how to stop it from updating
is that one with a timestamp?
i also saw ones with a condtion
I think so, yeah damn didn’t even knew it existed till now lol
"Java 9 StampedLock"
Conclure: sends Java 8 docs for StampedLock
😅
not sussy baka at all

kinda sus
there's an imposter among us
pfwoa
baeldung the best
Java 8 is a good version
True
how can i use Essential X to read console & use that as a var in my own plugin?
Yeah... I have the same problem
ah
wdym by reading console?
pls someone help me
Can u explain?
go the the essentials server and ask it there 🌝
any other way to detect A economy command being used(EssetialsX)?
where can i find all the notes converted into numbers
Guys , simple stupid java doubt
y the fuck will u do that
just go to the EssentialsAPI and add/remove the money according to that, (u will probably need Vault API tho)
making a hardcore thing which will depend on the same
For two given expressions
if(x==1 || y==0)
and second expression
if(x==1 | y==0)
whats the diff
First Case:
1 is true, time to run the code
Second Case:
1 is true, whatever I will run the second condition, then I will run the code
i have an idea
:?
so in case 1 , if x is false then y will be checked right?
and in case 2 , both will be chcked regardless together right?
yes
same with & in boolean condition
they have different meanings when they come to numbers tho
that's why i'm scared 💀
its not that complex
|| and && can't be used for numbers, they only work on boolean expressions
they do what's called logical short-circuiting
someone pls help
the | and & operators are just bitwise OR and AND
i am going insane here
its quite simple, & means common binary digits, | any binary digit that is 1
so & returns a byte?
it can, if you use it on 2 bytes
but larger numerical values like shorts, integers and longs also consist of bits, albeit more
man I already miss the this emote 🥲
true
1 = 0001 in binary
2 = 0010 in binary
so 1 & 2 = 0 cuz they have nothing in common (0000 in binary)
and 1 | 2 = 3 = 0011 in binary
then to make things even more fun there's also the XOR operator ^
so & only checks for 1 bits?
that is a binary logical operator, but java doesn't have NAND
🧠 🤯
my bad, I said cuz I got interested into the topic of XOR
hehe, np
checks common 1 positions
it's only 1 when it's 1 in BOTH numbers you give in, hence &
it needs to be 1 in the first AND (&) the second number
like 0011 = 3 and 0010 = 2
3 & 2 = 2 = 0010
ok
and boolean values act as a single-bit number in this case
so 0 & 1 = 0
0 | 1 = 1
1 & 1 = 1
0 | 0 = 0
same behavior as && and ||
but both are evaluated
main distinction is when you have side effects or computations that take longer to evaluate
boolean var0;
boolean var1;
if ((var0 || var1) && !(var0 && var1)) {
print("XOR");
}
XOR can simplify things like this if statement to
if (var0 ^ var1) {
print("XOR");
}
this is how XOR looks like in conditions
why are you asking if async everything is possible
that
probably he is trolling 🤣
Cheap Vpn Services for minecraft hacking dm me
smh
i still need help, please
1000101
no one will help you if all you do is beg to be spoonfed and don't show any initiative to learn by yourself
dude i have no clue how music works, i don't know what tone and octave i need and i have been googling and found nothin
wdym by 45?
they're saying stuff like F# and i just don't understand
what are you even trying to do?
resource pack
yep
1 0 0 0 1 0 1
64 0 0 0 4 0 1
🥺
Wait how the hell did you get 45?
1 + 4 + 64?
ik 😂, that's y I didn't say that
Ohhhh hahahah
ah lmao
I didn't even think of hex
should've said 0x45 like a real chad
What am I, stupid?
They don't allow outside emojis...
Okay sorry I took this off-topic for a bit. I'll stop it
So how about HashSets? Aren't they awesome? Literally learned about them today lmao
HashSet uses a HashMap (;
whats even the benefit with a enumset?
ah didn't know that
I basically just wanna pull a list of blocks from a config the user can edit, then shove that in something I can search through, but search through efficiently
and it should contain constant values?
||no its the time efficiency|| no one saw this got it
I wish we had a readMaterial for configs
Speaking of configs... I've been trying to get a grip but my brain is just smoothing out. Anyone know of a good tutorial I can watch?
Would be a nice utility
have you read this https://bukkit.fandom.com/wiki/Configuration_API_Reference
It would be nice if I didn't have to do some trickaroos to check for a set of blocks but you know, we work with what we got
I have indeed not. I'm literally smoothing out trying to read this haha. I just need to be able to get a very basic config file going so that I can work with that and gitgud as they say
spigotmc site is blocked at school smh
actual smoothbrain school
i forgot my vpn password and i'm too lazy to go search it
the what
forgot password
ugh i have too many combos
paste the link in google translate
click on the "translated" link
voila
We didn't have blockers when I was in school 😎
imma try that when i'm at school :kekw:
[18:36:26 WARN]: Nag author(s): '[Zax71]' of 'GHSPPAdminTools' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger). how do i get rid of this?
We could also open up an admin cmd window and tell other computers in the lab to open their dvd drive 🤣
we have blockers that block games but when you put a . after the url it works 😂
Don’t use sysout
what do i use instead?
Read the bottom of the message
read the error message
(JavaPlugin#getLogger)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/java/JavaPlugin.html#getLogger() so this?
declaration: package: org.bukkit.plugin.java, class: JavaPlugin
plugin.getlogger()
^^
owo
ty, i'm noob at java 😆
heh
~~we know ~~ I realized too late
feels like I shouldn't have said that, mb
I will avoid going here in the future so I don't get absolutely embarrassed asking a simple question 😅
I can take the insults dw ❤️
don’t worry
i did all of this things, but WorldBorderAPI#setBorder() doesn't work anyway
SMH They're sending a message with an alias and not putting the alias inside of "" I am literally so upset
imma leave before I ruined this chat 🖐️
you can’t progress without help
Self-help counts as help, though. Remember that
depends
It does help just rubberducking stuff, I've found. Like 80% of the problems I have I resolve myself after just explaining my issue
advice or redirecting to resources counts as help
🦆
Yup, and I've received awesome help here so far. Been here for one day and I am definitely sticking around.
🥘
I mean.... Google should be your first tool
I appreciate asking someone for the sake of having a conversation, but if you're just wanting people to do stuff for you that's a whole other thing
imagine using bing
i was in another coding discord, i asked a question and they said me to put that in bing
I couldn't have solved my issue without coming here, though. Being made aware of HashSet was a blessing that actually reignited my passion for learning how to make plugins
you can’t durectly ask questions when reading a site
You're definitely right
Healthy mix of feedback, advice and searching for stuff is how to get things done
people are used to tutoring
you’re right
but internet contains misleadimg info
lets put our shoes in a beginner
they heard of spigot plugons
they wanna make one
they search spigpt plugin tutorial
that's so true
the tutorials often don’t teach java
Though yes, what I was trying to ask was if anyone knew a good tutorial I could watch so I can set up a config? I was told JSON configs are superior, though I just don't have brainpower enough to understand that just yet. YML/YAML config seems pretty bearable but I've not found a good tutorial for it... And I don't have enough knowledge to read spigots post about it
so they struggle
like wanting to make a plugin before learning java
Spigot yaml support is pretty good
?paste
I'll give it another go, thank you
Now this... This I like. Thank you
maybe some things i would have to change
It makes more sense seeing something like this, though. Do I just put this in a separate class for my plugin?
uhh your choice
(Obviously not exactly this, but something adapted to what I need)
Yeah I like having it all separated
learning java before spigot can be boring
I would personally have a for loop going a map of string names of the configs and the actual configs themselves
as your first lang
Just so you don't have to copy paste the thing like 5 times
had me thinking is it perhaps the right way
So for the onEnable method, how would I call that class? I assume I'm not doing it with getServer().getPluginManager().registerEvents?
wdym by copy-pasting?
spigot was a motivation to keep learning
i dont get it
Instead of pasting those if statements 5 times for 5 configs, just add the config and name to a map and loop over it, saves you using duplicated code
ah
Yeah I was gonna say that was probably what they meant. At least I am not full smoothbrain
in my life i’ve taught people programming
and noticed this
making a map for just 5 things mwoa possible
?
i still need help btw
i could do that but couldnt it require more efforts than that long code
but which map do you mean?
Java map
it will make u to code less if u want to add more configs
i mean FileConfiguration, String or something?
Would I need to do anything in my main class to have the configmanager work? I assume I do, though I'm not sure how to proceed as I've so far only had getServer().getPluginManager().registerEvents
in mine i only have createFiles() which loads everything
and the files are already added to the resources folder so i'm not sure how to create one from scratch
oh ofc 🤦♂️ Thank you, it must be getting too late to work on this now haha
I'd do it rn but I'm on phone
me too 🥺
ah i guess this creates a new file if it isnt included in the resources folder
instead of plugin.saveResource("file.yml", false)
iirc
A decent config handler from Steel https://www.spigotmc.org/threads/custom-config-api.338458/#post-3150363
I remember I had some really useful config code in a plugin I made
But forget what it is
yoink
heh?
am i correct that plugin.saveResource() gets the file from the resources folder?
Hover over it, what's it say
uhh just closed it
sed
one dark vivid italic is my theme
ah ok
It uhh..
is anyone good for making plugins
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!
The best thing is to write your problem^^ Someone will be able to help you then
people here are just annoying with that command just saying
I don't have a problem i just want to know if it's possible i don't want a scam like at the end the person say no.
what command?
Hi.
how can i set the void death message ?
i also need to get the last living entity attacker data as display name...
is it possible?
I tried this
public void DeathReason(PlayerDeathEvent e){
Player killer = e.getEntity().getKiller();
Player player = e.getEntity().getPlayer();
}```
But it wasnt working as well cause the player will die because of void so...
So store the last attacker in the EntityDamageByEntityEvent for every player
Then do your stuff whenever a player dies to the void
Player killer = e.getDamager();
like this?
check if the died cause is void or something
Sure but you need to be able to reference it later, also check if it's a player damaging another player
Not just any entity
yee i created a new public void for EntityDamagebyEntityevent
This is for the damage event I'm assuming
playerdeadevent i guess
So to reference it later, you could for example store it in a player to player hashmap
oh ok i need to try it
Playerdeathevent isnt working for void deaths
i need the data of the guy who knocked that player to void
uhh google is your best friend i guess then
He wants to get the last damager even if the death cause is void
If you want to track the killer regardless, use a map<UUID, UUID> and the DamageByEntityEvent
Which is what I'm helping him with
.
.
the code's already giving some sort of errors
I was developing my plugin since i noticed that I had some error on JavaPlugin.java file.
Cannot resolve symbol 'NotNull'
Cannot resolve symbol 'Nullable'
Cannot resolve symbol 'jetbrains'
should i try event.finaldamage() ?
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>20.1.0</version>
</dependency>```
Is there a plugin that performs the squid game glass game? If not, how do I do it?
i noticed that import org.JETBRAINS.annotations.Nullable and NotNull are in red
how do I make it so
a creeper wont drop an effect on death
add that
Thx
Oh...
yo, is there a way to delete a key from a FileConfiguration?
set it to null
Is there a plugin that performs the squid game glass game? If not, how do I do it?
uh so i fixed that but how can i take my stored data from another public void ?
like this but it is giving some errors
Player killer = DeathReason.player();
Deathreason is my another public void
It doesn't work like that, that's why you'll have to create a HashMap to store it in
That denotes the last damager per player
how does one do F# in setNote()?
Hello, I want the BlockBreakEvent event to cancel when I break the block but release the drop
Note.sharp(...
works, thanks
ok second question: how do i stop a noteblock's blockstates from updating
So you want the block to drop the item but not actually get broken?
oh its u
hi corman
hi
Ok
what do you mean by stop it updating?
.. i assume there's no way to do this?
event.setDropItem dont work o_O
Get the BlockState
Well yeah if you cancel it then the whole thing is cancelled
Get the BlockState
i have a resource pack that replaces noteblocks with certain instrument blockstate, note blockstate and powered blockstate and i need it so the blocks always stay with their correct blockstates until they are broken
Schedule a task for the end of the tick to set the block back using that BlockState
BlockState#update(true)
I would be careful with this though
I don;t believe you can stop a redstone signal affecting the state
Cause you could place a chest and break it
where do i put that
Everything inside the chest would drop
Then the chest would respawn and still have all those items inside
Yes, you were already told, set it to null
I bench press 500 stone
does anyone know the difference between a chunkgenerator's "getFixedSpawnLocation" and just setting the world spawn? will one override the other?
i tried using string for storing the killer data but how can i restore it ?
I mean it gaves some errors even with tostring
don't use String, use their UUID or just the actual player objects
doesnt working
I'm gonna need more context than "doesnt working"
sure
how do I work with permissions without the vault API? Its too outdated and I know how to add and remove an attachment from a player but I don't know how to save those permissions
public void DeathReason(EntityDamageByEntityEvent e) {
if (e.getDamager() instanceof Player && e.getEntity() instanceof Player) {
Entity damager = e.getDamager();
}
}
@EventHandler
public void PlayervoidDeath(PlayerDeathEvent e){
e.setDeathMessage(ChatColor.GRAY+"[ "+ChatColor.RED+player.getDisplayName()+ChatColor.GRAY+" ]"+ChatColor.AQUA+" fell in void by " +ChatColor.GRAY+"[ "+ChatColor.AQUA+ killer.getDisplayName()+ChatColor.GRAY+" ]");
}```
cant get UUID for an entity so i cant also restore the damager data in Deathevent
i still need help with the disabling blockstate updates for a certain block
first of all, please name it better. EntityDamageByEntityEvent is much broader than just getting the death reason
um ok
you can't get the UUID of an entity? since when?
