#help-development
1 messages · Page 961 of 1
I abuse thenAccept
You need to configure the server to use a custom generator. Even if your overwrite this method.
i endeed up with this
bruh I found it. Half of the wiki seems hella outdated
Not sure if it’s up to date but https://www.spigotmc.org/threads/how-to-create-a-custom-world-generator.545616/
The spigot wiki is community driven
just found that exact thread haha
Maybe that should be an addition in the getDefaultWorldGenerator javadocs
Feel free to update it
You feel free to update it. I have a few PRs pending and i need to make them work before i start more.
Bruh
I said feel free to update the spigot wiki page he was looking at
I don’t got time for coding 🥲

looks like its mostly relevant if not all from what I can tell
what would I use for generator: plugin though? I used the same value as for the name variable and while I did see the plugin load much earlier I still see the vanilla world generation
plugin should be the name of the plugin
With whatever is in your plugin.yml under plugin name
world should also be the name of your world
typically its world if you leave everything as the defaults
Yo smile
oi
I got something that'll make you hella sad

yeah I got that, but still the vanilla world
i dont want to scroll down... im seeing the first few lines and im depressed already
Luckily the last 10 lines is the stairway to heaven
Holy
are you configuring that on the bukkit.yml on the server? not your plugin's plugin.yml
ugh what how can you even work with that

banger
Good old
huh so it's not just plug and play? I added that to my plugin.yml but I thought it actually changed something
oh I really did misread that wiki post
excuse my stupidity, thanks for the help

Are all players disconnected (with the quit event firing) when the server shits down? Also what about the server crashing/being shut down by ctrl+c/closing the server console and ending the task?
more like a highway to hell
I was surprised that this is still a thing, but all players are disconnected after the plugins are unloaded.
This means they quit without any listeners registered.
surprisingly, this wasn't the solution. I did however notice that the spigot.yml contains a world generation section, but I don't have a world named default so I'm confused as to what to think
So if I use your data managing model i should also safe all player data onDisablev
*?
Oh god where do you get these from?? Jesus
✨descriptive✨
I do need to add that to the spigot.yml, not the bukkit.yml
does that file only exist for legacy compat or what?
Yes
Or kick all players in your onDisable
ugh
Oh right that‘s a way ig
That would be easier
And ig crashing the server is not a case we can handle huh?
Why ugh? :(
Oh okay funnily enough i already do that in my shutdown command but ig it would amke more sense to put it into onDisable if the user for some reason decides to use the minecraft:shutdown command
what why?
please can someone help me i can pay
?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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
?services also
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
pay how much 😆
60$
its just 60$ thats nothing
i need a engine for mods + plugins
to start darkrpg from curseforge mod pack
No officially supported server jars for that
Youll find some here and there but none that support 1.20 and most are buggy
I think there's Arclight, but like buoo said, not supported and the likelihood of all the plugins you want being functional on Arclight is fairly slim
So, I dunno where this error comes from, I can't see why anything there should be null, does anyone know how I may fix this error?
private final static List<ItemStack> toolUpgradeItemsList = List.of(
new ToolUpgradeBuilder(Material.BARRIER, 1).setDisplayName(ToolUpgrades.TOOL_UPGRADE_DEBUG.getUpgradePrefix()).setLore(List.of("§8Tool Upgrade", " ", "§7When applied on tool:", ToolUpgrades.TOOL_UPGRADE_DEBUG.getUpgradeDescription().listIterator().toString())).build(),
new ToolUpgradeBuilder(Material.AIR, 1).setDisplayName(ToolUpgrades.TOOL_UPGRADE_NONE.getUpgradePrefix()).setLore(List.of("§8Tool Upgrade", " ", "§7When applied on tool:", ToolUpgrades.TOOL_UPGRADE_NONE.getUpgradeDescription().listIterator().toString())).build(),
new ToolUpgradeBuilder(Material.DIAMOND_PICKAXE, 1).setDisplayName(ToolUpgrades.TOOL_UPGRADE_THREE_BY_THREE_BREAKING.getUpgradePrefix()).setLore(List.of("§8Tool Upgrade", " ", "§7When applied on tool:", ToolUpgrades.TOOL_UPGRADE_THREE_BY_THREE_BREAKING.getUpgradeDescription().listIterator().toString())).build()
);
public static void init() {
toolUpgradesIndexes.put(-1, ToolUpgrades.TOOL_UPGRADE_DEBUG);
toolUpgradesIndexes.put(0, ToolUpgrades.TOOL_UPGRADE_NONE);
toolUpgradesIndexes.put(1, ToolUpgrades.TOOL_UPGRADE_THREE_BY_THREE_BREAKING);
}```
(Ignore formatting issues, thats due to discord)
wait, errror is too big
?paste
This is the error I'm getting
https://paste.md-5.net/tupoyoniyi.cs
the above shown code is in ToolManager btw
ur collection is immutable
meaning a collection which u cannot edit
thats cuz u do List.of iirc
those are immutable
bruh
have you registered your command in plugin.yml?
and in main class
Hello! I have ChatEx plugin for chat, which shows local and global messages to chat. I want to add hover message on player's name with a little information about player. Can I just add hover message to already existed message or it needs to create a new message? Cause I have created a hover message but now it sends new created message in chat instead of ChatEx message. Can't send it in screenshots cause verify bot works shitty.
?paste
did you register your command in your code as well?
?pdc
you wrote getcommand "cow" but in plugin yml you have
commands:
command:
Here's a pro tip
While it's good to get inspired from sites and stuff
You only learn the basics by doing it yourself
Use the content on the websites for inspiration but don't just blindly copy
True this. That‘s the reason it took me a looooong time to understand the basics of java and plugin programming
If you copy, always make sure you understand what you copy.
So that you won‘t have to read up on it again
No AI copilot until you can write the code yourself
It's a copilot not a drunk teacher
Knowns anybody? Can I add hover message to already existed message or I need to rewrite ChatEx code for this?
It's development question
How are you adding it zunynz?
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
Just in async player chat whatever?
yeah with asyncplayerchat event
Because I dont think that supports hoveravle text for the player name
AsyncPlayerChatEvent is the bukkit one
So you might have to make the player name empty and append the hoveravle name in message
Provides you your usual message
If you're using paper you have AsyncChatEvent which passes a component and you can do magic with it
I could be completely wrong tho
You’d have to cancel the event and manually broadcast a component message
https://paste.md-5.net/dovahuheri.java
I have tried to send original message and made something like this
It sends original message but hover message just sends in chat
That wouldnt send to anyone else
Well here's the problem yeah
you don't know how text components work ._.
?bungeechat
maybe?
?components
For hoverable, clickable, hex colored, or otherwise complex text, use the component API. Documentation can be found here:
https://www.spigotmc.org/wiki/the-chat-component-api/
yoyo is there a PathfinderGoal that makes the entity not go past a specific bounding box?
Uh
ik enderdragon has something similar but idk where it is
I really doubt that
I'll check thanks
enderdragon can't get out of the end thing tho
The enderdragon's pathfinding is unconventional
Go for it
Would be pretty easy to make a goal for
do i have to use nms or will i find that spigot has a way after i use nms
just making sure
If(out of box)
Dont()
You need NMS
🗿
Yeah nms for pathfinders
Spigot doesn’t have a pathfinder api
Unless you use paper
i use paper
Then we can't help you, you're best asking for help in the Paper Discord. idk why you came here to begin with
if spigot can do something then paper can do the same thing, he said unless you use paper so there might be a way to do it with paper without nms
paper discord gives less support so i ask here
so there might be a way to do it with paper without nms
Yes, there is
Which means Spigot does not
We are Spigot, it's Paper-exclusive API, therefore we cannot help
alr ima ask there
does java have a priority map?
i want to get the first element that matches the best
big changes 😄
ah yes Bug fixes
how do i check if a location is within 2 bounds
i should get used to commits after each change
an if statement
the comparison think about it
You need to check if your X is between X1 or X2. First it'd be important to get the min x and max x from X1 and X2
now you check if your x is between the min x and max x
Math#min and Math#max are going to be helpful here
x >= Math.min(pos1.getX(), pos2.getX());
so like this?
and repeat it 3 times for xyz?
well that only checks if x is greater than your min value if your checking bounds you need to think about between to points
simplest to think about it in one dimension than add the others. For example how do I check if my point is between 2 points in a line
that is a very easy problem to think through you can than expand that to add multiple dimensions
depends on how often you're doing a comparisson / if you need to store the region
a bounding box only really makes sense if you're storing a region
it's just a quick comparison without a region
then a Bounding Box makes no sense
i think it'd be overkill
because a bounding box just does everything internally you can do very easily if its just a quick comparisson
don't over think it reduce the problem down to a single line first
you have 2 points
X1 and X2 you aren't sure which is bigger X1 or X2
you need to check if MyX is between X1 or X2
wait
i think i understand, something like htis?
x >= Math.min(pos1.getX(), pos2.getX() && x <= Math.max(pos1.getX(), pos2.getX();
this checks if it's between im pretty sure
this is checks between inclusively if that's what you want
what does inclusively mean?
just out of curiosity, do placeholders work in player name tags? I have PlaceholderAPI and LuckPerms to allow me to test however every time, the placeholder appears as if I havent set the placeholders. And yes, I have used /papi ecloud download LuckPerms. Many thanks
Not the tidiest of code I know
EDIT: I am not familiar with NMS as of yet, but am welcome to suggestions regarding it
inclusive means lets Image
X1=1 and X2=5 MyPoint=1
Inclusive:
MyPoint is between 1 and 5 including 1 and 5
Exlusive:
MyPoint is not between 1 and 5 we are not including 1 and 5
yes
i need inclusive so i think i'm gonna use that
that should work for inclusive
you can think of each dimension as just a number line of points
and use booleans to stitch them together
tysm
what is the new alternative to the old PacketPlayOutPlayerInfo packet
How can i block public proxies?
?
Don't add your server to their proxy
Why is your server connected to those public free proxies?
do you mean vpns?
free proxy
how do i make an entity smoothly change yaw
can you please elaborate more
and not instantly change wwhere its head is
That shoud fall under teleport duration
maybe Math.lerp?
Otherwise just rotate it with the transformation
just making sure, does Entity#lookAt do it already or do i have to use lerp
code```scala
println(event.getRightClicked.getUniqueId)
println(npcs.map(_.getUniqueId()))
val npcOpt = npcs.find(_.getUniqueId().equals(event.getRightClicked.getUniqueId))
println(npcOpt)
output```
[17:26:00] [Server thread/INFO]: 47438a32-befb-2b2e-b2c6-d8f60d427331
[17:26:00] [Server thread/INFO]: List(20037d26-4ff0-4379-96c8-0485da384881, 06081321-80dc-4602-a962-166f08aaf220, 32a3ea9b-a8ad-4484-bfca-db2d878244fd, 20064533-9d3b-468e-95f3-975c62476ecb, e62f2901-111d-4c8b-8b27-2dabfe1f76cf, 51b695f3-0e88-444e-96ab-cbcf1e9b9c1c, 3fc7decf-0480-40b1-9e6b-7a12c33f53fd, 55159ab1-ce76-4b43-ae0c-a089c603320b, 5712cb2c-ab16-4d21-a60a-7fd02e7806fc, ce84ae06-e72d-4623-bc3d-d184c10487c3, f9ead9d2-5050-4f1c-be0c-36d86dd42549, 47438a32-befb-4b2e-b2c6-d8f60d427331)
[17:26:00] [Server thread/INFO]: None
```wtf?
47438a32-befb-2b2e-b2c6-d8f60d427331
47438a32-befb-4b2e-b2c6-d8f60d427331
seems like the same uuid to me
why my placeholders from placeholder api doesnt have the colors?
if(p.hasPermission("smc.vipjoin")){
String sp = ChatColor.translateAlternateColorCodes('&', "%luckperms_prefix%%player_name% &r&ese ha unido al servidor.");
String cp = PlaceholderAPI.setPlaceholders(e.getPlayer(), sp);
Bukkit.broadcastMessage(cp);
}
the broadcasted message have colors, but the placeholder no
why?
translateAlternateColorCodes for setPlaceholders
Hello, wanted to know why when i want to install buildtools, it keep loading and create me err.log ?
not sp
setplaceholders first
ok, im gonna try
How can I create a beacon laser without a beacon?
if i put "cp" first it means: "sp is never used"
i tried, but doesnt works.
you dont
Show the message
i cant send photos here
is it client-side?
i think yeah
bump
rip
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
?paste
.
how do you add a resource pack to the server
some people are saying you need to upload it to dropbox why can't the server just give it to you directly
just launch a small http server inside ur plugin
if u dont wanna upload it somewhere
slime
that's the old way to do it
size 1 slime with glowing invis
guy's that a bit off topic but why when i click the "send" button on my keyboard on intelij it crash / freeze
Send the crash report to intellij 😂
T.T
?paste
Hey? Anybody?
?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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
judging by those reactions I don't think he's here to be nice
#general message
how do i make it so you can walk through ghost blocks?
use block displays
The error still exists, but now it's bc of the Map, how'd I make that mutable? as in other parts of my code this worked prefectly fine for me (as shown in replied messsage and few msgs lower to it)
whats the best dummy item
like
if I want to make a custom retextured item what could I use that has no side effects

structure block
I dont want to have to replace them all
can structure blocks be placed in survival
i always used them back when i developed datapacks
Are 180ms for retrieving an object from a MySQL db bad?
(Retrieving and deserializing)
Need some help brainstorming a plugin I want to make...
Survival minecraft servers kind of suck in terms of communication between players, so I want to make a targetting/ping function.
This would essentially be:
- Player does keystroke
- Raycasting to first entity or block
- Apply glow effect to entity or block
- Play Anvil place sound
- Type in chat the name of entity or block + coordinates
The part I cant quite figure out is the keystroke part.... Keystrokes are client-side, so it wouldn't exactly work. Wondering if there's a unique combo of actions a player can do to replicate this
Make a combo where somebody heats in a certain combo while holding a certain item
depends how often and what you're doing
but usually, yes
I don't really want it to be stuck to a specific item though. I want it to work as seamlessly with vanilla survival
Like maybe right-clicking while shifting? I don't know if there's a better way to do it
Raycasting is basically an algorithm to detect something in the line of sight of an object
Serializing, comparing, retrieving, deserializing
Well, those operations are obviously quite expensive
Can describe what you are trying to achieve? You press the combo, and then chat with the person in your los?
if it's a big object
Have you played fortnite/apex or really any other battle royal?
Does CS count as a battle royal?
db is actually locally stored
and is the object big?
not really, but I think it has the same function
you know where you can ping items for communication with your team?
Well, it's a simple pojo
public class UserData {
private String username;
private UUID uuid;
// All args constructors
public UserData(String username, UUID uuid) {
this.username = username;
this.uuid = uuid;
}
// No args constructor for Jackson
public UserData() {}
public String getUsername() {
return username;
}
public UUID getUUID() {
return uuid;
}
}
Or ping locations on the map
well then yes
you could use a few optimizations
local db for a small object
You mean middle click to place a waypoint?
sure
this is essentially what I want to achieve
and how are you planning on displaying this "waypoint"
I wouldn't expect more than like 4ms tbh xD
haha
Deserializing and Serializing operations are the problem, for sure
This….
afaik you cant apply glowing to a block
The glow effect
There is a way to execute code every X seconds/ticks ?
scheduler
thanks !
Right, I’d need to create some invisible entity if it were a block
or use the java scheduler for accurate measurements
Probably a armorstand with a banner on the head
Idk if middle click fires and event
If it does, use Shift + Middle click
But my hangup right now is trying to find a rare-combination of player actions
I think middle click only fires an event in creative
iirc
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
declaration: package: org.bukkit.event.block, enum: Action
#getAction()
@grim hound
[18:40:42 INFO]: [WidenCommons] [STDOUT] Serialized in 184ms
[18:40:42 WARN]: Nag author(s): '[MikesLab]' of 'WidenCommons v1.7' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
[18:40:42 INFO]: [WidenCommons] [STDOUT] Found in 2ms
You were right! haha
nice
I haven't done much with databases
but I'm decently sure it won't be hard to optimize this
like why serialize and deserialize the whole object each time?
Oh, it's an API... Just ease of handling in my projects
please
Hm
ic
You could also just make a "Ping Item", that would be the best solution, and not disturb any players trying to play normally
Yeah. I wonder if there's some other action similar to sneaking that can be paired with RIGHT_CLICK_AIR
Yea there is
Hi, I have problem with my PlayerInteractEvent, because It calls it twice (not always). There is code: https://paste.md-5.net/atoburapuy.cs. I have already checked if event.getHand != MAIN
right, I just dont think sneaking is the best option to pair with it
so I'm wondering what other options are plausible
Show where, are you registering your events
use event#getHand() check
yes, check code - I have already added this
What does that have to do with the double call?
sending message twice
but only in one if
Where are you registering the events
look at comments there: https://paste.md-5.net/atoburapuy.cs
in main class
i have two similar events
Send the part where you are registering it in the main class
but with diferent conditionals
"Two similar Events"
Stream.of(
new PurchaseFurnitureInteractController(this.itemsAdderHook, this.houseService, this.pluginConfiguration),
new HouseInviteController(server, this.houseInviteService, this.messageConfiguration, this.notificationAnnouncer),
new RentController(this.rentService, this.pluginConfiguration, this.messageConfiguration, this.notificationAnnouncer),
new AlertController(this.alertService, this.alertHandler, this.pluginConfiguration),
new PlaceFurnitureController(this.protectionService, this.houseMemberService, this.houseService, this.notificationAnnouncer, this.messageConfiguration),
new OpenDoorController(
this.houseService,
this.protectionService,
this.houseMemberService,
this.notificationAnnouncer,
this.messageConfiguration,
this.pluginConfiguration
),
new OpenChestController(
this.houseService,
this.protectionService,
this.houseMemberService,
this.notificationAnnouncer,
this.messageConfiguration,
this.pluginConfiguration
)
).forEach(plugin -> this.getServer().getPluginManager().registerEvents(plugin, this));
is this what you mean?
omg what is this
registering events? whats wrong with that 😕
I guess I could check if the player doesn't have a placeable block in their hand AND they are sneaking
just check if the hand is empty
they might also be trying to use a shield tho then
True
Maybe empty hand is probably best
check that second hand is empty to
very big instead this u can create Controller interface and declare methods
ehhh that encourages walking around without a shield equiped, which is dangerous
for every controller u need have enable(); for example
For the specific people I'm playing with
@hollow vessel , do any of your other "Controllers" have an PlayerInteractEvent?
yes
Theres your solution
Thats why its firing twice
You're registering the event multiplte time
times*
why?
remove event.getHand() and check how many times fires
because it is two different actions
And have you ever heard of retrieving Objects from your mainclass?
Instead of like
having a massive constructor?
use Singleton
okey
two
but not always and there is a problem
look at my comments in code
private static Test instance;
public static Test getInstance() {
if (Test.instance == null) {
Test.instance = new Test();
}
return Test.instance;
}
private Test() {
}
If u have not empty constructor, use this:
private static Test instance;
public static void initialize() {
if (Test.instance != null) {
throw new RuntimeException("Test is already initialized.");
}
Test.instance = new Test();
}
public static Test getInstance() {
if (Test.instance == null) {
throw new RuntimeException("Test is null.");
}
return Test.instance;
}
private Test() {
// something
}
And initialize your class in onEnable
if need
okay, buy I think this would not fix my problem
This fix your future problems
that wont work for a plugin main class
Remove event#getHand method and check is your code fires more than 2 times
okay
public final class MinesonAPI extends JavaPlugin {
@Getter
private static MinesonAPI plugin;
public MinesonAPI() {
plugin = this;
}
@Override
public void onEnable() {
// something
}
@Override
public void onDisable() {
// something
}
}
what?
what you originally sent creates a new isntance of the class
I need to get an item stack of water bottles, does new ItemStack(Material.POTION) do that or do i need some extra steps?
the stuff you just sent might work
I know it works
im saying this
you cannot use that for your class that extends java plugion
it creates a new instance of the class causing an error
^^
it fires twice
this is better
Yea, because you got the event registered twice
stream builder :>
xd
Your checks might not working
Just use
#registerEvents(event, instance)
instead of your Complicated stuff
this will not change anything
i am registring them the same way
public class EventManager implements Listener {
private EventManager() {
}
public static void callEvent(@NonNull Plugin plugin, @NonNull Event event) {
plugin.getServer().getPluginManager().callEvent(event);
}
public static <E extends Event> void register(Plugin plugin, @NonNull Class<E> event, @NonNull Consumer<E> consumer) throws IllegalStateException, IllegalArgumentException {
register(plugin, event, EventPriority.NORMAL, consumer);
}
public static <E extends Event> void register(Plugin plugin, @NonNull Class<E> event, @NonNull EventPriority priority, @NonNull Consumer<E> consumer) {
plugin.getServer().getPluginManager().registerEvent(event, this, priority, (listener, events) -> {
if (event.isInstance(events)) {
consumer.accept(event.cast(events));
}
}, plugin);
}
public void unregisterAll() {
HandlerList.unregisterAll(this);
}
}
Or u can use this for easy event use
i will delete second PlayerInteractEvent for test, and check if it will fires twice again
kk
working the same
why do you never use dependency injection
so it is not problem with two events
sending message twice
Wha?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
constructor with parameter Plugin?
and declaring class in onEnable()?
pretty much
DI for plugin instance is more annoying than it is beneficial
Static instance field 💪
i use both
can someone help me pls?
Use dagger 💪
Hello there, i'm lost af, since been long time i didnt made minecraft plugin, it seems it changed a lot, how about create a plugin basicly ? I mean, should i create a pom.xml ? if yes what should i put in <repositories>
I'm using buildtools
Why is it, that this map: private static Map<Integer, ToolUpgrades> toolUpgradesIndexes = new HashMap<>();
when adding new values to it:
toolUpgradesIndexes.put(-1, ToolUpgrades.TOOL_UPGRADE_DEBUG);
throws an UnsupportedOperationException even tho, if I'm not wrong, it should be mutable?
show the actual code you are using
two messages above message i replied to
list.of is immutable
oh, sry
thats older code
new one i fixed the one with list
it's only the map which is immutable
how'd I make it mutable? as i used this initilization in other classes and I didn't have any issues with putting stuff into it
?paste the actual code you are using
the whole class
static galore 
too much static
it's a manager
basically every method there is used in one form or another in othger classes
including the map and list initialized at the top
thats no explaination for making it all static
but anyway
whats happening in ToolUpgradeBuilder
since i see you use List.of there
i mean is that error even up to date
since thats the error from before i pointed out the immutable collection
seems nto as the error is saying 21 and it can;t be that as that is just a static map
give use teh current error, not an old one
still the current one
line 25 now tho as i reformatted code to make it look cleaner
wait
its impossible for line 21 in ToolManager to error
https://paste.md-5.net/ahazidiyuf.cs
current error
thats a whole dif error lol
now show us ToolUpgrades
What am i seeing here...
just gonna wrap it in an arraylist right?
Close your eyes
u can
You will never recover
Sorta like looking into the eclipse with no glasses
but i would also advize you to read this thread by our beloved @lost matrix https://www.spigotmc.org/threads/how-to-handle-custom-items.593039/
since its a much better aproach to custom items
Myeah that thread def needs an overhaul
its still better by a few miles
@lost matrix have you googled spigot api questions, the results are quite laughable
I’m sure any resource you put any work into would be better than most
I literally googled "spigot api questions" bc i didnt understand at first.
This is what i found
Didnt know this existed
at least my code works, that's all I really care about for now haha, ik i'm not really good at java
At least it’s not a certain academy
Wait where is the huge verano msg?
What was cmarcos philosophy called?
Stupidism
Database related questions
works now, thx guys
Do you think 66% or medicine drink ever helped brain power?
yoo, such a long time brother. How have you been?
Could be worse
oh nice brother
do you still works with dbs?
im fine too, burning my nuts as usual doing a school work haha
No we all stopped working with DBs. Too much work. Everyone only astral projects their data into another dimension and quantum entangles the bits so the data is always up-to-date.
sort(data) -> "the data is already sorted in another multiverse, go there"
MultiverseSort
InterruptedException - waiting for dr strange to arrive to find correct multiverse
Yet another Multiverse spinoff
just use github as a database
how do i give a mob a custom bossbar
yass queen slay
Is there something like getTargetBlock but for entities?
rayTraceEntities perhaps could be your friend
not sure if there's a direct way of getting the target entity
ik i can create a bossbar and show it to nearby players when the mob spawns and set the progress to (health / max health) * 100 everytime the mob is damaged but cmon, that's too much work there must be a better way
all my data is based in ram
sounds ocp-conforming
is it possible to summon a shulker that is invisible, not interactable, and has no collider?
are you trying to make glowing blocks
Use slimes instead
Yes
Invis shulker have this weird core thats visible
classic
use display blocks instead (not sure if that can glow)
doubt
would be cool if they could
try to make display blocks glow, if u cant use slime
Someone should write a guide for that 🤔
stumbling through lol
The render pipeline for block displays is sometimes scuffed. There are weird occlusion problems with text displays
barrier
set it as barrier
or just choose any block like gold and make it invisible
glow works on invisible entities
I'm trying to use getTargetBlock, and then put a glowing border around that one
that's the whole point of vanilla glow
Hm, let ill do some testing
I just don't know if that's plausible, or if I should just put an invisible wither skull inside said block and add glow effect
Well, if it's a solid block just stick a display entity inside it
It won't be visible anyway
That's false
/summon block_display ~ ~ ~ {Glowing:1b,block_state:{Name:"minecraft:dirt"}}
normal dirt ^
It's glowing for me
weird
You can also do RGB glow colors
/summon block_display ~ ~ ~ {Glowing:1b,glow_color_override:15345345,block_state:{Name:"minecraft:oak_stairs",Properties:{facing:"north"}}}
Pink stairs
Barrier didnt work. Glass looks a bit off
private void setGlowing(Block block) {
World world = block.getWorld();
world.spawn(block.getLocation(), BlockDisplay.class, display -> {
display.setBlock(Material.GLASS.createBlockData());
display.setGlowing(true);
display.setGlowColorOverride(Color.FUCHSIA);
display.setPersistent(false);
});
}
It does look super cool though
looks like the next level xray
i wonder what block would be the best
tinted glass?
how can i copy and paste every x time with worledit from a location to another? or like load a schematic in a specific position
what if u clicked on a weird block like glass
Then it'll match the glass?
Awesome!
white concrete
Oh shit
I am working with a 1.12.2 jar lololol
that's how long ago I last really touched plugin stuff lol
smile making an exray plugin ??
Server side XRay 🙂
hot stuff
wooo
doesnt show deepslate, lame
Goofy how the damn deepslate messes it up
But that made me realize how rare normal dias are.
1.17 or 1.18 iirc ruined dias
Well its just a if (block.getType() == Material.DIAMOND_ORE).
Was just messing around in a few lines of code.
too common now
How laggy is that :p

I don't think you should ask that...
Oh nvm smile is just cool
Would someone mind helping me with some errors?
i would
I literally wrote this in 2 minutes... dont ask
this thing is blowing up haha
What version are you on?
lul
Im not sure how to answer that
Sorry, I literally only use eclipse for minecraft plugins and I've not touched it in a very very long time lol
Your IDE is fine. Just that most people here use maven for managing dependencies.
But removing old dependencies is def a good start.
Downsides of the Bootstrap :/
did you update the dependency in the project settings?
i can't tell the difference between errors in eclipse and coloring
benefits to make people use a proper build system
I thought so, but I guess not
Just guessing but you I think can't depend on the current 1.20.4 jar directly produced by the BuildTools
Someone have exemple how to use that depency on maven for connect db ?
<dependency>
<groupId>org.apache.commons.dbcp2</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.12.0</version>
</dependency>
Correct
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Yep
i cant import org.apache.commons.dbcp2
sounds like some goofy dependency
If it's not in the maven central repo you need to add the repository that stores this dependency
You've seemed pretty nice so far I don't think you're a dick
Try refreshing maven if you're using intellij
Otherwise you might have the wrong dep
weak
Well, you're a genius, thx mate 🙂
I've made server side xray with fake barrier blocks before
So I tested this with a 1.16.5 jar and it fixed my errors
You'd see ores everywhere other than the block you were breaking
But the 1.20.4 one screws things up
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Maybe conflicting java versions?
I'll look into this, thanks
damnit, I hate messing with dependencies
Ok, so this download doesn't work inside this link...
wait so glwoing barriers work?
where can I get the boostrap shaded jar for 1.20.4?
Or do I just use this buildtools.jar as my dependency?
Build it with buildtools
Right, but I can't use the output jar of that as a dependency according to this #help-development message
It will be installed to your local maven repo
So, I use eclipse
So? That’s not an issue
Ok wasn't sure
someone here can me help you with the WolrdEdit Api?
Go to their discord
how would you do pathfinding
is that rly annoying
like to make custom ai for mobs
or for npc players?
cool
Ok, I ran the build tool and in went through it's entire install. Still having issues
The BuildTools run maven
And then install a jar in your local repo -> that means somewhere it places the jar somewhere on the filesystem
Right, but that's a bootstrap so I can't use that as a dependency, correct?
I don't remember what's the default path for the maven local repo
Nop, not the one placed on the maven local repo
ah
Because this one is supposed to be used by maven
Somewhere in your User directory
(In C:\Users\YourUsername)
You should find a .m2 directory
In that directory you whould have multiple sub dirs with jar in it
And somewhere the jar you can depend on
Hmmm
The one in org\spigotmc\spigot\
And it should be named spigot-v1.20.4-R1.jar
Or smth like that
Found it!
Ok I'll toss that in and see if that works
hmm yeah, I don't see any difference
But honestly if you have one hour of free time just try to learn maven, it's very simple and will save you a lot of time
Did you refresh eclipse ?
Ok give 2 secs
crying in so much pain
i had a stroke and read Choco as CMarco
private void displayNearbyOres(Player player) {
World world = player.getWorld();
for (int x = -16; x <= 16; x++) {
for (int y = -16; y <= 16; y++) {
for (int z = -16; z <= 16; z++) {
Material material = world.getType(x, y, z);
if (material == Material.DIAMOND_ORE /* probably fine to hash x, y, and z together and check if it's in a Set */) {
this.setGlowingBlock(world, x, y, z, material);
}
}
}
}
}
private void setGlowingBlock(World world, int x, int y, int z, Material material) {
world.spawn(new Location(world, x, y, z), BlockDisplay.class, display -> {
display.setBlock(material.createBlockData());
display.setGlowing(true);
display.setGlowColorOverride(Color.FUCHSIA);
display.setPersistent(false);
});
}
No Block allocation, only one Location allocation and only if necessary to spawn the entity, reusing player.getWorld()
how would that hashing work
Can just compact them together in a single long
I was too lazy to write it but you absolutely could do it lol
while(true) {
}
i dont see how putting x, y and z together would work
Why not?
i dont understand what you mean with it
You can represent an x, y, and z coordinate in a single long
Compact them into one long
and then?
It would replace the need for a Set<Block>. You would use a Set<Long> instead
God (the terminator) said so
The point is that you're skipping the allocation of like hundreds of CraftBlock instances
what set lol
Actually, 4,000
brain is fried, set for materials or what are we talking about
The original snippet had glowingBlocks.containsKey(block), so a Map I guess
ahh i kept looking at your code
because maffs
I wonder if that's intentional by Mojang
Very, very likely
Just switch to maven
Because the 30 million worldborder is otherwise arbitrary
If I can fix my issue more quicker than switching, I'd rather do that. 1.12 was my last time I seriously did plugin work and I probably wont do it again for a while after this
My bad try with spigot-api-1.20.4-R0.1-SNAPSHOT-shaded.jar, it looks like the spigot jar does not contains the api by default anymore
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
This worked! Kinda
Fixed my dependency issues, But 7smile7's code still having issues for me here #help-development message
However, I have less errors than previously lol
Not the right class I guess
probably cuz he is using paper
ah, thank you!
Ok, I'm late to the party but I'm finally playing around with this. Awesome stuff!
umm is this intented or a glitch by spigot?
what
what would be the point of a barrier block display
invisible blockdisplay
you can set it as Air (ItemDisplays)
what is the point of an invisible blockDisplay
just the glowing border?
the whole point of them is that you can see them
also can I just say how bonkers minecraft renders these glowing borders? It's all one line going around the blocks, nothing is overlapping anywhere
nice to hear. Dont give up on development 🙂
Yeah it's just a black and white mask that gets a colour rendered around the black areas afaik
No depth testing
You can write a shader and literally change an out value from 1 to 10 and have huge borders. Its quite primitive.
I just dont really get around to plugin dev very often. Comes and goes with my interest in minecraft
I was gonna say that
should stop drinking poison
i thought Enum::values was a thing but i keep forgetting java changed it
whats the mathemetical approach to connect to points?
2 blocks and then set a material in between
substract one from the other, transform to vector, normalize
and multiply it to get n block
i think chatgpt is the way, i dont know any of the things you just said
too much math
my brain not able to comprehend
it's not that hard lol
loc1 sub loc 2 to vector#normalize
vector multiply
so if you multiply by 10 you get the 10th block
and so on
if you want to do it for all the blocks between 2 points you get the distance and iterate the distance and add the vector to a location
There’s also #midpoint
is that the middle formula?
chatgpt gonna be my math man
Midpoint just gets the point equal distance between two vectors
true
How would I get the name of a structureType given theres no .name method for the constants?
.ToString work fine to relate a message of the given type?
Depends what you want to show
ToString will get you something like “minecraft:igloo”
Just the name of the structure, so i suppose that works I just need to rid of the minecraft: part
.replace("%structureType%", searchResult.getStructure().getKey().getNamespace()
This should be fine then eh?
Oh gotcha
Any way to make glow effects only visible for specific players and not others?
Yes
Or just NMS, yeah
Heres a previouse thread, dont know if it still works
https://www.spigotmc.org/threads/make-everybody-glow-to-one-player.465348/
Why is this not working but left click does?
Do you mean when they left click it works and when they right click it doesnt? That's because you're checking if the click is not a right click " != "
I mean
when I put the action to LEFT_CLICK it works with it
but RIGHT_CLICK doesn't work in any manner
Hmm
yeah, tried again, LEFT works fine but RIGHT just doesn't do anything
Right click air will only fire when holding an item
oh
Can that be changed?
Yea, that makes sense
why does setCollidable false only work on certain entities?
I believe it only doesn't work on players
it sdoent work on slimes either
Weird
Idk why slimes would be but players is because only teams allows that to work
and why does setinvulnerable still allow me to kill the entity?
it just doesnt die to kill @e
but everything else kills it
but that is not invulnerable >:(
ITS A LIE
lying is not ocp
How much you wanna bet he's in creative kek
He probs is xD
This is why we test in survival boys
If you want to make it unkillable, grab the EntityDamagedByEntity event, check entity id, cancel it
ask mojang. spigot simply calls the NMS method to make it "invulnerable".
Same for collidable
:(
For collision use scoreboard teams
And yeah invulnerable should make it immune to everything other than creative players and /kill
i cant kill them at least the babies from the slimes that died in the intitial /kill
seems like a bug to me
Ingles?
I think he’s drunk
No I'm not drinking and driving us illegal
Also I'm sober for life because boring me
I cant put it on left or right, since i have monitor on left and right
@inner mulch
Why not
Ph gawd
.setRemoveWhenFarAway(false);
what does this do?
remove something when you are far away from it, im guessing its entity so when no player is around it will be deleted
Yeah it sets whether the entity naturally despawns or not
well i thought that too, but it doesnt seem to work
fixed sorry
I'm having trouble with checking for an exact player's name
if(player.getName() == "<insert name>")
if I do player.sendMessage(player.getName());, I display the correct name but for whatever reason I cannot seem to compare the strings correctly?
is it possible to be in multiple teams?
use .equals() instead of ==
== is an identity comparison and would only work for interned strings (in case of doubt: your strings are not interned).
Much appreciated!
This applies to every object btw (even java.lang.Integer and comparable!)
How do i set a Flight hight at a specific Warp?
like in a particular area?
use a bounding box, check if player is inside of it, if they are, set fly
?paste ur class
Is there something like 1.20.5 pre releases for servers or some? Like to develop against?
Cause I don't understand how plugins like ViaVersion release versions that quickly after a new MC version drops...
all via version is is modifying protocol data
the mappings are available and also what epic said
so they just modify there protocol translations nms and can probably just do the nms without spigot
Still, how would they know what the mappings of 1.20.5 will be?
Or are they just the same over all MC versions?
They must have some pre release versions of 1.20.5 right?
Yes
Yea, so they have a early version?
It’s called the pre releases
^
First one is already out
minecraft release the acutal jars, they can just work off that
Oh right, they are simply also in the client side right? Like they won't need a 1.20.5 server to develop against?
they probably have there own server patching to test protoclcompat
The jars of the client or servers you mean, cause else you should link me :p
https://www.minecraft.net/en-us/article/minecraft-1-20-5-pre-release-1 srcoll all the way down
idk if its intentional but you have "coder" spelt wrong in your about me
it is intentional
alr
minecraft releases the server jars
I know about the pre-releases which I can play through the launcher, I just wanted to know if there is a 1.20.5 server
That is still 1.20.4
Look at the blog post for the pre-release, go to the GET THE PRE-RELEASE
Ctrl F
^^^^
🤓
Before 1.20.5 was it possible to adjust the scale of the player model?
Just using plugins.
I feel like it was because I saw it before on some servers with TrollBoss.
Pretty sure it just cloned the player with small armor stands.