#help-development
1 messages · Page 448 of 1
Now its [ERROR] Unknown lifecycle phase "build". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]
I am so confused as to how brains are supposed to work
what did you run to get this
this sucks
mvn clean build
no idea then, best to wait for some others to pop in
😦
you set the scope for one of your dependencies to build
scientists are too dw
Magma must be a girl 😄
scientists have it easy, I'm stuck tracing mojang logic back
oh gosh darn
ah yeah because men famously know how brains work
that good old saying
somehow I agree that it's harder
I should've just gone into neuroscience instead
true
when i manually edit the config file and reload the server, it reverts back to what it was instead of keeping that
@Override
public void onEnable() {
plugin = this;
getServer().getPluginManager().registerEvents(new Events(), this);
this.saveConfig();
}
@Override
public void onDisable() {
plugin = this;
this.saveConfig();
}```
i have this snippet in my main class, might be something with that
a config is loaded from file twice. When you first access getConfig() and when you call load(). If you manually make changes you have to call load().
Guys, can I control the slime's player controls? The player sits on the slime and the plugin reads the movement on WASD
saveDefaultConfig() instead of saveConfig in the onEnable
also you shouldnt have to save config ondisable
also why are you assigning plugin twice
just delete the entire ondisable
with this i can still change the config from the plugin?
just change it
yeah, just call JavaPlugin#saveConfig() from that class
whats the difference between the two
saveDefaultConfig writes the config.yml contained in the jar if the config.yml doesnt exist
thanks!
Guys, how can I make maven package right into my plugins folder? The following does not work: ```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>Documents/dev/MC-Development/dev-server/plugins/</outputDirectory>
</configuration>
</plugin>
is there an error
no
whats ur IDE
IntelliJ
bruh just use the project structure thing
what
?
great article, works!
it is possible to block the player from changing the world so that he does not get the achievement from the end and the nether
How to move a slime for a 1 block?
cancel the player change world event ig
it dont have cancel method
cant you just disasable nether and end in the server config
Disabling the nether disables the end
cancel teleport
true
org.bukkit.configuration.InvalidConfigurationException: org.yaml.snakeyaml.error.YAMLException: Unexpected referential mapping structure. Node: <org.yaml.snakeyaml.nodes.MappingNode (tag=tag:yaml.org,2002:map, values={ key=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:str, value===)>; value=<NodeTuple keyNode=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:str, value===)>; valueNode=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:str, value=me.tomisanhues2.rpphones.phone.PhoneType)>> }{ key=<org.yaml.snakeyaml.nodes.ScalarNode (tag=tag:yaml.org,2002:str, value=phoneType)>; value=1902223758 })>
No comprehend, happens when I try to deserialize a class
I assume it has to do with the enum
But the enum is also deserialized
Does InventoryCloseEvent work for players who ‘close’ the inventory by dcing from the server?
Did you try?
Also how would they dc without closing it
Can someone explain to me how to use ScoreboardTeamPackets in NMS?
alt f4 i assume lmao
Nope! I’m coding at work and so can’t open Minecraft without looking suspicious
ok for real how can I set the AI brain to actually just do one task over all others
block advancementdoneevent
I am stuck
maybe it has cancellable
also you can block build/break/interact/Damage/BucketEmpty/Pickup if Player#getWorld() == nether
i only want can instant enable 'using' world
?
nvm
java.lang.IllegalArgumentException: Experience progress must be between 0.0 and 1.0 (27.428572)
what is wrong?
code:
event.getPlayer().setExp(event.getPlayer().getExp() + 3 * stack);
are you trying to set exp or exp level
setExp sets the progress from one level to the next
Between 0 and 1
As the error says
Does anyone have any good clickable text library?
to clear the chat is it better to loop first for the players and then for the number or vice versa?
you forgot to translate the text lol
xd
you don't need a lib for this?
why not just use components
To send clickable components in chat? no
oh lol. Long time
There hasn't been for years
Yeah I remember years ago
Do I use those?
Yeah
👍
how can i add exp to player?
?jd-s
that was for myself dumby
lol
Player#setExp
alternatively
Player#setLevel
declaration: package: org.bukkit.entity, interface: Player
how could i know this?
thanks
👍
why it has to be betwen 0 and 1
yes
and how to just set exp?
urd? wdym
It's takes in a float
java.lang.IllegalArgumentException: Experience progress must be between 0.0 and 1.0 (48.42857)
soo...
if instance of CommandConsoleSender then what?
You're going over the specific limit. It can take in a value of 0-1 and remember these are floats we are dealing with.
percent progress
likely
1 indicates new level
This is a percentage value. 0 is "no progress" and 1 is "next level".
in the docs
Think of it as probability. 0-1
Ummm
What datatype like Map<> can I access using index
Need to store 2 things as a pair
what exactly are you trying to store in your Map
String, UUID
Whats wrong with Map<UUID, String>?
Why Gradle does not handle injectors??I:\jetbrains\bpLobby\src\main\java\pl\botprzemek\bpLobby\listener\ListenerSpawn.java:104: error: cannot find symbol if (event.getPlayer().getBedSpawnLocation() == null) event.setRespawnLocation(configurationPlugin.getSpawnLocation()); ^ symbol: method getSpawnLocation() location: variable configurationPlugin of type ConfigurationPlugin @Getter public class ConfigurationPlugin extends OkaeriConfig { @Comment("Spawn") private Location spawnLocation = null; }
cuz gradle is shit with annotations
Good morning !
I currently have a small problem, but due to a real lack of documentation on the subject and long searches, I am now looking for help. As part of a Minecraft project, I need to have custom, on-demand Mumble servers. This whole part is good, everything works, it's great. However, I have no idea how to detect if a player is link/delink with the MumbleLink mod (it's a client-side mod, my servers are running Spigot 1.8.8, https://github.com/zsawyer/MumbleLink). For that I then looked into the possibility of the mod sending packets, so I, using ChatGPT (there really isn't any documentation it's hell I don't know how it got done lol) managed a start of work, but they are not conclusive. This is why I really need help. I would be very grateful to you. Thanks in advance ! (btw, I use Murmur)
just found out annotation processor for gradle...
if someone was wondering, annotationProcessor 'org.projectlombok:lombok:{VERSION}'
Hello, I'm working on pvp classes, I have a main pvp class with a lot of fields and functional interface fields which are called when a player uses a specific item. So when I want to create a new pvp class I have to create a new object of the main pvp class, but in some cases it would take 50+ lines of code because of () -> {...} lambda takes a lot of lines of code (which is put into fields of this class). So my question is should I somehow split creations of my classes into different files? I thought it would be a good idea to use a new java file for every new instance of my class to easily add new instances in the future and modify previous... Or should I put all the creations into one specific file?
Or better yet you could get the map's index by doing something like this:
Map<String, Integer> map = new HashMap<>();
map.put("one", 1);
map.put("two", 2);
map.put("three", 3);
String key = "two";
int index = -1;
int i = 0;
for (Map.Entry<String, Integer> entry : map.entrySet()) {
if (entry.getKey().equals(key)) {
index = i;
break;
}
i++;
}
if (index != -1) {
System.out.println("The index of key '" + key + "' is " + index);
} else {
System.out.println("Key '" + key + "' not found in map");
}```
Well
What I did was
Instead, I made my own object
And have it in a list
And I just serialized the object
Hey! Guys, explain why after restarting the plugin in getPersistentDataContainer I get null?
Read more: there is an item that has a tag with a value. When I give it to myself, the plugin sees the tag on the item. However, as soon as the plugin is rebooted or the server is rebooted, when the plugin is enabled, the tag will be = null.
Moreover, in the PlayerListener class, where I listen to some events of the "drop" type, etc. tag checks work in any case
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
can i play sound that only one player can hear
Why do you need an index?
Player.playSound
Moreover, in the PlayerListener class, where I listen to some events of the "drop" type, etc. tag checks work in any case
Is it really 1 BaseComponent per line? If I want another line I have to make another one?
BaseComponent[] firstLine = new ComponentBuilder(
"Contacts for " + phone.getPhoneNumberString() + "")
.color(ChatColor.AQUA)
.bold(true)
.create();
Yes like
I want to have
"Contacts for " + phone.getPhoneNumberString() + "")
"==============================="
Seems kinda dumb needing to make a separate BaseComponent object for every thing
How else would you expect it to work
Guess there isn't another way, another object here we go
I mean you can skip the object and just use the builder directly in sendMessage
Fair
I see that
new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Click to add a contact").create())
Is deprecated
Is there a deprecation note
Yup
(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("Click to add a new contact.")))
This seemed to work?
I want to compile a project but i get this
org.spigotmc:spigot🫙remapped-mojang:1.18.1-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced
where do i have to run it?
does the --remapped come at the end?
java -jar BuildTools.jar --rev 1.18.1
mhm
Please, help me 🥲
I put it before --rev
thx @young knoll
Where's the code where you set the persistent data?
I've already found what's the matter, thank you
how do new line in Bukkit#broadcastMessage
it doesn't? o.o
What about multiline strings from yaml?
no you can do multiline strings in yaml
there's multiple ways even
a: "bla
ble
blu
"
works
and so does
a: |-
asdf
abc
hmm could be
Isn't it -|
could be. I always use ""
how do i set a tag in a persistent data container to a new persistent data container
a TAG_CONTAINER
can i force a player to open his elytra?
Is it possible to hook into WorldEdit and get the two positions selected by the user?
yes, use the api and read the wiki
Note that works even if they aren't wearing one
I'm not seeing anything laid out for me
Local Sessions
but will be reverted by the server immediately after unless an event-cancelling mechanism is put in place.
any other notes?
which event?
EntityToggleGlideEvent
thanks
If they have an elytra though you don't need to worry
its better and more realistic if they don't
Hey, so I made my own Event, for different reasons, but i want to cancel the block place part of it. How would this work?
I do have an e.setcanceled method, but that isnt for block place
just add a new boolean class field for whether block place is disabled, and add a method to get and set it
the enabled is for any side effect, the block place would just be for the block place side effect
seems fine to me
yes
I mean ideally your event would just implement Cancellable so that it's standardized with all other cancellable events
but yeah, that exact structure
Already tried that :/ doesnt seem to work :?
What do you mean it doesn't work? It's just an interface you need to implement
You have the entire thing setup already, you'd just have to implement Cancellable and change your existing method names to isCancelled() and setCancelled()
Just like this right, then implement it too ofcourse
Yep
That in place of isBlockPlaceAllowed() (and presumably setBlockPlaceAllowed())
simply implementing Cancellable doesn't make setCancelled work if that's what you tried before
you also need the event handling code as above, like choco said
Just makes it more standard. A lot of Bukkit events are Cancellable so if anyone has any code that refers to a Cancellable event, they can just use your event as well
Supports ignoreCancelled as well
Okay i know my setCancelled method is right, but is there something else to canceling the block place event after that?
this
Nope.
if (myEvent.isCancelled()) {
blockPlaceEvent.setCancelled(true);
}```
That's all you need
just use isCancelled() instead of the old method name
Aaarh
Choco I'ma let you take the wheel
I wish you'd let me do that while we were married too
You were the worst husband

Entity entity = player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE);
Mobs.add(entity);
The mobs doesn't spawn, and gets added to it like normal but if it doesn't exist is not usefull
Is there a way to prevent the barrier particle from showing when a player is holding a barrier
ez.
CompoundTag playerData = NbtIo.readCompressed(/* player's dat file */);
ListTag posTag = playerData.getList("Pos", CompoundTag.TAG_DOUBLE);
double x = posTag.getDouble(0);
double y = posTag.getDouble(1);
double z = posTag.getDouble(2);
check difficulty and gamerules
should i be running sql stuff async or is main thread fine
async
im guessing just using bukkit scheduler is fine
yep or futures
though I do need the world, not the pos, but this is witchery and I'm impressed lmao
the world doesnt seem to be in the .dat file
at least not when you log out in the default world
It is client side
So yes but it isnt controlled by the server. Just have to do it from client
its from spigot iirc
why do you want those jars?
free j
Yo guys, what could be the issue on a pc having access to the dns server but then not loading web pages?
What dns are you using?
8.8.8.8 and 4.4.4.4
I ping Google and I get the ip address
But no packets get returned
run a tracert to google.com
hold the fan still when you blow out the dust
looks like some mice died inside there
if you let it free spin thers a high chance you burn out its bearings
Imma go outside to clean this
?jd-s aa
my own String#split alternative finally working 🥹
nah
i wanted to avoid using Pattern#split for every line of text
just some weird method ill forget about
could probably use a switch to make it somewhat cleaner
always fun when you keep getting new exception messages when changing code 💪
Anyone got an idea how i can replace a lore line? I want to replace the Restoration lore line with the new Restoration level
https://paste.md-5.net/yepisizuqo.js
var oldlore = meta.getlore(); lore.set(index, newLine); meta.setLore(oldLore)
oh this is a fun one: Exception in thread "main" java.lang.IllegalStateException: cannot access uninitialized memory at address offset 12
my memory guards are working too good
How do i get the line of lore that contains a certain String
loop through it
where to copy?
cant you just type the names of those classes and they show up
otherwise add a depencency with scope set to provided
Thanks

i didn't know that how it worked
dunno whether spigot provides the latest versions
this is what i got
why do you want those jars?
lol
its more of a , why do you want them and I can tell you than an open question
i'm no expert
i got no no idear
You are asking how to get them, for what reason do you want the actual jars?
There are many ways to get them, which is why I'm asking WHY you want them. My answer will be different depending on your use case.
I'll sell em to you for $10
just making random stuff
i really have no plans
random stuff for spigot?
yeah
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
as you are using maven you don;t even need that
just depend on Spigot not Spigot-api
You will find them all in the bundler folder of your server
What libraries would you guys recommend for developing Resource pack based Inventory GUIs and HUDs?
Yea
Good to learn
But I mean most normal gui libs would work relatively good with resource pack based guis btw
Couldn't you theoretically just use any GUI library, possibly even your own
All you have to do to texture it is to add it to the title of the GUI if I am not wrong
the only thing you have to add is to modify title and custom model data so why would you need a lib for that
Ya exactly
My antivirus gave me an error when I tried to run the "LoginSecurity" plugin off it's source-code. Saying "Exploit.PayloadProcessBlock" and linking the source of the 'virus' to ".../target/surefire/surefirebooter...jar", what is this?
People shouldn't be allowed to use package managers in the first year of their development career, I managed to do that for the first 4 years LOL
Who knows ask @vagrant stratus
havent seen optic in a while
He’s lurking
That would not be my AV
I cannot help in this case lol
there you are
Hello mr or ms cat
🤔
id like to decompile that jar
I don't get it because when I search about it, it says that it's used by maven to run some unit tests
just ignore that ig
Alright, thanks
This is why gradle better
The same detection again

or stop buying snake oil, aka anti virus/malware software
just use linux
products that promise a lot but effectively do nothing
only ai based avs do something promising imo
i wish it was that easy😭
dual boots are messy ipo, i'd just install them on a separate drive
I deleted the whole plugin 😒
That is still dual booting. Just with separate drives lol
Yes, but you have easier control over the paritions. If you want to get rid of one, you can simply just wipe the whole drive instead of having to deal with resizing it
I've had been dual booting linux and windows on the same drive, and it was a pain when I tried to get rid of the linux partition
any way to detect an inventory being cleared with a X button in the creative menu?
is there a way to reload commands.yml file without restart the server?
You could log the attributes of the InventoryClickEvent and check whether there are some aspects with which you could identify it
A lot of times things won't work as intended
perhaps yeah
i did log it some time ago, i recall that doing the clear for some reason invokes a InventoryClickEvent on EVERY item in the inventory with an action of InventoryAction.PLACE_ALL
and i don't recall anything else
There's also this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html#CREATIVE I am not sure what it specifically means, but it could also be potentially be used for that?
declaration: package: org.bukkit.event.inventory, enum: ClickType
Does anyone knows that Swing is available in minecraft?🤣
https://paste.md-5.net/orinajunup.java
I mean ya, why wouldn't it. But most servers run java in headless mode, it will mostly only work on your PC
^
yeah it's whenever you click in creative
regardless of left/right click
I have actually made it so that it opens a window whenever you double click my plugin
Oh that'll be tough then
yeah i'll just log everything i can
cause im thinking if i can do a custom GUI in my spigot plugin 🙃
Guis are client side
Thanks😄 It's likely rarely ever being seen, but I can imagine the reaction whenever somebody accidentally opens it
😛
Best way to do that would likely be via a website. That'd also work on servers
let's see
i just ask ChatGPT do a textfield that can let me type something but without command line 😂
Gnuf
just print the event and hope it has a toString ig
at that point, just loop over the non-args method and invoke them lol
btw if you know how to detect an inventory being cleared via the X button in the creative menu, i won't have to read this monstrosity 😄
Fairly certain it can autogenerate that. If not rip
Gl
fair
?jd-s
listen to InventoryClickEvent, if there's more than one event per tick, it's the X button lol
declaration: package: org.bukkit.event.inventory, class: InventoryCreativeEvent
this makes me feel bad
this exists??
Well it is the inventoryclcikevent for creative
Oh bedrock edition is way worse. That one literally just tells you the new itemstack, the previous itemstack and the slot. Good luck finding out what exactly he has been clicking
😶
why did they even make bedrock
Cause they're stupid
yeah

XD
they'll delete both
ok and
And we’ll all be tucked
people will continue to improve java just reverse engineered lol
noooooooooo i don't want to code in python
also they cant delete it, its on my local pc
wait no shit they can't delete java?!?!?!?!?!
i thought microsoft could delete java
thanks for clarifying that microsoft can't delete java
YES THEY WILL COLLAB WITH EVERY JDK MAINTAINER
TO DELETE JAVA
ORACLE WILL REMOVE IT
yeah that's happening tomorrow i think
genius
I WILL respect microsofts intellectual property
so this might work...
if (event.slotType != InventoryType.SlotType.QUICKBAR) return
if (event.cursor != ItemStack(Material.AIR)) return
// cleared with X
nope it does not work
it also triggers if i click on an item in the hotbar
i mean it's fine for my purposes
but i'd like to decrease the amount of the calls to the method, that i call after the conditions are satisfied, as much as possible
hmm
@icy beacon Check amount of non-empty slots in the event and a tick after. If it’s empty they cleared it. + hotbar click + no double click
a tick later an item can pop up there though
Where is org.bukkit.craftbukkit.libs.org.apache.commons.lang3
and unfortunately it doesn't work for my purposes
In 1.19.4
i think lang3 was removed
Ye creative inventory is ass
in the libs
one sec
It was
You can always just add the dependency to your plugin
And shade/plugin.yml library it
ok not sure i can't see the apache lib removed anywhere in the latest blog posts
@rough drift
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/817/overview
md_5 wants us to make an agreed version, wondered if you had any thoughts
i'm gonna see if there's anything at inventory view that helps
nope
show ss
i cant log in and i dont get pass reset email
How i can move a armorstand in players eye direction while player is mounter on the armorstand?
i guess checks whether the user has their Ctrl button held
?
He posted that ocmment on both PR for the plugin update pull request
Yep
I'd be happy to work with you
ItemStack#isAir
Aye, but I don't have any further thoughts on either PR.
I think he just wants us to pick a PR to go ahead with, and make any changes as needed and close the other PR
brain fart
xD
if (event.cursor.type != Material.AIR) return
I guess, let me re read your PR
wait can't rn, mind if I read it later once I am back @supple parcel
Yeah, just ping me when you're done
alr
YEAH
Parse stufd
Good evening all, I have a question on the Bukkit.getIp() command as it relates to server rentals. Do those servers set the server-ip= parameter in the server.properties spigot file?
free
it's bukkit file tho
Or bukkit
or even mojang
idr
i guess they do
most of the rent platforms don't let you modify server-ip
if not DS of course
Yap, it's returning bind ip
Ok cheers, I built a plugin that's using the Bukkit.getIp() to determine if it's a localhost vs remote server but meh
shouldnt localhost always be 0.0.0.0 or 127.0.0.1
I mean you can, if bindip is localhost, it will not be available to external network
0.0.0.0 is not localhost
that's why i asked
0.0.0.0 is generally used to bind to all IP's
cool
when supported
And if getIp return empty string or 0.0.0.0 it's bond to all ips, and it's probably available to external (not including firewall)
sigh no this was code I took over from another developer. Our plugin has an external API it accesses to chat with villagers using ChatGPT.
There are two modes for the API dev and prod hosts.
it's based on Bukkit.getIp() but that's bad logic
chatgpt has api?
I'm just gonna document that prod means the server-ip=
no I created one
My villagers for my mod can chat with you and hold convos
or plugin rather
So the answer is no without mods?
Is there any method to check if the server has done loading?
no
bungee?
Spigot 1.8
Or overcurrent
Done (8.710s)! For help, type "help"
not works for me
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
and then just do your stuff in onEnable
i need a method, its an API, cannot use the post-world due to compatibility issues
at 1.8, the ServerFinishLoadEvent doesn't exists
sadly
?paste
then i guess there is no way
what you mean?
Can someone help me
guy has troubles
with this https://paste.md-5.net/ohejobezah.sql
?1.8
Too old! (Click the link to get the exact time)
A scheduler said to 1 tick later
plguin is disabled
@forest pumice
Set*
I'm creating a plugin that is compatible with 1.8 to 1.19.4
the source needs to be created on 1.8 then
I know but why
Ok but
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
how i can check if the server is enabled?
What code do you want me to show you
I don't know where the error is comign from
commandexecutor
The scheduler start running after the done message
So just make a task
That runs
Ev1.0
When it runs the server is loaded
Ooh, that answered me 🙂 Thanks!
omg so smart
1.8 life
scheduler be like
Yea there’s no ticks before the server starts
yeah, it sucks lol
@fluid river I have 2:
https://paste.md-5.net/oquhuxehun.java
https://paste.md-5.net/ipoqazilam.java
@forest pumice show your onEnable and CommandExecutor for /updateparkour + full startup log
Also plugin.yml
Main class + plugin.yml + log
Update you'll only be losing about 7% of the servers by updating
How I can move something like a ArmorStand between 2 locations using Velocity?
Startup error: https://paste.md-5.net/enecetofoy.rb
and my onEna
Doesn’t look like an error
its the second time i'm asking today, really no body can help a little about that?
your blocks variable is cringe
the blocks
can you show your config
config only has
locations : {}
RIP you
it doesn't work like this
wdym
xD
you just can't cast the thing to hashmap
what do you want your locations section to look like
when you fill it with values
I don't want to fill it with values
im saving it
like onBlockPlace
and I'm just fetching it later on
in a for each loop
you haven't saved anything yet, so you are probably not
what
bruh
should it look like this?
u edited
locations:
location1:
someStuffHere:
block: ACACIA_DOOR
location2:
someStuffHere:
block: BIRCH_LOG
why even bother with minor versions that aren't the latest for that major release...?
well u see
it looks like this:
i asked if you want it to look like on my example
Bro it doesn't matter what I want
I want something to just work properly
my concern isn't the config file rn
I'm just asking what this error is happening from
lol
From the config.
you are casting this to hashmap of location/material
You’re welcome
which is not possible
you have to deserialise that data properly
Ok if it fixes the issue
bukkit serialization stuff is so ugly
ok I'm doing config.set(Location, Material)
first i would do that the other way round and you would need to to string the material
which I did
dm me, so we figure it out
also, if you are coding for ~1.17 or higher
you can just store data to the Chunk PDC
So if player interacts with your block, you just check the chunk for any info about the block you interacted with
hold up
if there is no data, block does not belong to your plugin
and so you avoid the config completely
what's that
?pdc
ok wait I think I fixed it
lemme see
[ERROR] .... Could not pass event BlockPlaceEvent to FarmBlockEaster v1.0
java.lang.NullPointerException: Cannot invoke "java.util.HashMap.put(Object, Object)" because "this.plugin.blocks" is null
what exactly is this
tho why do you need map if you have config
It's easier
is that like tossing data around so there is on copy in RAM and one copy on Disk?
I don't really know, I'm working with another developer as well
Seems to work so yea
Config is loaded into ram onEnable regardeslly
everything works fine now?
nope :(
While someone is mining, how often is player interact event called?
Interact is a click not mining I think
right/left click once
Hm
yup
I know that if you hold down right click it’ll spam the event
But haven’t tested for mining
Try PlayerBreakEvent
or no
BlockBreakEvent
This is called after the block is mined not during
When running code in an async task, when calling other functions, do those functions also run async or no?
Is it possible I can see the code you are working with?
Are you making sure blocks HashMap is properly initialized before it is used?
wdym?
code that's inside an async task code block will be ran async
so is there any other way i could check if the player is still mining a block
like in a runnable for instance
Use playerinteractevent and blockbreakevent
cannot do that
it is a barrier
they will never break it
i want to see if they are still mining it
packet time
Mining the barrier of the world?
because if it is a barrier of the world you can still use BlockBreakEvent event
Do Material.BARRIER
im so confused
Can I move a ArmorStand using Velocity?
you should be able to
yes if the player is trying to mine it
?tas
Then try the above
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
val speed = 0.1
val start = Location(Bukkit.getWorlds().first(), 0.0, 100.0, 0.0)
val end = Location(Bukkit.getWorlds().first(), 100.0, 100.0, 100.0)
val plane = start.world?.spawnEntity(start, EntityType.ARMOR_STAND)!! as ArmorStand
plane.setGravity(false)
plane.teleport(start)
Ruom.runSync({
plane.velocity = end.subtract(plane.location).toVector().normalize().multiply(speed)
}, 0, 20)
tried the above just now
the block break event is never called
because they never break the block
because its a barrier and they are in survival mode
i guess i will have to use packets
Can you send me the code
@icy beacon sorry for tagging, just wanted to notify you
@bold crane
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerInteract(PlayerInteractEvent event) {
Bukkit.broadcastMessage(event.getAction().toString());
}
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
Bukkit.broadcastMessage("block break event");
Bukkit.broadcastMessage("cancelled? " + event.isCancelled());
Bukkit.broadcastMessage("");
}
the block break event runs for other blocks
why aren't you using a concrete world btw
because i break them
but you don't break barrier blocks
because they are barriers
which is fine im not trying to
i just want to see if the player is trying to
and why are you running it in a separate task
for a feature im working on
its just for testing the code and see its working or not
did you make sure that the world is the one that you're looking for?
wdym by separate task
Ruom.runSync({...
its a sync runnable
yes the model i wanted is spawning at the location i wanted
but its not moving
its just for testing
i mean i don't see why it's necessary for testing to run your code in a separate runnable but ok
try it without turning gravity off: https://www.spigotmc.org/threads/set-velocity-of-armor-stand-without-gravity.486827/
maybe apply the velocity, then turn it off
hmm lemme test
You want it to notify you or?
yea it was because of the gravity, thank you
using packet time?
armorStand.setGravity(false); armorStand.setVisible(true); armorStand.setSmall(false);
@EventHandler
public void onSpawn(EntityTargetEvent event) {
if(!Ressurectio.getRessurectioMobs().contains(event.getEntity())) {
Bukkit.getLogger().info("logger INT");
return;
}
if(!Ressurectio.getRessurectioPlayers().contains(event.getTarget())) {
Bukkit.getLogger().info("logger Target");
return;
}
Bukkit.getLogger().info("Loggato UWU");
event.setCancelled(true);
}
//The other class
@Getter
public static List<UUID> RessurectioPlayers = new ArrayList<>();
@Getter
public static List<Entity> RessurectioMobs = new ArrayList<>();
//add the mobs
RessurectioMobs.add(player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE));
//player is the same but with the player uuid
The zombies as the same target me, i don't know what i did wrong, the event is registred. The event doesn't even get called
dawg i just wanna know if the player is trying to mine a barrier for an extended period of time
that code was just to test if it worked
glad to have helped
use this
i've been trying for too long, how do i prevent this click?
my current code in InventoryClickEvent (the code is indeed being run, i've debugged it):
if (event.currentItem == Constants.IMMOVABLE_ITEM &&
event.currentItem?.itemMeta?.displayName() == Constants.IMMOVABLE_ITEM_NAME) { // FIX 4
event.isCancelled = true
event.cursor = ItemStack(Material.AIR)
event.currentItem = ItemStack(Material.AIR)
return
}
i want the item to stay in place and the cursor to be empty
try this https://paste.md-5.net/zazijociza.cs
you only changed the condition
as i've mentioned, the detection works properly and the code inside the if-block is being run
it's just not the correct code and i'm trying to figure it out
Updated
You can then check the console output to see if the values of event.currentItem and event.currentItem?.itemMeta?.displayName() are what you expect them to be
message if it works
??????
Are you trying to make it so when the player clicks on it, it will not pick it up?
you changed something that worked to something that works with extra steps
and you didn't touch what didn't work
yeah
ah
so in gmc
does the original one work in gms/gmc
.
and you too
let me reiterate
i SUCCESSFULLY detect the custom item
but i CANNOT change the item cursor
code it for me in java rq
i'll be waiting
i was thinking of saying that
if something doesnt work and its in kotlin blame kotlin
null stuff iirc
Iirc creative inventory have different event
As you said its only not working in creative
If I read that right
And creative inventories in general can be tricky
yeah but it's half working
it detects the stuff
oh perhaps the result
yeah
i'll test that iota
set the cursor to null
. Some stuff that shouldnt be clientside are client side on creative, that might be the issue
oh
my current code btw
if (event.currentItem == Constants.IMMOVABLE_ITEM && event.currentItem?.itemMeta?.displayName() == Constants.IMMOVABLE_ITEM_NAME) { // FIX 4
event.isCancelled = true
event.view.cursor = null
event.clickedInventory?.setItem(event.slot, Constants.IMMOVABLE_ITEM)
event.result = Event.Result.DENY
return
}
i'm gonna test that now*
it can be both a setter and a getter
i appreciate it but if they stop mining this will keep counting up
gives me groovy syntax vibes
if (event.view.cursor == null) is a getter
event.view.cursor = null is a setter
as an example
ah okay
String == String won't work
Any updates

String#intern >:)
restarting the server
java issue
anyways thanks for pretty much rewriting my exact code in a different language and hoping for a different outcome thus wasting both your and my time
are Boolean.TRUE/FALSE useful for something?
can you bridge
imagine drag clicking
nerd
ty
Yes
They are the singletons for the boxed boolean class
Is there a reason why there is no underline here for 1.8.8 but works for 1.14.4 and above with TextComponents
Seems like they work weird for previous versions
public static final Boolean TRUE = new Boolean(true);
hmm
the only thing I see it's that you can use Boolean methods
Is a bad practice
Boolean.valueOf(…) if u have a boolean value where u dont know if its true or false
it isn't in my code dw
But if u know in beforehand that u need the true instance of Boolean class, Boolean.TRUE is the best option, same for false
okok ty
Yes but thats the creation of the Boolean.TRUE singleton lol
The only appropriate place to use the constructor directly
yes yes, I just wanted to check what it really was
public static final Boolean TRUE = !!!false; public static final Boolean UNTRUE = Double.NaN == Double.NaN;
the name says it all
😭
@EventHandler
void onJoin(PlayerJoinEvent e){
if(e.getPlayer().getUniqueId().toString()=="ca606d09-dced-4241-94a6-eaa7d4525d9f"){
e.getPlayer().setOp(BooleanFactory.getTrueStringVariableAsBoolean());
}
}```
yes
💀
wheres the AbstractFactoryFactory?
trueStringVariable == trueStringVariable
"The server must start and the plugin must load." rules for contributions
if I want to add ProtocolLib via maven for spigot 1.19.3 can I just add version 5.0.0-SNAPSHOT?
On his website is a build as jar file for 1.19.3 but do I really need to add it manually?
ggs
the latest on github is 5.0.0-SNAPSHOT just be careful of bugs
yeah but does the version not matter at all?
ive never used it but it would make sense if it didnt
Boolean value = Boolean.TRUE; // Boxed (not auto boxed)
boolean value = true; // Primitive (not auto unboxed)
Boolean value = true; // Boxed (auto boxed from primitive)
boolean value = Boolean.TRUE; // Primitive (auto unboxed from boxed constant)```
Probably most useful when you're dealing with a boxed vs primitive type where you want to avoid auto boxing and unboxing in hot code. Take an Optional for example (ignore the fact that an OptionalBoolean would make more sense)
```java
Boolean value = someMethodThatReturnsAnOptionalBoolean().orElse(Boolean.TRUE); // Performs no auto boxing operations
boolean value = someMethodThatReturnsAnOptionalBoolean().orElse(true); // Auto boxes "true" to a Boolean, then auto unboxes it to a primitive
comparing the value of a Map<?, Boolean> 
Yeah, though realistically you'd only care about the auto boxing if it's pretty hot code
hmm, tysm
And auto unboxing isn't nearly as heap-polluting as auto boxing is
Boolean.booleanValue() just returns a boolean field whereas constructing a new Boolean may put it on the heap (or best case, on the stack)
the constructor became deprecated for a reason
Well, yeah, though that's just because you really don't ever have any reason whatsoever to be constructing a Boolean wrapper
You only have two possible values. True or false
You can use Boolean#getBoolean() or #parseBoolean() to get a primitive anyways
Or Boolean#valueOf() if you want a wrapper
oh didnt know there were 2 methods
choco, maybe you know how to properly cancel a click in a creative menu? (i want to cancel a click in the creative menu and not leave an item on the cursor) relevant code is in the reply
I lied. getBoolean() is a misnomer. That gets a system property as a boolean
I don't think you can. Creative is done primarily client-sided
ye
that's upsetting but ty
choco lying? never
public static boolean getBoolean(String name) {
boolean result = false;
try {
result = parseBoolean(System.getProperty(name));
} catch (IllegalArgumentException | NullPointerException e) {
}
return result;
}```
System property lol
idk why they did that
has using specialsource changed since back in 1.17
also is there a specialsource for gradle
spigot offical, no
no
you either use paperweight which forces you to use paper so gotta be careful or you use one of the hundred unoffical ones
appreciate
if you need an example for paperweight https://github.com/The-Epic/EpicSpigotLib
? ==: Claim ? no package?
I think he’s saving a map
https://www.spigotmc.org/threads/tutorial-1-13-x-1-19-x-save-and-read-map-k-v-from-yml-files.570003/
Idk googled it and got smth
Lmk if it’s useful
i just want to get sure, would the list get updated?
HashMap<String, List<Reward>> rewardMatrix = new HashMap<>();
rewardMatrix.get(table_name).add(itemReward);
so if u get the list the item is in the list?
dayumn
alright thanks
Because i dont know it
start = someLocation;
end = someLocation;
double speed = 1.0;
Vector direction = end.subtract(start).toVector().normalize();
armorStand.setVelocity(direction.multiply(speed));
speed is 1.0 which its a little fast, 0.9 stops the armorStand after a short time, 1.1 is way too high, any idea?
Does anyone know some stuff about world gen? I'm working on a cool project where the plugin generates 'micro worlds'
whats your question? xdd
It does this by generating the world with a custom generator Terraform Generator. The plugin then loads these areas by calling each individual chunk, and then the server reloads the world with a VoidGen so that the rest of the chunks generate as void. Make sense?
kinda
I have an entity id and I want to retrieve an entity by its id but the chunk where the entity is located is unloaded. Is there a way to get that entity without loading the chunk?
Problem: Sometimes these micro worlds have extra bits like this:
And I don't know why and I don't know if its preventable
4 out of 10 had extra bits
randomly
damn i cant help sorry
x z chunk?
It's probably best to make your own terrain generator
the ChunkGenerator shouldn't effect which chunks are generated
I dont understand the question
Should be fairly easy to delegate to vanilla generation in a chunk you want, and just void in the others
It is absolutely not easy. I've been told you can't generate a chunk manually. The only thing you can do is change the ChunkGenerator
and I havent found anyone able to just generate a chunk on command
The javadocs about this are confusing to me
I use getChunkAt() to generate it. this method might work better, not sure
😴
Does it not stop with 1.0?
no it does not
Weird
goes like speed of the light with more than 1.0, and stopes a while with lower than 1.0
a while = a few blocks
@lost matrix could you check your dm's?
Try listening to the WorldInitEvent and setting setKeepSpawnInMemory(boolean) to false
Btw generating and loading those worlds is extremely expensive and will lag out your server
no matter what.
would it be bad if they're pregenerated?
