#help-development
1 messages · Page 1149 of 1
uuh not sure how to do in blockbench but yeah you can just manually do it in the json
im sure theres a button somewehre in blockbench for it
Right now I have another issue arising
I’m trying to display items as particles
And swapping out the custom model data to simulate animations
Is there a better way to do this
They’re custom particles of course
Please let me know if you have time.
I feel like you could just use attributes could you not?
Can you increase mining speed with that attribute?
mhm
iirc it's attackspeed?
Actually I think that just modifies pvp stuff
I don't actually remember how it's done
And I don't think there is an attribute that modifies break speed now that i am looking through the docs
I want to do this instead of attack speed (what is on now is enchantment).
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/meta/components/ToolComponent.ToolRule.html
You can raise it with setspeed in this
declaration: package: org.bukkit.inventory.meta.components, interface: ToolComponent, interface: ToolRule
I looked, but this seems internal, I swore there was api for this stuff now
better api
Ah the uh
declaration: package: org.bukkit.attribute, enum: Attribute
Just add some sort of pdc element to the tool and check whenever they interact with it, if it's breaking a block & your tool, then modify the players break speed
isnt internal, both toolrule and block_break_speed altough both been added first in 1.21
ah nvm, misread the rest of your msg, sorry 🥲
I've made it this far, but it won't register.
if OP wants to change it dynamically while breaking blocks, updating it on block interact can be a bit weird as it tends to stop and start again because on the clients side the speed is changed after breaking afaik, atleast thats what i experienced so I now update it on every movevent when either position or facing direction change combined with a work distro system and a very optimized calculation, even though there wasnt much to optimize for me
cant tell excactly, but you have to set it to the new component after, you cant modify it directly
This is what I got out of getlogger
How do I register in this case?
Rules empty because you didn't add anything to it?
Also idk why you implemented methods in your anonymous class because no one can access it later.
I implemented the anonymous class because I didn't know how to use it.
I would like to know how to register.
just do ItemMeta#getTool
on that toolcomponent the methods should be self explanetory, if not use the docs, they explain it pretty well
and then ItemMeta#setTool to set ur new tool component with rules etc
I have set up the tool, but the list of rules is empty, so I would like to know how to register it in the list.
hm? What's the point of that anonymous class
You've added methods to it that you will never be able to use
Add things to the list instead
ToolComponent#addRule
iirc
yep
kinda dislike the api with that atm, its not really intuitive for most and the docs just explain the minimum of the minimum
but its still really nice to just have it
i will try making a pr for it but i still have to fully understand the patch system
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
Should explain it
oh, ty, ill look into it :)
I want to use setrule because in the case of addrule, what I add does not disappear.
can u maybe show us the piece of code where you use the methods to write the toolcomponent to the itemstack?
I have added a list in the form of List<ToolComponent.ToolRule> rules = new ArrayList<ToolComponent.ToolRule>() and would like to know how to add to it.
Just use addRule
what can i do to like, optimize bukkit runnables? i use alot of em and cant literally use less , i already optimized it as much as possible but i have to, for example, update scoreboard every 2 ticks, and i'm making cosmetics that r done with bukkit runnables, for like sending particles and that
Do you have a performance problem
yep, im the only one in server and sometimes tps drops and ram usage goes to 16gb ☠️
and i'm currently solving that
last time it happened was like a week ago and i could optimize it to just drop to 18 tps and go to 4 gb max
this is my .bat to run
Don't be suprised when Java uses the ram you give it
-Xmx16G -Xms10M -jar
Get spark and run some timings
Spark doesn't support 1.21.1
I don't see why it wouldn't
it js doesn't run lol
hä
are we referring to the same spark here?
it appears in red and when i try to like load it with plugman (i know it isn't secure, i don't use it)
not 1.21.1
same thing
i know the risks
isn't 1.21.1 and 1.21 pretty much synonymous?
no lol
we talking major versions
yes
it's obviously not the same if it doesn't run
1.21.1 is very small
paper has it in its 1.21.1 so it definitely does work on it
What is the error?
Like 2 bug fixes
yea
...
i feel like total dumb
let me guess … it didn't work because it was already loaded into mem?
wdym?
Paper has spark
[FileProviderSource] The spark plugin will not be loaded as this server bundles the spark profiler.
^^
You should really read the error messages
before complaining "it doesn't work"
95% of all issues with programming can be resolved via reading errors
mostly yea
and then theres like this 0.1% occasion you run in where the resource itself has a bug
i now js send link here?
(which i sadly encountered once, took a month to be fixed 🥲 )
is it allowed?
if you want
I recommend adding the ticks over 50 to only capture lagging ticks
and yes it's fine
what does that mean?
it's a flag
You'll get the ?whereami people, but those are often safe to ignore
?wherami
?whereami
?whereami
bruh
as I said, often safe to ignore
what flag?
there are always other people looking the other way and as long as you don't piss off the staff team it's okay
tickmonitor?
timing
that'd be a command or uh - subcommand
argument
/spark profiler start --only-ticks-over <milliseconds> would be what is looked for
wait what ☠️
my plugin consuming 230%?
when i did at first it didn't consume that much
Looks like the worst lag source is PlaceholderAPI and their Javascript extension
yeah im gonna delete that and program it myself
other than that it looks fine
my plugin is skyblock core btw
wait what
Use a PDC tag to store such data
oh yeah, its js for life
im makin that
mana and defense is from pdc
damn bro it says everything there
yeah placeholderapi is the thing that is causing that lag
ill take a look at their code
of js extension
Passing data from the JVM to the Nashorn engine and back
isn't exactly free
Not much you can do about that
and that's from papi too?
Nashorn is the JavaScript engine
because that's where you call setPlcaeholders from
because it needs to be sync for PAPI to work?
^^
You're not getting a completable future from set placeholders
but i mean
im too lazy to look at their code
but
it looks like it doesn't use async for nashorn
oh damn i see now
Otherwise the return value could be undefined
okok
I am losing it
somehow when I change a rotation to be negative the logic works for -90 and -270 but somehow it breaks 0 and 180
like how would changing it modify what a 0 or 180 rotation would be
it shouldn't matter if something rotates by -0 or -180 vs 0 and 180
now it's flying
i can't believe it
This still doesn't add any rules.
Is this okay?
https://paste.md-5.net/sifitomutu.java
Can you look into meta.getTool()
Im on smartphone im sorry
I know that ItemMeta is a copy. But i see you set the ItemMeta but if getTool would be the same you need setTool as well
No Actually nvm you might be right
Make sure to modify tool before you set the item meta
I don't understand the argument after “settool”.
yes
thats the tool you get from getTool
that you can make changes to
and then set it with settool
declaration: package: org.bukkit.inventory.meta.components, interface: ToolComponent
Can I delete a rule added with addrule?
If possible, but what would an example sentence look like?
well
you would use removeRule
addRule returns the tool rule it has added
which can be used to remove it again
finally
this thing was not cooperating
pro tip simpler is better
even a bit of added complexity makes this impossible to debug and fix
Is that your infinite ... generator?
yeee boi
it's starting to look like something
How did you save, read and place the blocks?
WorldEdit would be cruel
So saving blocks like minecraft:stone and relative coordinates?
Im interested ^
I have send you a dm if ya want to accept it👀🤝
Friend request*
there is quite a few different ways to do this
its not that complex really
you can either use the API, use NMS, or alternative file methods
oh definitely
still, makes me wonder how much work is to generate worlds
like how many buildings you have to make
probably only need to make just a few and then use a generator to make variations of those
but they'll still be the same
unless you can slice the buildings and make configurations of those
I would like to know the syntax for deleting a rule added with addrule
like an inside generator
Coll I think it was has made something like that
removeRule(toolRule)
like idk what other information you would need
declaration: package: org.bukkit.inventory.meta.components, interface: ToolComponent
they already got sent that page
I don't know how to get it in the required type state.
wdym required state
addrule returns a rule
thats the one you would remove
or maybe getrules and pick the one you wanna delete from it
If you want to delete all rules attached to a tool
tool.removeRule(tool.getRules.removeALL())
is correct?
If not, please give me an example.
use setRules and an empty list
Could you please give me an example?
List.of() my beloved
seems someone needs to learn more java
Who has the most terrifying way to create a list?
Collections.synchronizedList(new CopyOnWriteArrayList<>());
Why are there cow lists 😭
its a thread safe list
java Arc when
Hey guys, im working in the 1.21 right now, and someone knows why this doesn't work anymore:
meta = (SkullMeta) arrowRight.getItemMeta();
meta.setOwningPlayer(Bukkit.getOfflinePlayer("MHF_ArrowRight"));
It still a normal head
someone ban this guy
Did you forget to set the item meta back on to the item
😼
also there is no need to do reflection to use a profile, there is PlayerProfile API for head textures
Well, if i try to set it via the OwningPlayer i get the error that the name of the profile is longer than 16 characters. Funny part about it, i dont use any name. I use the uuid
is there someone who is a pluginner/devoper with experience in minecraft? Yes/or no
None here
I have this package called Cakes and Pinata Birthday V1, which is a plugin with Oraxen, and other plugins, the problem is that I managed to load them and also load the textures, but now I don't see the objects in the game/not me makes them place I have a huge problem, even with Kazoo sound effects and confetti, would anyone be kind enough to help me? I think I did something wrong during the configuration, sound effects are missing and I can't place the objects (im desperate)
I was almost a devoper but I’m just not good enough
do you have a stack trace for that error?
it sounds like you are passing the uuid as a String, and the method that takes a String is for the name
I used UUID:fromString for this. Anyway, I changed something and the error is gone, probably a mistake on my part.
I tried it now with this code
OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(“93444fbc-2aef-4a09-bf3d-23becbcd9802”));
PlayerProfile profile = player.getPlayerProfile();
meta.setOwnerProfile(profile);
It seems that it only works with players who are online on the server.
You'd have to update() that profile
given it may involve a network request, that means you are in completable future land
i complete lynx's future 🫶
I see, thank you!
Not that there is one without you
(this isn't romantic, I am trying to escape /s)
get a room you flirts
Emilynx fits really well
Emi first 3 letters
l common letter
ynx last 3 letters
Ely for a girl but the boy sucks with Lem
wha
i love how the y isn't common letter as well
Ah I see
it isn't because then it wouldn't be 3-1-3
reality can be whatever we want
Not exactly a minecraft question, how do I clone someone's folder from github into a folder(packege) in my project on intellij
clone the project from github and move it there? xd
You cant just clone the folder afaik, you have to clone the whole project
you need to do a sparse checkout
mkdir <repo>
cd <repo>
git init
git remote add -f origin <url>
git config core.sparseCheckout true
Now you need to define which files/folders you want to actually check out. This is done by listing them in .git/info/sparse-checkout, eg:
echo "some/dir/" >> .git/info/sparse-checkout
echo "another/sub/tree" >> .git/info/sparse-checkout
Last but not least, update your empty repo with the state from the remote:
git pull origin master
@hazy parrot in case you are interested in that you can
A what
He explained it dumbass
damn so rude
Til ig
i know thats what i said
version: 2.0.0
author: [PillBox_]
main: me.pillbox.core.Main
api-version: 1.21
depends: [WorldEdit, WorldGuard, Votifier]```
Is there any reason why WorldGuard would load AFTER my ServerCore plugin? I just switched back to Spigot from Paper and running into this issue
what makes you think it is loading after?
there is no reason why it couldn't you need to define that ur plugin waits for worldguard
I thought I did that with "depends"? Does that delay/rearrange the startup order?
im pretty sure there was a loadbefore or loadafter or something, i might be wrong
im gonna google real quick
don't mess with loadbefore etc, thats for worlds
what makes you think its loading after?
java.lang.NullPointerException: WorldGuard is not enabled, unable to access the platform.```
And on startup WorldGuard is the 2nd last to startup (after this plugin)
do you have a field reference to worldguard in yoru class?
?paste your main class startup
code
onEnable
wgPlugin = (WorldGuardPlugin) getServer().getPluginManager().getPlugin("WorldGuard");
}```
onLoad
```if (wgPlugin == null) {
wgPlugin = (WorldGuardPlugin) getServer().getPluginManager().getPlugin("WorldGuard");
}```
you can;t get a WG reference in onLoad
0 Changes have been made to any of this/wg in months, only thing that has changed is switching from paper to spigot today. Plugin functioned and behaved 99% normally (except for Paper's AI remappings)
Same issue after removing
I've had no issues with that for the last 2 years lol
full stack trace?
Sure 1 sec
its also depend not depends
Your depends line has never worked. You have just been lucky
lol that'd be why probs
^^^ Ya that was it lol, 2 years without noticing that and just so happen to have everything load in the correct order xd ty
hi guys, Im making a land claiming plugin, I've asked several people and on several servers the best way to optimize the loading of chunks and lands, I'm hesitating between 2 things:
load everything on server startup from the db and save everything on stop
set up a cache system that loads when necessary and unloads when no longer needed
which is the most otptimized?
it all depends on your implementation
you should save/update on any change
not only on shutdown
save via an async queue
yes, it would seem more logical to do this, but saving in db is just for storage, so saving while the server is running is useless, I think, isn't it?
With land protection its usually best to hold all relevant data in memory
if your server crashes after a player claimed an area...
when you startup again your data is only valid upto your last save
no need for periodic
push to saave on any change
good idea yes
but do I have to load everything at start-up?
or just what I need?
I'd recomend it
land protection is not going to require much data, so not that much memory use
even across three world with 50 players
okay and for memory storing whats the best?
my first idea was
<chunk, land> (chunk just contain location)
but I was advised this
<chunk, land uuid>
<landuuid, land>
it would be worse having to wait to fetch data when a player teleports to see if they are allowed in teh area they travel to
yes, that's what I thought too
what is land?
to claim a chunk you claim it in a land context (or territory) you define rules that apply to land chunks, e.g. prevent breaking in your chunk
eg, I create a land named house and claim all in a 3 chunks radius
and define some rules
rules apply to the whole land? or to each chunk?
no need
okay
if you disallow breaking in x land it applys to all chunks in x land
yes
one of the advantages of lands is that they can authorize players on some chunks but not on all, as well as rules
ok, each land should have a UUID
probably yes
the uuid could do without it I think
no you cant claim a chunk directly, you claim it in a land context
all lands should have a UUID if you want then to be able to change the lands name
you have reason
reason?
but
<chunk, land> (chunk just contain location)
or
<chunk, land uuid>
<landuuid, land>?
yes its not a problem
you reference by UUID so every other piece of data in teh land can be changed
you mean that <chunk, land> with land instance is not a good idea?
I'd do a (Set) of lands and a Set of chunks
the chunk object holds a field indicating the land it belongs to
no because chunk just contain x z and world (so I can a get a chunk from this coo directly)
without looping it
you also want to be able to assign different permissions to certain chunks
no
all chunks are grouped
if you want to set different permission, create a new lands for that
^
Any ideas why
public void launchShockwaveGrenade(Player player) {
WindCharge windCharge = player.launchProjectile(WindCharge.class);
windCharge.setCustomName("Shockwave Grenade");
windCharge.setCustomNameVisible(false);
Vector direction = player.getLocation().getDirection().normalize().multiply(1.0); // Increase speed
windCharge.setVelocity(direction);
}
Doesn't hide the custom name, i still see it in the air
yes because you can create a new land to set different permission I mean
like I show it with land uuid?
you don;t need to loop, you only need to fetch the relevant "chunk" for teh block you are testing
okay okay i see
but maybe to be more rigorous I'd do better to make a cache system that caches and unloads? (loading all can be a bad idea if you have to load 10 000 chunks for example?)
if you map by land/chunk, you would first have to see which land owns teh block you are testing, then fetch its data from teh lands index
no 10,000 chunk data in your context of protects is small
could a server with more than 1000 members at the same time afford to charge everything to the startup?
all of your tests are for "can player x break a block in chunk x,y"
more or less yes
so the quickest lookup you want is to find that data, which is a simle grab chunk from chunk coords
read for that chunk what land owns it (UUID), pull the land and read permission
the only reference you have when the player tries to break a block is its location
yes so
A<chunk, uuid>
b<uuid, land>
b.get(a.get(mychunk))
yes
cool
?
np
one piece of advice, create a permissions cache
for teh last tested permission
but you can add that when you are further along
I did it in Towny and it improved performance by a HUGE leap.
I always thought about adding key aliases
Because I still, 10 years later, fuck this up
why did you not
i am trying to add ability to plant a fern, everything is going alright but when the plant would grow the fern breaks. I tried to delay it but even after 1 sec delay it stills break.
I am using BlockGrowEvent (Paper 1.21)
Block below = block.getRelative(0, -1, 0);
below.setType(Material.GRASS_BLOCK);
BukkitRunnable task = new BukkitRunnable() {
@Override
public void run() {
block.setType(Material.LARGE_FERN);
Block above = block.getRelative(0, 1, 0);
above.setType(Material.LARGE_FERN);
BlockData upperFernData = above.getBlockData();
if (upperFernData instanceof Bisected) {
((Bisected) upperFernData).setHalf(Bisected.Half.TOP); // Set to upper half
above.setBlockData(upperFernData);
}
}
};
task.runTaskLater(plugin, 20);
https://www.flexclip.com/share/7016887397383460d3dc834221e41e2f23eb338.html
When there wasnt the delay. It only worked with bonemeal.
but when growing naturaly it would break. Then I tried add the delay and evem with the bonemeal it broke.
Does anyone knows what I am doing wrong?
what do you mean in "permissions"? land concept permission? org spigot permissions?
conventionally how to sort my classes and my plugin? just a land manager with all nedded methods? a cache manager with some methods like addchunk, removechunk etc.... and a land maanger with methods like claim# unclaim# ?
I would say something with block updates?
Try setType(type, false);
The only thing i could think of
Good night
Anyone know which event I need to block to stop end crystals destroying blocks? 👀
I assumed BlockExplodeEvent but seems not
end crystals are entities, not blocks
so they'd call the entity explode event
idk if they actually do, but that's a sane line of reasoning
ah gotcha, thank you, that'll be it
Guys can you not edit the player's name tag?
Like if they had a nickname, could the name tag not be changed to that nickname?
I just use a text display with a slight offset after adding it as a passenger to the player
From what I’ve seen and tested, if the text display overlaps with the player name it removes the original and will display your text
@grand flint
iirc whenever I removed my text display the original nametag came back
How does hypixel do it?
Because hypixel is open source
probably armor stands
i assume its armor stands
More than likely yeah
or they modify the game profile
how do u hide the nick?
for /nick?
ye
u cant use an existing account though
you can still modify the game profile
I wonder if minimessage would work in the game profile for fancy colors and what not
but beware i wouldnt recommended doing that unless you know stuff doesnt rely on that name
wdym?
i was asking mvp++ to nick for me
but instead a nicked youtuber came and helped me
he doesnt have an armor stand so i assume its game profile
It's Game Profile
my bad hypixel dev
@remote swallow text display or edit player profile
either
If you’re doing it for 1.8 then use the profile
well yeah no shit text displays dont exist
its on 1.21 though
just use text displays
no
awe i didnt check that on hypixel 😭
you can change that with Player#setPlayerListName or whatever the method was called
what
setCustomName?
declaration: package: org.bukkit.entity, interface: Player
ohhhhhh
I got it right
good job
You got it exactly right lol
Can't imagine the game profile to be easier
why are you even considering game profile, doing it with that requires sending a bunch of packets which is just annoying
well what if none of my plugins utilize players name?
dawg
what do you mean
idk how hard is it i never messed with game profile
I mean, if you want to do it for the fun of it, go right ahead, I'm sure you can make-do with the resources in the forums
you've already been advised against it so, you can do whatever you want now
public void displayTitle(Player player, Title title) {
World world = player.getWorld();
Location location = player.getEyeLocation();
String titleContents = ColorUtil.parsePlaceholders(player, title.getTagContents());
TextDisplay textDisplay = world.spawn(location.clone(), TextDisplay.class);
Vector3f offset = new Vector3f(0, 0.15f, 0);
AxisAngle4f rotation = new AxisAngle4f();
Vector3f scale = new Vector3f(0.75f, 0.75f, 0.75f);
Transformation transformation = new Transformation(offset, rotation, scale, rotation);
textDisplay.setText(titleContents);
textDisplay.setBillboard(Display.Billboard.CENTER);
textDisplay.setBackgroundColor(Color.fromARGB(0x80333333));
textDisplay.setCustomNameVisible(false);
textDisplay.setPersistent(false);
textDisplay.setSeeThrough(false);
textDisplay.setShadowed(false);
textDisplay.setInvulnerable(true);
textDisplay.setTransformation(transformation);
this.activeTextDisplays.put(player.getUniqueId(), textDisplay);
this.activeTitles.put(player.getUniqueId(), title);
player.sendMessage(ChatColor.GREEN + "You have just equipped the " + ColorUtil.convertLegacyColorCodes(title.getDisplayName()) + ChatColor.GREEN + " title!");
player.addPassenger(textDisplay);
}```
This + the list name method
Or have fun with packets kek
I still hate how it is called minestom and not minestorm
I know it is supposed to be minecraft + custom but still
i know
why would it be called minestorm
😭
because that reads easier
i like minstom :D
it is a storm in the minecraft source code kek
I mean it has no relation to the Minecraft source code at all so 👀
Will not reset.
itemstack.setItemMeta(yourmeta)
Why can't I just usemeta.setTool(tool);
You need to update the itemstack
getItemMeta is ALWAYS a clone. you have to modify and put it back after
I was able to do it! Thank you very much!
What are Billboards
bill·board
/ˈbilˌbôrd/
noun
a large outdoor board for displaying advertisements.
"the display of suggestive advertisements on billboards"
It determines how a display entity rotates client side
Ah
Is there a way to get the translation/rotation value of a thing after applying scale rotation and translations
Of a display entity? Yes, absolutely. You can get its transformation and each component can be pulled out individually
Or as a Matrix if that's what you want
Oh you can't actually get it as a matrix, interestingly enough. You probably should be able to turn a Transformation into a Matrix4f
Does it use the same functionality as item/block model matrixes?
alright thanks, ill try
thanks you so much! it is now working
Anyone have any advice on where to start a reset vault for each individual player I think I have a way of doing but I feel like I’m making it more difficult than it should be any ideas?
you should definitely host this type of data on a db
also what is a reset vault
Yeah a db of course no doubt lol
But a vault which open up on a set period of time maybe once a week and you can only put specific items in there
Your see it on a lot of big servers but unfortunately there isn’t anybody who has a prebuilt I can look at and then code from there
I might just make my own and then sell it
wym you can only put specific items, like it's not generated by the server?
do you have an example
Okay so I have the custom items using item adder what I will do with that is sell it on the store but I want players to be able to keep them even when the server resets
idk, if that's what it is, should be fairly simple
just have each entry be associated with a player id, and the command to get the item
does it need to be a gui or is it like a claim command every reset
then you need some flag to represent that the player has executed the command or taken the items from the gui
and reset the flag for hte player on reset
Yeah all what you said with a gui is needed for this just like a private vault tbh but I wonder if there was any suggestions in creatingvit was going to use maybe zmemu/deluxmenu with script
But thought maybe someone might know better way
hi im new to spigot and im having trouble hooking Vault into my plugin can someone help
i have the dependency set and have verified that vault and my econ plugin are functioning but for some reason my plugin cant see vault
Ensure you have a softdepend in your plugin.yml
softdepend:
- Vault
Also what do you mean “can’t see vault”?
Is there any errors you can provide?
i do have a soft depent for vault
[04:52:12] [Server thread/ERROR]: [SwearJar] Vault not found! Economy features will be disabled.
[04:52:12] [Server thread/ERROR]: [SwearJar] Vault is not installed! Disabling plugin...
[04:52:12] [Server thread/INFO]: [SwearJar] Disabling SwearJar v1.1
[04:52:12] [Server thread/INFO]: [SwearJar] SwearJar disabled!```
What does your code look like?
if (!setupEconomy()) {
this.getLogger().severe("Vault is not installed! Disabling plugin...");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
// Load config
saveDefaultConfig();
loadConfigValues();
// Register the chat listener
Bukkit.getServer().getPluginManager().registerEvents(this, this);
this.getLogger().info("SwearJar enabled!");
}```
And the setupEconomy method too
if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) {
getLogger().severe("Vault not found! Economy features will be disabled.");
return false;
}
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
getLogger().severe("No economy provider found! Economy features will be disabled.");
return false;
}
econ = rsp.getProvider();
return econ != null;
}```
Hm that is strange, and when you do /pl can you see vault in the plugins list?
yes i see vault and gemecon
Can I see your plugin.yml
version: '1.16.5-1.1'
main: com.fennekfoxy.swearjar.SwearJar
api-version: '1.16'
author: FennekFoxy
softdepend:
- Vault```
idk why it cant see it ik its loading because when i take off the depend i get
[SwearJar] Loaded class net.milkbowl.vault.economy.Economy from Vault v1.7.3-b131 which is not a depend, softdepend or loadbefore of this plugin.
but it still disables the plugin
What economy plugin do you have?
gemseconomy
is it supported by vault?
it will show in your log if it is
Vault will say that its hooked
lemme load it up
Can i get texture value from image url, to set this on the player?
all texture values/signatures come from Mojang
But how znpcs or citizens work?
It can set skin from url
the URL is a link to mojang for the client to fetch the skin
i dont see anywhere that it says its hooked but i know a server running this plugin with vault as their main econ plugin
In the correct format you set it as a Texture Property in the profile
it says it has Vault support, however it does say discontinued too
?paste your server latest.log
hot take this syntax is stupid orientedNeighbours.values().forEach(ChunkData::updateGeneratedNeighborCount);
I really don't like Class::method
feels like it doesn't belong in java
I see no injection into Vault for gems eco
what econ plugin do you recommend i use ill try a different one and see if that does anythign
...
[05:19:20] [Server thread/INFO]: [SwearJar] SwearJar enabled!
[05:19:20] [Server thread/INFO]: [Essentials] Enabling Essentials v2.21.0-dev+115-6157668```
it was the econ plugin this whole time ...
thank you for your help
did you setup an economy in gems?
it looks like you have to /gcur
to setup a currency
i did
anyone know off the top of their head how I can stop the ability for players to pickup arrow entities
gemcurrency supports til 1.16.4 and u run 1.16.5
oh well im making this for a friend and they already have all the econ stuff set up
oh
last update doesn't mention any support for higher.
well thanks everyone for the help
@EventHandler
public void onArrowPickup(PlayerPickupArrowEvent event) {
event.setCancelled(true);
}```
this literally does nothing
I mean what else would it be?
How do you think it should have been done instead?
like purple
Just having a lambda?
honestly I'd prefer class::method()
Fair, although that does imply invocation
your mom implies invocation
That’s rude
my right to free speech requires invocation
Yea well you do you
But you can type /npc skin --url (image url)
And it fetch skin
I want do the same
the URL will at some point point to Mojang
Can i do this like in this plugins?
But how?
I've got a dynamic scoreboard system that shows playercount, ping, etc. should I sent packets to the player only when neccessary to update the scoreboard, but have to make sure I account for everything in my code, or do I send them an update every tick or a certain interval, maybe async?
PlayerProfile#getTextures#setSkin(URL... or somethign close
apply the player profile to the NPC
just wanting to hear thoughts
should I run it async?
you can as you are doing packets, but remember you need to read the data you are sending
not many Bukkit methods are safe async
okay thank you
Hi, is there anyway to have projectile only pvp in a region when regular pvp is disabled?
Check for region
Check for Damager
If Damager is Projectile ✅
else ❌
EntityDamageByEntityEvent
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDamageByEntityEvent.html
declaration: package: org.bukkit.event.entity, class: EntityDamageByEntityEvent
Coding
If you use a plugin go to #help-server
Ask in #help-server or on the worldguard discord (if they have one)
I'm using SQLite to store uuid's & chunk coordinates to claim a chunk. However, how would I be able to store multiple chunks for one user?
public static void claimChunk(Player p, int chunkX, int chunkZ, String claimChestLocation) throws SQLException {
if (chunkClaimed(chunkX,chunkZ)) { return; }
try (PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO claims (uuid,username,chunkX,chunkZ,claimChestLocation) VALUES (?,?,?,?,?)")) {
preparedStatement.setString(1, p.getUniqueId().toString());
preparedStatement.setString(2, p.getName());
preparedStatement.setInt(3, chunkX);
preparedStatement.setInt(4,chunkZ);
preparedStatement.setString(5, claimChestLocation);
preparedStatement.executeUpdate();
}
}``` I'm unsure wether or not this is necesarry code
You can store the data in the chunks themselves no need for database really.. but you can just parse multiple of the same queries? What's stopping you from sending the same query more than once?
Because I can't have a duplicate string
uuid can only be stored once
I can't store 2 of the same uuids
of course you can, you just need to use multiple ids to find the correct one later.
have an id with auto increment as primary key and uuid isnt unique
That's the limitation I have with sqlite, they provide their own ROWID as Auto increment, but I can't make a auto increment row myself.
use the type they provide?
you get the id
insert into table (x,y,z) values (?,?,?) returns id or smth similar
If the id wont work I might take a look at this..
can you show your table query where you generate it
Sure thing!java try (Statement statement = connection.createStatement()) { statement.execute("CREATE TABLE IF NOT EXISTS claims (" + "uuid TEXT," + "username TEXT NOT NULL," + "chunkX int NOT NULL," + "chunkZ int NOT NULL," + "claimChestLocation TEXT NOT NULL)"); }
username is a bit redundant but you could do something like
CREATE TABLE IF NOT EXISTS claims (
id INTEGER PRIMARY KEY AUTOINCREMENT,
uuid VARCHAR(36),
username TEXT NOT NULL,
chunkX INT NOT NULL,
chunkZ INT NOT NULL,
claimChestLocation TEXT NOT NULL
);```
I only store username for the server admin to see what uuid is what username
you can get that by getting the player instance
ah, you can just fetch the username from uuid instead of having stuff in the database.
If you do uuid varchar(36) do please username VARCHAR(16) too instead of TEXT xd
I see what i've been doing wrong in my attempts now, i've been using INT PRIMARY KEY AUTOINCREMENT, instead of INTEGER. Seems to work, thanks!
varchar for uuid 💀
why not lol
Im curious too
its always gonna be 36 so char afaik
welp, uuid types aren't that supported yet is it?
but blob might be good havnt used it
there is no reason to waste so much space by using a varchar for something as binary as a uuid
you mean store it as a UUID in the database? ran into issues with support not being up todate on platforms yet
if a player places an itemstack with a pdc does it stay there? ( player gets an item (block) with pdc, now i need to check if the player clicks on the block (check if pdc is there))
Erm yeah there is so you can do UUID.fromString
No
You'll definitely need to keep track of the block
I'd do it with
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Just copy the pdc over to the block and vise versa
what
ok thanks
I should note the exception to this is block entities so be careful
Block entities hold pdc
And it's copied over
some sql supports UUID as a variable. so you can literally parse a uuid.
yes
Yeah like SQLite
the point is the storage format
there is no reason to waste 36 bytes in something that is 16 anyway
therefore, blob is a perfectly reasonable thing to use
and the engines that support uuid types natively like mariadb or postgresql will use the binary format rather than the textual format
yea, 16 bytes it better
Idk if im stupid but the api is saving the block pdc in the chunk
https://github.com/mfnalex/CustomBlockData/blob/c95092df3d32a7ec2d58043018ef19d5f2fb082b/src/main/java/com/jeff_media/customblockdata/CustomBlockData.java#L284
So it could work with normal blocks too
I know
Do you not understand anything I say?
"I should note the exception to this is block entities so be careful"
I'm simply pointing out the redundancy of storing pdc 2 times
It's a wate of data
Im not native english speaker, so technically you are right
depends, like the approach of Relula
just be aware that it MIGHT be false, so i rather would use other naming, like lastUsername
Is there some magical way to get the servers external ip or am I best off just querying checkip.amazonaws.com
what is the problem
?paste
literally everything
public class HavenChunkGenerator extends ChunkGenerator {
@Override
public void generateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkGenerator.ChunkData chunkData) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
var blockX = chunkX * 16 + x;
var blockZ = chunkZ * 16 + z;
chunkData.setBlock(blockX, (int) PerlinNoiseGenerator.getNoise(blockX, blockZ), blockZ, Material.DIAMOND);
}
}
}
}```
does anyone knows why this code doesn't work and crashes my server?
at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.unrecoverableChunkSystemFailure(ChunkTaskScheduler.java:336) ~[paper-1.21.1.jar:1.21.1-98-9b1ee0d]
at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.NewChunkHolder.lambda$setGenerationTask$4(NewChunkHolder.java:1622) ~[paper-1.21.1.jar:1.21.1-98-9b1ee0d]
at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.task.ChunkProgressionTask.complete0(ChunkProgressionTask.java:91) ~[paper-1.21.1.jar:1.21.1-98-9b1ee0d]
at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.task.ChunkProgressionTask.complete(ChunkProgressionTask.java:74) ~[paper-1.21.1.jar:1.21.1-98-9b1ee0d]
at ca.spottedleaf.moonrise.patches.chunk_system.scheduling.task.ChunkUpgradeGenericStatusTask.run(ChunkUpgradeGenericStatusTask.java:143) ~[paper-1.21.1.jar:1.21.1-98-9b1ee0d]
at ca.spottedleaf.concurrentutil.executor.standard.PrioritisedThreadedTaskQueue$PrioritisedTask.executeInternal(PrioritisedThreadedTaskQueue.java:351) ~[paper-1.21.1.jar:1.21.1-98-9b```
part of my error message
Did you ask ChatGPT maybe he knows
does mc shade joml in?
no
this is a paper issue
Why are you setting blocks outside the ChunkData area?
z - the z location in the chunk from 0-15 inclusive
you are attempting to set to the absolute location (chunk + block offset)
it's a relative coordinate, 0 to 15
^ long version
oh my god
i'm so dump
i doubt chunkX and z what you want either
@Override
public void generateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkGenerator.ChunkData chunkData) {
var noiseGenerator = new PerlinNoiseGenerator(worldInfo.getSeed());
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
var blockX = chunkX * 16 + x;
var blockZ = chunkZ * 16 + z;
var blockY = (int) noiseGenerator.noise(x, z);
System.out.println(blockY);
chunkData.setBlock(x, 0, z, Material.DIAMOND);
}
}
}```
still the same error
what should i change?
chunkData.setBlock(x, 0, z, Material.DIAMOND);
when iremove this line it works
what works?
also, why are you generating a noise for Y and not using it?
nothing wrong with the new code
i'm just testing
unless you have an altered min height
Hey does anyone know how to put more broad letters on my Minecraft server?
Like this ones
?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
thats just small caps
Yes but how do I put small caps
Oh thanks you saved my life
Da hail is that
go back to your middle school and demand a refund
??
Does any1 knows a Plugin that tps a Player to his latest coords when hes leaving the World?
Its on a Server, but they spawn in the Lobby, and can Join the survival world via npc. But then they get tped to the worldspawn
Any way to fix this?
I tried Multiverse but this mv keeps tping on spawnpoint
hehehe
none of this is final, they're what we call graybox prototypes
basically just shells
also this isn't even what won the poll as it turns out
the vote changed so we're not even going to be doing villages yet
nor the city
there's one optimization I'm keen to add early on I think
but it's mildly tricky
I sort of want to dump calcified chunks into some temporary file thing so I can clear memory as I go
this takes straight up whacky amounts of ram to do really big worlds
this nightmare is what won
I am so confused on what is going on here lol
basically a bunch of underground rooms and corridors, right now it's completly untweaked so it's mostly just tunnels which is not accurate to what it will end up as
Is this still apart of that maze generation project or whatever that was?
does anyone know is using block.setType(); does trigger BlockBreakEvent?
if yes how I can disable it for that case?
no it doesn't
Player#breakBlock(Block) however will
so uh, just don't use that lol
all of the screenshots are the exact same system
wave function collapse generation
they're just different tilesets for it
well, a twist on the wave function collapse generation
I don't know if my special blend has been used before but I am pretty happy with it
is there a way to make a bow that shoots multiple arrows horizontally? i've tried it with vectors, but it seems not to work properly, because it depends on where the player is facing. looking diagonally, it works fine. but looking for example west, it doesn't work because the positions adapt themselves to the other one
anyone here used inventory framework by stefvanschie
how do i update the title of a gui
One question, I want to replace the /help and /? commands. from bukkit for a personalized one that brings my core how I do it'
https://paste.md-5.net/ukopavowih.java
The who?
You update the titles in inventory views
its IF
check if its instance of NamedGui and then call setTitle
can y show example
im calling it in a clickevent on a guiitem
but nothing happens
open the inventory again after setting the title
oh
aha good job
thanks elgarl
what about updating items in the gui
if i call Gui#show it just removes all the items from the gui
Gui#update does nothing
Add the items and then reopen the inventory again
can i override the show method to add the items
or something
cuz idk what u mean
Just do this but with the items @proper cobalt
Set contents -> reopen gui
aight ill try it i guess
nah didnt work @worthy yarrow
what about open gui -> set contents
Maybe that framework is just bad then, that’s how it’s done without one so I’m not sure
I’ve never used that lib before is
yeah framework is trash
So*
Maybe it’d be better to make your own :p
na
Usually what I end up doing lol
being forced to use it
When does the setPlayerListName or whatever that method is needs to be called?
I need a little help on something, think of a chest, there are many items and the items drop according to the chance rate, what method can be used for this chance rate? To give items according to chance
?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! 🎉
I already set up this system but it's ridiculous, items with low chance rates appear more than those with high chance rates.
org.bukkit.plugin.InvalidPluginException: Cannot find main class `dev.nedhuman.dupedetect.DupeDetect'``` why could this be happening? the class is right here
Decompile the jar and see if it’s named correctly
ok weird its dupeDetect in the decompiled jar
Are you obfuscating or smth?
nope
its capitalised differently in the decompiled jar for some reason
ok I restarted intellij and issue resolved now
I think that means your code is bad
?paste
I can't seem to find EntityPlaceEvent in the spigot javadocs? Anyone got information about this?
Does it use the same functionality as item/block model matrixes?
It's an affine transformation
affine deez nuts
wtf
bump
does it need to be set at a certain time for it to work?
how does playerlogin event work if a player is banned or the server is full
does it show the result as kicked/banned server full?
isnt it the async one if the player is banned?
or is that for later versions
@molten hearth
fuck if i know 💀
pls
wait
yeah i dont think that fires if the server is full
if you change a player name dont u have to despawn and respawn them
yes thats the player name
what does that got w spawning
well shouldn't it be already set when i join as a nicked player
i dunno i believe player lists suffer from autism
look;
its not mine but sunlight does this
but when i tab, i see my username not my nick
thats the plugin im using
i suggested him to use that yday and he said he is using it already and sent me this piece of code
oh
so idk why it still displays my username when i tab
like by tab yk what i mean right?
also my bad i was thinking about player profiles with respawning not setPlayerListName
yeah
LOL
¯_(ツ)_/¯
ill see if i can find it
for the nametag ima just use text displays
i cant bother dealing w player profile
then tryna make sure no plugin uses the usernams
Then in the server config disable tab completing usernames for non existing tab completes. It’s possible this is a paper only setting. Which would be suggested to use anyways.
yeahh thought i saw it somewhere
thxx
This is because for it to be empty, the tab complete code would require setting “” empty string for anything that’s supposed to be empty, which most devs overlook.
Otherwise follows vanilla behavior that always needs a username.
are u talking about tab complete cuz u replied to sum else
hey if i execute a function in runTaskAsync, will the entire function run asynchronously?
like
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
myFunction();
}
yes, but remember much of Spigot is not safe to call async
Don;t ask about paper in spigot
okay sorry
It’s not safer. The issue is minecaft runs on the main thread, async can sometimes skip functionality or not reach the values you are looking for
If used correctly, async can be good. Just need to be careful
i'm using it to make http requests
but i'm using the value of something of the http request
i'm making the http request in the onEnable because i don't need it to update every time
Use a CompletableFuture, and pass that pending value from your HTTP Request onto the task and use run in order to run your other task on the main thread
hi so im currently making a gui in my plugin and I want to be able to identify each item in the gui not using the name or meta data or anything like that or even the placement in the gui. What part of the meta data can i use to set a unique identifier that cannot be seen ingame. I was thinking of using the setLocalizedName() but apparently it is going to be removed in the future. What can I use?
Please ping for response
?pdc
mm nothing better than mapping a toml table to a tree because kotlin serialization sucks
tbf my goofy ass approach with 2 methods recursing on each other might crash at some point
hey! maybe it's a dumb question, but is there any difference between (int) and Math.round()?
or it's the same?
Yes
what's the difference?
When you convert by first way it does no rounding. It simply removes those digits as if they never existed
Health bar example syntax
The rounding method lets you specify if you want to round up or down. By default i believe it rounds down
it rounds based on value
Round could be instead of 25.2, 26?
Floating point health bar syntax
so .5 ^ is ceil
Yeah i understand
Like shops round the value of smth from .99$ to 1$ (dumb example ik)
Right and if you just simply tried to make 25.2 an int. It pretends .2 doesnt exist and you end up with 25
Oh okay okay thanks
Sometimes this is fine other times you might want to round up first

Lol