#help-development
1 messages · Page 1527 of 1
849584954.34 % 1 == 0.34
int x = player.getLocation().getBlockX() % 1;
targetBlock.setX(targetBlock.getX() + x);
like that?
well no
oh wait no getblockx is int
you can't set the x position of a block
double x = player.getLocation().getX() % 1;
targetBlock.setX(targetBlock.getX() + x);
targetblock is a location
that i want to tp to
Location location = targetBlock.getLocation()
.add(player.getLocation().getX() % 1, 0, player.getLocation().getZ() % 1)```
and the 0 is the y i have i guess
well if youre searching for the top position of a block it would be odd to teleport them halfway into the air above the target block
Uh, are you sure item frames are block entities?
I don’t think they are at all, no
They’re entities
No you can definitely force multiple item frames into a single block
I’ve seen it done
It’s definitely not a block entity, I’m pretty sure of that
According to Mojang, they are Block Entities
actually I remember it wrong
That’s weird
you are right
Yep they are in Bedrock lol
They’re janky as fuck in Bedrock too
@quaint mantle can you explain what you’re trying to do with more context?
You’re trying to locate an item frame, right?
What circumstances are these item frames placed? Are they ones that already exist in the world or newly placed item frames?
I’m still a bit confused as to what you’re trying to do
Does this happen when the player right clicks that item frame?
I think PlayerInteractEntityEvent would work if that's what you're asking
you can get the location of the entity you right clicked from the event method
no getNearbyEntities method would be needed for that
How does one fix this? This moves a location sideways relative to its rotation but it goes slightly back if sideways is postive and slightly forward if it is negative.
loc.setX(loc.getX() - sideways * Math.sin(yaw - 90));
loc.setZ(loc.getZ() + sideways * Math.cos(yaw - 90));```
well youre subtracting 90 from the yaw
so of course its gonna be forward/backward instead of left/right
It is going left/right but it is slightly forward/backward
If I don't subtract 90, it does go forward and backward completely
if you are just moving in the direction you are facing java loc.multiply(loc.getDirection().normalize())
I'm moving sideways from where I am facing.
if you don;t want Y axis just zero it in the direction
if you want sideways then rotate the direction
I would I get the location of a command sender. If the sender is an entity?
Rotating the direction only works if you're working with 90 degree angles
you use the rotate method of Vector
I was just wondering if there is any math I am missing to the code snippet?
and no it doesn;t have to be 90 degrees. They are Vectors.
casting
That doesn't really help..
Location locClone = loc.clone();
locClone.setYaw(90 - loc.getYaw())
Vector direction = locClone.getDirection());
// Slide left or right
loc.multiply(direction); or loc.multiply(-direction);```
How would you set it to how many blocks you want to go sideways?
direction.multiply(5)
I can't think of any other way unless you change your saving method
I think getNearbyEntities is your only practical choice
np
Sorry for the repost but, I would I get the location of a command sender. If the sender is an entity?
Can someone help me with this? I'm having a problem with my computer.
I still have 12gb of available RAM
Last time I tried to install java 16, but I failed and now I get something like this.
you already got an answer
I'm so sorry I didn't notice and Thank you so much
whats the event for when someone stops spectating an entity
i dont think there is one
?jd will tell you
wtf is that
sry i meant getSpectatorTarget
read teh javadocs
ye
ok i see
just wondering what is the size of each ram stick?
8gb
i have total of 16gb
i have 32 gb i think
why is scheduleAsyncRepeatingTask deprecated
makes sense
i can't even open the jdk installer
bad naming
ok nvm i read the javadocs
new BukkitRunnable() { }.runTaskTimerAsynchronously(JavaPlugin, delay, period);
Make sure Ur on 64 bit
ye ik
32 bit only supports a max of 2gb ram for some reason
The method runTaskTimer(Plugin, Runnable, long, long) is ambiguous for the type BukkitScheduler now what
i am on 64-bit, i'm pretty sure
Make sure Ur on 64 bit os with a cpu that's 64 bit and also java that's 64bit
nvm fixed
Otherwise u have a max hard limit of 2gb of ram on Java
When I tried to remove the -Xmx it's saying a same reason.
I mean, it keeps saying OutOfMemoryError
Try -Xmx2G
I can run with -Xmx4G before I tried to install jdk 16.0.1
Run without any issues.
Do java -version
Error right after the server start https://paste.md-5.net/maxunicixe.md
aglerr
do
window Key
search : View ram info
and it should tell you the System type
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) Client VM (build 25.291-b10, mixed mode, sharing)
thought you were trying to install 16?
?java16
Install Java 16 at https://adoptopenjdk.net/?variant=openjdk16&jvmVariant=hotspot
Yeah, after I tried to do that, I got the OutOfMemorry issues.
try 4096M instead of 4G other wise you have a 32 bit JRE
i think you have the 32 bit version, cause with mine it says Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
@summer scroll
But I don't have any problems before I tried install java 16
I still don't know If I'm installed Java 16.
your path is pointing to java 8
^
Because I can't open the jdk installer, I downloaded the jdk from Oracle.
dont download the jdk from oracle
I don't know, I'm still figuring it out.
you just double click the installer..
im getting error The local variable task may not have been initialized
Yes, nothing happens.
that means it may not have been initialized
After I press the "Yes" button on the administrator.
🤨
check task manager
see if the process is running
it could just be taking forever, idk
Nothing on the task manager also.
whats the file name out of curiosity
you might just be better off going with openjdk instead at this point
Install Java 16 at https://adoptopenjdk.net/?variant=openjdk16&jvmVariant=hotspot
thats openjdk...
I got no problem using that one
yeah, im just saying that thats the one i was referring to when i said
you might just be better off going with openjdk instead at this point
code looks like this
BukkitTask task = Bukkit.getScheduler().runTaskTimer(Main.instance, () -> {
if (((Player)sender).getSpectatorTarget() == null) {
task.cancel();
};
}, 0, 1);
getting error The local variable task may not have been initialized
how to fix
alright thanks, by the way what should I put If I want to use specific java version on the start.bat?
path to java.exe
for example: "C:\Program Files\Java\jre_blabla\bin\java.exe" -jar server.jar
define variable task
Lol
I only found jre1.8.0 on the Java folder.
if you used Adopt there will be an Adopt folder
why is GameMode.getValue() deprecated
Cuz it's old maybe
what the replacement
Idk
ah, i just found that, thanks.
it doesnt say in jd
Because it uses an enum not a magic value now
ah, yeah. I only use oracle, mb
It says Error: Could not find or load main class java
show the command you used
"C:\Program Files\Java\jre1.8.0_261\bin\java.exe" java -Dfile.encoding=UTF-8 -jar server.jar
PAUSE
why did you put a random java in there?
"C:\Program Files\Java\jre1.8.0_261\bin\java.exe" -Dfile.encoding=UTF-8 -jar server.jar
I gotta say, I'm happy with this, took like 2 days and some help from you beautiful people. https://streamable.com/vv4008
I also had to slaughter a lot of villagers
np
Genocide
No, that’s the right emoji
lmao
?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.
fun fact: you can send sentences in one message instead of three!
same answer
i have 10 years of java experience
i just wanna know how to make a method
thats all
Sure
then you should definitely know how to
no i dont
then you don't have 10 years of java experience
and should follow the above tutorials
i do
Perhaps he means coffee
i have known what java is for 10 years
as have i; that does not mean i have 10 years of experience in it
You have not written a single line of Java code. Read the tutorials.
yes it does lolololol
experience means active usage and development
Damn I'm a brain surgeon and never knew it
nice
you play too much among us xD
ur sus
ok kid

trolls
Megasus
leeman what does that mean
we should join #690688600895127683
?ban @tidal cairn
Done. That felt good.

gg!
wazzup
I made it just in time
lmao
!ban @sage swift
oh no
oki bye now 
so shut the fuck up
Imagine being unverified
do you want to kiss
bro that sussy
gecko is a hecko
gecko is a girl?
thats cheating /:
ye

have fun hecko
I wasnt really paying attention tbh
my voice was too high to hear
All i heard was a dude
:cock:
(.)-(.)
hey daddys
i just joined 😦
he's playing lunar client 1.8 he cant be banned
see
suck my short shlong
sus
@dusty herald banbanban
?paste
lmao
just ignore him and let him talk to himeslf.
s and p are nowhere near each other on the keyboard
wtf dude
Why does CraftChunk#getEntities iterates all entities in the world?
What the fuck @dusty herald
what
Lazy ass
i already kicked them 😂
idk
lol
But you are
yes
So that means they’re verified right????
no
Yes??
no
where do you see the verified role
Y'know what that's a good point
how can i check if there are other entities in a players boundingbox?
a
what is the problem?
https://paste.md-5.net/jikiquxage.css
Blocks is not an enum 🤔
it is an enum
public enum Blocks {
CLAY_POT(create(Material.STICK, "block.archaeology.clay_pot", 10, "clay_pot"), Material.BARRIER),
POT(create(Material.STICK, "block.archaeology.pot", 20, "pot"), Material.BARRIER);
private final ItemStack item;
private final Material material;
Blocks(ItemStack item, Material material) {
this.item = item;
this.material = material;
}
public Material getType() {
return material;
}
public ItemStack getItem() {
return item;
}
public static Blocks getBlock(String custom_block) {
return Enum.valueOf(Blocks.class, custom_block.replace("\"","").toUpperCase());
}
}
what's the package
Error from:
for (Blocks blocks : Blocks.values()) { // <---
blocks.getType();
}
Try in your Enum.valueOf(Blocks.class using Blocks and not the class. Its asking for a type, not an actual class.
Blocks.valueOf throwing that exeception too
blocks.class
it's enum
I have no ide up and about to hit the sack so can;t help, sorry
cant you do Blocks.valueOf
ehm
show the Blocks.valueOf code
full error.
https://paste.md-5.net/wocesocaho.coffeescript
have you got a bad import or something? Like wrong class?
public static Blocks getBlock(String custom_block) {
return Blocks.valueOf(custom_block.replace("\"","").toUpperCase());
}
the Blocks enum in nms is like Material
Bro please do not use enums for custom things like that
why if i need?
Make it expandable
If you ill make it as regular class and use some form of registry it gonna be expandable
Other developers can add their own custom blocks as addons 🙂
but harder
why i need this if enum is exists?
Again, extensibility, р а с ш и р я е м о с т ь
Bukkit material enum was a big mistake
Same with biomes, potions, entity types
public static final fields is awesome too
ough
rewrite the code for the fourth time. I will try.
public static final String
FIRST = "first",
SECOND = "second",
THIRD = "third";
перестройка
что вы несёте
welp
яйцо
so i have been working on a project that i have had to code a custom WebSocket server for a plugin but i have never messed with it in java and i was wondering if someone would be able to point me in a direction to learn how to use websockets within a plugin
you use them exactly as you would in any java project. No differences
Well - dont use them from within an event listener if it is blocking
What is the usecase for it?
well the websocket server i have coded is reading data from an api and the data i am getting from that api will be sending it to this plugin and depending on the data i get it will spawn a horde of mobs around a player that has it enabled for them to use
Why is the websocket necessary, cant you just go spigot -> api?
it seems like an extra step
well the api i am using isnt a websocket itself the api it using something called SignalR
Right, well you can continue using your websocket then. What is the trigger for this horde. is it an event listener or a command?
or something different
Cause i would reccomend doing this async rather than sync in order to prevent delays
well this will be the data that i am gonna using from the api in the plugin
countByFrames: { Bronze: 1, Silver: 0, Gold: 0, Designer: 0, Platinum: 0 }
i am wanting to take the data from the bronze silver gold and platinum then each tier with the number next to it have it spawn a mob with that number and each tier will have a certain mob that it will spawn
well the websocket will be an open connection so when ever it gets the data from the api it will just send it so i was just planning on making some so that it would just do it when it got the data from the websocket
Hey, I am currently trying to register a scoreboard in 1.17 but it doesnt work:
java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.IChatBaseComponent.mutableCopy()" because "this.e" is null
at net.minecraft.world.scores.ScoreboardObjective.g(SourceFile:46) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at net.minecraft.world.scores.ScoreboardObjective.<init>(SourceFile:24) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at net.minecraft.world.scores.Scoreboard.registerObjective(SourceFile:57) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:48) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:34) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:1) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
In 1.15.2 it works tho
Send the code Leoo
Riiight i understand you now
Main.sc = Bukkit.getScoreboardManager().getNewScoreboard();
Main.sc.registerNewObjective("Tribe Wars", "", "");
Lines 364 and 365
(line 365 is the error)
post the full error as there is nothign but MC/Spigot there
java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.IChatBaseComponent.mutableCopy()" because "this.e" is null
at net.minecraft.world.scores.ScoreboardObjective.g(SourceFile:46) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at net.minecraft.world.scores.ScoreboardObjective.<init>(SourceFile:24) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at net.minecraft.world.scores.Scoreboard.registerObjective(SourceFile:57) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:48) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:34) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard.registerNewObjective(CraftScoreboard.java:1) ~[spigot-1.17.jar:3160-Spigot-f773da8-295ab08]
at ro.ang3l.battle.Tools.Tag(Tools.java:365) ~[?:?]
at ro.ang3l.battle.Main.onEnable(Main.java:43) ~[?:?]
well... like ElgarL said just treat the websocket like a normal websocket client and listen for the messages
Google is your friend for that
You must be doing something strange that you haven't shown us. Scoreboards work fine with no code changes in 1.17
Nope I am not
Can you send the whole method
Then it doesn;t like your empty strings in the objective
ohh thats a point ^^
I am working on someone elses code (which is horribly miserable) and it worked with empty strings in 1.15 and I entered random characters and now it works
maybe try and find some character to fill it instead then
minecraft doesn't support the full unicode
but there may be some character that you could use
I cant post screenshots here, right?
k
make sure to link the image, not the webpage
the site is slow as shit and full of trash and bloat and ads and scripts
I have this problem that whenever I try to place a block at a negative location, it is one block off.
https://i.imgur.com/BhQPCDz.png
I think it has something to do with the block coordinates being one block off when the regular ones are negative. And no, it doesnt have to do anything with rounding bc when I am standing at exactly -279 the blockcoordinates are still -280.
good job
How should it round if I am standing at almost exactly -279
like I explained yesterday
the values are rounded towards negative infinity
-79.018 rounds to -80
And what about -79 exactly?
79.018 rounds to 79
that is either -80 or -79
i don't remember which
doesn't matter, either
-80
as a player can not practically stand at the exact border
without either hacks or sommands
something of a challenge
and no, the block coordinate is not "off"
the block coordinate is the coordinate of the block you are in
if the coordinate appears to be "off", you are fucking it up somehow
is it possible to create a coloured command argument suggestion like in vanilla commands?
if you are trying to set teleport coords or something use the block Location add(0.5,0,0,5). That will set you at the block center.
yes, use brigadier
https://i.imgur.com/jCOeOwi.png I think that solves my problem
you should not need to do that
again, if the location appears to be "off", it's because you're making it "off"
are you storing the location and then loading it back in?
yes
I guarantee you are converting to an int at some point
🤯
yes
thats doing your rounding
umm
The fix is to stop storing it as ints
lemme check
doubles
lmao
it does round if you store as ints
Like -102.556 goes to -102
^
Typing mistake
answer is still the same
uhh okay
afaik it will not just truncate off the decimals
you storing as ints is causing it to be rounded
store as doubles and you will be fine.
if you absolutely need to store it as ints, Math.floor it
Works now thanks, the mistake wasnt obvious enough for me (but it was still weird that a negative integer somehow turned into something different when converted to double)
numbers can be strange sometimes but each operation performed on them is discrete and documented
if you run through your code and look up the operations you're performing, it will make sense
the lesson to learn here is that rounding and truncating aren't as simple as one might think; there are many ways to do each
If at any point you are using doubles and something seems up ALWAYS suspect rounding issues.
i had 2.5 million logs in my chests
Umm next problem (or isnt but I didnt find anything on google)
I need to place written signs and playerheads onto a wall.
Problem: https://i.imgur.com/5ZOB1om.png
after smelting 6 million logs into coal, I has 13 million coal
ignore physics Leoo
how slow were the furnaces in 1.9.40?
it took 4 hours to smelt one item
Same with the signs: https://i.imgur.com/B8yG5Do.png
hmm?
well signs and heads on walls are wall_head and wall_sign
ok
wall_oak_sign etc. respectively
get the clicked block face
sorry - i thought you meant they were being destroyed
if it's top, use a standing sign
- OAK_WALL_SIGN
I started a plugin with the bukkit API but now i need some features from spigot, is there anyway i can replace bukkit by spigot ?
it's 3 am
if it's anything other than top or bottom, use a wall sign
ty didnt know it was so easy
nope, youre stuck on bukkit sorry
set its directional property to the opposite of the clicked blockface
Spigot is a fork of bukkit lmao
I know
uhhhhhhh
In my pom.xml file i guess
i don't remember what standing signs use
BAD troll!
are you asking if you should switch out the bukkit depedency for the spigot one?
We need a pointy stick we can jab gecko with when he misbehaves.
if so, then yes
okay thanks
gecko is too based and redpilled to give a shit about your sticks
Where can i find what to but as a dependency though
Spigot-API
I have ```xml
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
org.spigotmc and spigot-api
okay thanks !
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
or your link works too @opal juniper
How do I add text to a sign and change its orientation?
^^
get the state and data and cast to the corresponding type, then invoke the needed methods
is this normal? what...
then update state by calling state.update
and update data by calling block::setblockdata
Yes, thats a game called Minecraft
i dont think so. but also could be. im not familiar with the new generation
how long have chains been generating in mineshafts
not in 1.16
Block data is at getBlockAt(loc).getBlockData(), and where is block state?
seems kind of silly
but - they may now
getstate
i reckon it is either player made or a bug
player made, on my test server
shitty vines
idm them
generation sucks
adds some mood lighting
i was saying, yea, sure, player made on my test server
all of the structures are shit and generate like ass
ahh ok
as in, not player made
villages especially
yeeah
there's a plugin for it
i heard the author is a pretty cool guy
oh that reminds me
is there an api way of forcing a sapling to grow
yes
even setting the age to max age still requires it to receive a random tick to grow
how i can to create a list of custom blocks in class, like enum?(enum works shitty)
bone meal
that seems really dumb but I guess i'll give it a shot
while (block.getType() != Material.(wood)) block.applyBoneMeal()
or some shit like that
Maybe Tag?
what
watch the server crash when I try to do that with a sapling that can't grow
maybe put some logic in there 😄
yeah i'll have to i guess
that doesn't really help cause there isn't a global wood one. you would have to check multiple tags anyways
wait i take that back
there is
yeah use the tag LOGS
🙂
you can use also: block.getType().name().contains("LOG")
yeah
that will surely be performant
Umm
CraftWallSign sign = (CraftWallSign) loc.getWorld().getBlockAt(tmp).getBlockData();
sign.setFacing(bf);
loc.getWorld().getBlockAt(tmp).setBlockData(sign);
Doesnt do anything
why are you casting it to a craft sign
Use bukkit sign
don't use nms there
uhh well I casted it to Sign and the error was "craftwallsign couldnt be casted to sign" so I used this xD
why are you casting craftwallsign to sign?
create new Sign
don't cast it
you shouldn't cast it
use this:
https://imgur.com/KVDBUsa
1 - blockstate
2- block
Can anyone just send an example on how to place a wall sign, add text and specify the orientation?
see spigot javadocs
that isn't long
wtf
[13:15:47 ERROR]: Error occurred while enabling zACustoms v1.0-SNAPSHOT (Is it up to date?)
java.lang.ExceptionInInitializerError: null
at ru.zacustoms.Main.onEnable(Main.java:54) ~[?:?]
for (Blocks blocks : Blocks.values()) {
What is Blocks
is enum
or i need to decide this problem
or i need to create class instead enum, but idk how
😕
Okay setting text works now.
How do I set the facing exactly?
see javadocs
that is blockstate
What are you trying to do?
make a for
I mean, what is your goal?
run method Blocks.ALL_FROM_BLOCKS.getItem() and no more
Oh, is that an enum that you created?
it is
Oh, I don't know then, sorry.
exceptionininitializer would imply that the class can't be initialized
org.bukkit.block.data.type.WallSign matSign = (org.bukkit.block.data.type.WallSign) b.getBlockData();
matSign.setFacing(bf);
sign.setData(matSign);
``` Uhh
check your enum declarations and static initializers and shit
i've the next:
Caused by: java.lang.IllegalArgumentException: ru.zacustoms.blocks.Blocks is not an enum class
at java.base/java.lang.Class.enumConstantDirectory(Class.java:3791)
at java.base/java.lang.Enum.valueOf(Enum.java:267)
at ru.zacustoms.blocks.Blocks.valueOf(Blocks.java:26)
at ru.zacustoms.blocks.Blocks.getBlock(Blocks.java:77)
at ru.zacustoms.blocks.NoteBlocksWrapper.<init>(NoteBlocksWrapper.java:18)
at ru.zacustoms.blocks.Blocks.create(Blocks.java:86)
at ru.zacustoms.blocks.Blocks.<clinit>(Blocks.java:28)
what does your class look like
?paste it
a lot of code...
https://paste.md-5.net/tomavefenu.cpp
you don't want to call Blocks.valueOf in a static initializer of Blocks
?
Seems like quite the circular dependency you got there
read the stack trace
i'll fix that later, i know
basically your enum isn't done initialising but you are already asking for its values
is it even an enum
from the code send, looks like it
i would init it in Main
using for
that's not relevant
you are querying the enum's contents inside the enum's initializer
read the stack trace
basically move the notes block wrapper from the create method to somewhere outside of the enum
concerning that it "wraps" the blocks enum, that shouldn't be an issue
tho like new NoteBlocksWrapper(custom_block, note, instrument); a constructor that isn't assigned is also a bit fishy xD
that's simply put
ah
i see now
i understand
i need to avoid it
thank you all, i'll try.
With bukkit config api, is possible to stop breaking long lines in two parts?
- chance:(10), display:(ACACIA_BUTTON 1 name:ieat lore:ieat), item:(ACACIA_BUTTON
1 name:ieat lore:ieat)```
This should be in one line
That's not something I can do
you're writing it down, surely you can change it too
Is the format used by CrateReloaded and my plugin - GUIHelper - is a tool to create configs for other plugins
So ...
Unlees I misunderstand you
i mean that is just a serialised hashmap looking thing right?
deserialise it then
I think we are talking about different things
what are you trying to split
I serialize items to that format, the entire system is done, only this little thing that break lines at some point is left
After my mate pushed some stuff to our repo I can no longer package my plugin
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project SpigotServer: Fatal error compiling
Fixed by updating Lombok.
Hope you meant removing
Lombok is cursed
Hello guys and girls,
I am having a problem Placeholder API related and didn't find a thread talking about this problem or this approach. Now that you know what its about I will tell you the exact problem I have:
I want to use dynamic Placeholders, which means that I do not hardcode my placeholders, like you would normally do it (%plugin_name_of_player%) but I want a dynamic, which generates on start of program.
So lets say my plugin creates groups, that you can add players to. These groups can be configured in my config.yml. In this example, we say I created group x and y
Now I want to return a String via Placeholder API of all users inside of group x. Normally I would create a Placeholder looking like %plugin_players_of_x% but we do not want to hardcode x.
I tried to solve this by creating a case where the Placeholder, that will be requested in my Plugin, just has to start with "players_of" and then iterate through the groups I got from my config. But it seems that it does not work that way.
Do you know what would be best practise here?
someone knows how i can retrieve properties from other plugin? this one isnt working
Gaby not that link here
excoos me
Lombok is kinda cursed lol
how come
I mean if you really disturb yourself on a language with extreme verbosity you better go with kotlin imo.
Well I mean it's an extremely popular tool
LOMBOOOK
windows 10 is extremely popular too
hypickle as well
shit is popular among the flies
Yeah but it fucks with source codes cuz decompiled code won’t look like source code
Yeah but is that really a bad thing
Which fucks with IntelliJ but else than that lombok has great features
Yes
As conclure said, if you dont like the boilerplate, use kotlin
@ivory sleet help me if you are a helper smh conclure
in what way

in other words he is orange
For me it didn’t add the class properly to the classpath but long time since so probably fixed by now I hope
prolly
Yeah haven’t banned anyone in a week or so which is pog.
satan worshiping month is almost over
Lol
Satan worshiping 
Not in here though
pride is the first of the 7 deadly sins
the pride flag has 6 colors instead of the biblical 7
in the bible 7 represents completeness and perfection
Lmao I guess
6 represents imperfection and imitation
666 is the number of the beast
the pride flag lacks indigo, which represents unity with and belonging to god
god creates, satan imitates
pride month is an elaborate ruse by the deep state to get the masses to worship satan
I mean I would just say pride month is pride month
Yeah well most people don’t think of/ associate pride as that sin prolly.
and that's because of decades or centuries long brainwashing by the underground powers that follow satan

I thought you weren't religious? o.O
i'm not
then why are you worried about if its a sin? lol
because lots of people still care about religion and sin and whatever
i'm just playing the devil's advocate
lol
but yes, I do have a religion
it is one I made myself
I call it maninism
in maninism, the ultimate form of all life and existence is the real man
i don't know about that
a movement like that probably exists
and probably by the same name
these days anything is posssible 😂
can we join your custom religion?
do you seek to be real men?
the real son
the real son of who
the real man
they look like whatever they want
and whatever they want is how they look
their forms are perfect, but perfection is defined in terms of being the real man; the real man is not defined in terms of perfect
so will the real man turn into a real lad, if he wants one?
the real man is a real man regardless of appearance
anyone who seeks the path to be a real man is automatically a member of maninism
we currently have over 6 million members
oh nice. brb. will write it down into my instagram description.
member of maninism
he/him/man
How to make recipe visible to player?
wall skull vs skull
^^
How do I do something like while(player.getInventory().getHelmet != null)
Or would that work
getEquipment
nah
if the players helmet is null you will freeze the server.
use a scheduler
Aight
Does the getMaxHeight() method in World provide any extra height provided by data packs?
Ummm
i mean i guess it depends on the implementation of the datapack
i would assume yes but idrk
i guess you gotta just try it and see
player.sendMessage(Color.BLUE + "You have used the strength ball you will receive strength for 30 seconds");```
so
it gives me strength for only 1 seconds and strength 3
and the chat message just does "Color:[rgb0x00FF]You have used the strength ball you will receive strength for 30 seconds"
can i edit an a hologram with a boolean?
like whan boolean is true the holo will say "true"
and whant the boolean is false the holo will say "false"
...
The duration is in ticks, and amplifier starts from 0
THAT IS MY FEATURE!
Hey, quick question:
I tried to create a wand that shoots a fireball which is invisible and creates red particles.
I got some help from somebody else. He sent me the following class:
https://hastebin.com/wufugoyimo.java
and the following listener, which then makes the fireball shoot.
https://hastebin.com/egosazefip.csharp
The fireball is shot, but it is not invisible and the following error is displayed in the console:
Caused by: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "this.manager" is null
at de.straussfalke.questplugin.listener.EntityHider.<init>(EntityHider.java:83) ~[?:?]
at de.straussfalke.questplugin.listener.ItemListener.handleFireWand(ItemListener.java:56) ~[?:?]
does anyone know how I can solve this? Thanks in advance
Did you forget to depend on Protocollib
that could be. I have also already received the tip that I could enter the following in the plugin.yml:
depend:
- Protocollib
But then nothing worked on the server anymore
You need to add that
ok but how?
hmm ok. Does this have to come before the compartment "commands" or after?
Hello everyone, random question, can't seem to find this anywhere on google: when is an entity's entity id (the integer one) get set? Is it on spawn?
I put it before, haven't tried after. Better put it before, just to be safe.
Ok, I have done that now. However, when I start the server I now get the following error message:
Could not load 'plugins\questplugin-1.0.jar' in the 'plugins' folder.
org.bukkit.plugin.UnknownDependencyException: Unknown dependency Protocollib. Please download and install Protocollib to run this plugin.
By the way, my Plugin.yml looks like this:
name: QuestPlugin
version: ${project.version}
main: en.straussfalke.questplugin.Main
api-version: 1.16
authors: [sf]
depend:
- Protocollib
commands:
qcreate:
Permission: quest.spawn, quest.kill, quest.edit
giveitem:
permission: item.fireball, item.command
Does anyone know how to download protocollib properly, or have a tutorial from youtube or a website for me?
do you have protocollib
in the plugins folder
;-;
It is ProtocolLib with a capital C and L
also maybe chage it to ProtocolLib
i think it shouldnt be case sensitive really ;-;
but i guess thats how it works ;-;
Am I doing anything wrong? The potion effects aren't being removed and it's printing "here"
System.out.println("here");
playerJoined.getActivePotionEffects().removeAll(playerJoined.getActivePotionEffects());
I looked if there was a function to update it (like the inventory one) but couldn't find one
as said not yet
Download it from their spigot page
well first of all you need it
second of all its case sensitive i think so try putting there ProtocolLib
Can you get all the blocks a player can see
how can i solve this problem? i make the class in another class
registerEvents()
U put registerEvent
thanks
alsoo if you dont want your plugin to die when you dont have protocollib try using softdepend
@opal juniper
What are you doing?
.registerEvent(this,new MyListener());
You have one too many parenthesis
Put your mouse over the error and it tells you btw….
still
maybe is something about this class?
replace the whole line with
getServer().getPluginManager().registerEvents(this,new MyListener());
Cannot resolve method 'registerEvent(example.example.Example, example.example.MyListener)'
that error always appears
switch it to registerEvents sorry
k i thought it was plugin then listener
getServer().getPluginManager().registerEvents(new MyListener(), this); <-- do this sorry
ok I have now downloaded the following from the Spigot site and put it in my plugins folder (of course I have also reloaded): https://www.spigotmc.org/resources/protocollib.1997/
but I still get the same error in the console
i told u
I know this might not be the place to ask; but out of pure curiosity, how on earth do you make a custom server experience on Bedrock Minecraft, is it possible without if you arent a 'verified' or partnered company? I would love to make a bedrock server but I see no resources on how to even start. Just wondering if anyone knows if its even possible?
#help-server and restart don't reload.
I have already done that too
okey
Hi. I'm using intelliJ and trying to do a plugin with a config but it isn't working: it's not generating the "config.yml" in plugins folder from server ... Can somebody help?
uh what?
oh sry
time to throw the entire code into a translator again
can you show us your code where you generate it?
ok, I have also tried. Now I get the following error message:
Error occurred while activating QuestPlugin v1.0 (Is it up to date?)
java.lang.NullPointerException: Can't call "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "de.straussfalke.questplugin.Main.getCommand(String)" is null
at de.straussfalke.questplugin.Main.onEnable(Main.java:20) ~[?:?]`
the following is my main:
package de.straussfalke.questplugin;
import de.straussfalke.questplugin.commands.CurrencyCommand;
import de.straussfalke.questplugin.listener.ItemListener;
import de.straussfalke.questplugin.listener.NPCHandler; import de.straussfalke.questplugin.listener.NPCHandler;
import de.straussfalke.questplugin.listener.JoinEvent; import de.straussfalke.questplugin.listener.JoinEvent; import de.straussfalke.questplugin.listener.JoinEvent
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
public final class Main extends JavaPlugin {
@Override
public void onEnable() {
NPCHandler npcHandler = new NPCHandler();
ItemListener itemListener = new ItemListener();
getCommand("giveitem").setExecutor(itemListener);
getCommand("qcreate").setExecutor(npcHandler);
getCommand("currencycreate").setExecutor(new CurrencyCommand());
PluginManager manager = Bukkit.getPluginManager();
manager.registerEvents(new JoinEvent(), this);
manager.registerEvents(npcHandler, this);
manager.registerEvents(itemListener, this);
}
@Override
public void onDisable() {
// Logic to shut down the plug-in
}
}
and
getCommand("currencycreate").setExecutor(new CurrencyCommand());
is line 20
yes
name: QuestPlugin
version: ${project.version}
main: de.straussfalke.questplugin.Main
api-version: 1.16
authors: [ sf ]
depend:
- ProtocolLib
commands:
qcreate:
permission: quest.spawn, quest.kill, quest.edit
giveitem:
permission: item.fireball, item.command
not?
Oh, you mean the Command... I thought you meant ProtocolLib
Thank you for the advice 😅
Ohh Cool :D
ok so far everything is working again for now. However, the fireball that is fired is still not invisible.
The Error Message:
java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "this.manager" is null
at de.straussfalke.questplugin.listener.EntityHider.<init>(EntityHider.java:83) ~[?:?]
this refers to the following class:
https://hastebin.com/wufugoyimo.java
and the line specified in the error message is this one:
manager.addPacketListener(
the error even tells you what is wrong 😭
Hey there quick question, for Player#addPotionEffect, does this automatically stack with existing effects or should I do that manually?
automatically stacks
Awesome. Thanks!
Yes, I know. However, unfortunately I do not know how to correctly assign a value to this.manager.
so I should add the line this.manager = ProtocolLibrary.getProtocolManager();
after manager.addPacketListener(?
yes
are you calling this constructor at some very weird point in your plugin initialisation phase ?
how i can set Entity for spawner? I need to use entity equipment
like, during construction of your main class or something
don't think there is API for that aniby
Hey guys ! IIRC I saw once a plugin that make not required to restart server each time we reload a modified plugin ? what was it ?
methods must be.
Plugman?
not as far as I know
yeah that's it, thanks !
so you are creating this instance in your onEnable ?
for next issue use #help-server. Here only coding
regarding your spawner tho. https://papermc.io/javadocs/paper/1.17/org/bukkit/block/CreatureSpawner.html shows (even on paper) no method to specify entity equipment for a spawner
declaration: package: org.bukkit.block, interface: CreatureSpawner
there is however https://papermc.io/javadocs/paper/1.17/org/bukkit/event/entity/CreatureSpawnEvent.html, which you might be able to use to apply the equipment yourself
i needn't spawn it
i need simply put entity in spawner
custom blocks is so hard.
Yea no, there is no API for this
NMS maybe?
bad
hah. /data get block x y z exists.
is it a good way to store not accessible data? Something like discord bots, they store information that people can't get
depending on your plans
I want to store player information that that player can't get, like someone can download this plugin but can't get any information
make a player wrapper class.
create class, create hashmap, create public state DATA data for your information and create class constructor
oh good idea, dont know how i didnt think of that
i'm using "Build artifacts" from IntelliJ
try to use maven
https://hub.spigotmc.org/javadocs/bukkit/ everything is here
I get spigot and mongodb from there, but don't know how to compile, can you help pls?
answer from genius
wtf dude
I mean, I tried and it generated a jar with 9kb when the artifacts generate a 500kb jar file
Does anyone know how to store custom objects in the PersistentDataContainer?
On spigotmc.com there is tutorial. You can find it
@eternal night ?
is there?
remove from import api or something other
i mean
what code are you using to actually generate the file
pom.xml if maven
the file in your ide doesn't mean its embedded in your code
its just there
maybe there is something in the file
but if you never generate that file it will never be in your plugins folder
not loading for me
use ?paste
?paste
There is nothing close to what I asked.
wtf
serialize it
and deserialize it if you get it back
I'm trying to show the content of pom.xlm, the structure of the project and maven option i clicked at the same time haha this works: https://prnt.sc/16gv7fx
what is your problem now? your config.yml or your pom?
the config.yml is not getting created so I checked on internet and there was only 1 solution that was to add this "resources" to the pom.xml, but it's not working still
show me your main
Hey there,
I'm trying to spawn a floating item using packetwrapper and i tried this but it doesn't show up anything without an error...
public FloatingItem(Player player, ItemStack itemStack, Location location) {
this.spawn = new WrapperPlayServerSpawnEntity();
this.destroy = new WrapperPlayServerEntityDestroy();
this.eID = (int) (Math.random() * Integer.MAX_VALUE);
this.spawn.setEntityID(eID);
this.spawn.setUniqueId(UUID.randomUUID());
this.spawn.setX(location.getX());
this.spawn.setY(location.getY());
this.spawn.setZ(location.getZ());
this.spawn.setObjectData(0);
this.spawn.setType(EntityType.DROPPED_ITEM);
this.spawn.sendPacket(player);
}
any idea?
Quick question dose anyone know why this dosen't work? It dosent print an error or anything it just dosent do anything, did I do smthing wrong?
seems you don't understand what does return mean
I do
Not in a for loop you don;t
Yeah that one was a mistake im just testing things out
It messages a player its pretty self explanitory
Hello, I am trying to make it so people keep their potion effects on their deaths. I save it in a HashMap. But when I die with potion effects I get this error message in console.
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.add(Object)" because the return value of "java.util.HashMap.get(Object)" is null
Here is my code:
public HashMap<String, List<PotionEffect>> effects = new HashMap<>();
@EventHandler
public void onDeathEvent(PlayerDeathEvent event) {
Player plr = event.getEntity().getPlayer();
for (PotionEffect e : plr.getActivePotionEffects()) {
effects.get(plr.getName()).add(e);
return;
}
}
public void onRespawnEvent(PlayerRespawnEvent event) {
Player plr = event.getPlayer();
for (PotionEffect e: effects.get(plr.getName())) {
plr.addPotionEffect(e);
}
}
}
effects.get(plr.getName()) returns null
