#development
1 messages · Page 138 of 1
PersistentDataContainers dont store when the plugin stop right ?
Ty guys
It’s just a map
Oh ok
Nono its persistent
I use those on items etcc
PersistentDataContainer will save stuff into the items/chunks/entities itself
https://paste.helpch.at/eniculilog.cs Anyone know how i can make it so that once a player swaps to a different slot the sword will deactivate? currently i have it as a left click action.
I'm trying to make a 1.8 plugin, but keep getting Missing artifact net.md-5:bungeecord-chat:jar:1.8-SNAPSHOT in my pom. Any idea how to fix it?
probably not a valid import
This is my entire pom though https://paste.helpch.at/quvuzipuyo.xml
add the sonatype repo
https://oss.sonatype.org/content/repositories/snapshots
This right?```
<repository>
<id>sonatype-oss-snapshots1</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
Does anyone know why World(WorldEdit wrapper object)#getBlock returns minecraft:air from WorldEdit if its an editied block and not a vanilla block?
What version?
[20:55:13 INFO]: FastAsyncWorldEdit version 2.2.1-SNAPSHOT-184;d1f3ac8
[20:55:13 INFO]: Blazingly fast world manipulation for builders, large networks and developers.
[20:55:13 INFO]: Website: https://www.spigotmc.org/resources/13932/
[20:55:13 INFO]: Authors: Empire92, MattBDev, IronApollo, dordsor21 and NotMyFault
huh?
Where does the modded block come from?
i mean like an editied block (by worldedit)
or vanilla (generated/placed by a player)
Anyone know how to setup a event that prevents players from moving a specific item in their inventory?
Ive tried all I know and nothing has been successful
Ah well, that probably depends on more context then
InventoryClickEvent -> check if currentItem or cursor is the item, if so, cancel
and also check PlayerDropItemEvent
those two should cover everything
Okay I got the playerdropitemevent to work. Could you setup a small example of the inventory click event?
d;spigot InventoryClickEvent#getCurrentItem
@Nullable
public ItemStack getCurrentItem()```
Gets the ItemStack currently in the clicked slot.
the item in the clicked
d;spigot InventoryClickEvent#getCursor
@Nullable
public ItemStack getCursor()```
Gets the current ItemStack on the cursor.
the cursor ItemStack
Do you know how I could create a cross then?
Having the middle of the cross being where ever I wanna set it and then the the cross going outwards in a specific cuboid
material: head (head-%player_name%)
color: 255, 135, 0 #rgb
slot: 4
display_name: ' &8&l>>&a&l%player_name%&8&l<<'
lore:
- '&8Grades: %luckperms_prefix%'
- '&8Money: &e%vault_eco_balance%$'
- '&8Credits: &e%guiredeemmcmmo_credits% &6Gcoins'
priority: 1```
Hello I have a small problem with deluxemenus The head does not want to appear While I did exactly the same thing as in the doc
i love @lyric gyro sas
That's the scentific notation of a really small number
answer: javascript
how can I get this "not scentific" version of it using java ?
I'm using java
java doesn't use scientific notation
Hi all. Does anyone have a tutorial or maybe someone knows how to add a new scale using a plugin and a resource pack? For example, the thirst scale, which can be controlled from the plugin.
I believe it does
Nvm, I might think about js as well
Nvm x2
?
Help plz
A scale?
New UI element
I know, how I can make this element, but how to arrange his, how on this photo, I don’t know
A thirstbar above the hunger bar?
That would use the actionbar with icons inside the resourcepack
Yes, but I want that this element is at the top of the screen
You could use an invisible bossbar for that
That would probably require some tinkering with core shaders
Every screen resolution is different and mc has no real way to put stuff in the top corner
Ok, if I use the boss bar, can I use the other boss bars?
Yeah
They will just be one ‘bossbar slot’ lower
Thanks
How can I make such a boss bar?
How do I add a permission to a player?
I tried adding Group Manager as an API & came all the way down to implementing a DataUnit and adding a permission that way but I can't create a new data unit bc its an abstract class & have no idea how I'd access that sort of thing
you should either use vault or the spigot api directly https://papermc.io/javadocs/paper/1.18/org/bukkit/permissions/Permissible.html#addAttachment(org.bukkit.plugin.Plugin,java.lang.String,boolean)
bro use luckperms
ew
"ew" using groupmanager in 2022
I'm old school xD
you're outdated
it works
that doesn't mean you shouldn't improve your system
lol
I mean sure I can use Windows ME, "it works"
does that mean I should stay using it for no reason?
well I dislike any other one except for PEX and I don't remember if pex is still supported
How can I make an invisible boss bar?
have you like actually tried LP? Its great. I don't see why people "dislike" it. I've put that in quotes bcz people usually don't even try it. Seems like they just don't want to follow the trend or whatever. Even tho LP is the trend bcz its great.
I dislike that its used on a website
Can be done in-game
You don't have to use the web editor
you don't have to tho
Who dislikes it?
me
hey @broken elbow the permissible attatchment, I see no input fields for player or group
I've seen people in #general-plugins saying the same stuff and that they'd rather use pex or group manager. for exactly 0 reasons.
wow
weird
we're comfortable w/ it duh
a Player extends Permissible
we don't follow trends emily. we're the cool kids. we deprecate ourselves just to not be like every other person
:)))
oooh so like p.addAttachment(GroupManager, "perm", true or false to add or remove)?
I'm looking in my IDE wasn't looking at discord
I was responding to this
Also, why not use the vault api for permissions, that way you can have it working with multiple permission plugins
I'll use the vault api if thats the case then
I dont really remember what exactly it allows you to do, but I do know vault has one, I assume it should have something to add permissions
I'll give it a look
Alrighty
I learned how to make my first plugin like a week ago & understood every part of it.. today is my first official day of getting my hands wet in code & making a plugin that I rly need for my project
I've been programming for like 5 years now & on like yr 2 didn't understand anything about creating a plugin now I understand every aspect of it
its quite a nice feeling
I see
Good luck
This might help: https://bukkit.org/threads/adding-permissions-to-players-using-vault.359453/
The last post in the thread
thx
Help
OfflinePlayer's can still be used for players that exist online right?
rip
Rip?
you've asked b4 my help & no response
mhm
What?
Whats the point of a boss bar that isnt visible?
do you mean nameless bossbar?
I'm assuming by that he means just the text at the top no bar that way it shows as like a subtitle.. I haven't seen it so I don't think it exists
Could be possible via resource packs
I managed to implement it but I have no idea if it works.. it doesn't show when I do manulistp & then myself
check Player#hasPemission
ah good idea
ok so it didn't work
import net.milkbowl.vault.permission.Permission;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;
import java.util.ArrayList;
public void AddPerms(OfflinePlayer p, ArrayList<String> perms, GroupPermissions main){
RegisteredServiceProvider<Permission> permissionProvider = main.getServer().getServicesManager().getRegistration(Permission.class);
if (permissionProvider == null) {
return;
}
Permission permission = permissionProvider.getProvider();
for (String perm : perms) {
permission.playerAddTransient(p, perm);
}
}```
there are no compiling errors
Get the default bossbar sprite sheet and remove a color
Bars.png
have you guys added permissions to players b4? it shouldn't be this hard 😒
Yes but not with GM
Either Vault or Bukkit's PermissionAttachments generally work but ¯_(ツ)_/¯
GM best
I agree with you
It was a joke, in case you were not aware
its best idc what anyones says
its been with me for a good 7 years :)
I just need the code for this vault plugin & adding a permission because it requires a plugin reference & I have no idea how to pass the vault plugin as reference
unless I don't use the vault plugin
It's literally not and you're experiencing it right now lmao
well I've never created plugins until now
and besides I'm using vault not GM to solve this
but I have no idea how to figure it out
so there is the permissible method called addAttachment that takes a Plugin parameter, does that need to be the vault plugin or can I just write this?
I think I've been reading it wrong & I'm supposed to use the current plugin bc it says the one responsible for the attachment which should be the plugin I'm working inside of
public void AddPerms(Player p, ArrayList<String> perms, GroupPermissions main)
{
for(String perm : perms) {
p.addAttachment(main, perm, true);
}
}```
why do I feel like it was that easy?
Vault is just an interface to the permission implementation, in your case GM
welp
if it was this easy I'm going to cry in my sleep
Could you please explain to me why do you so religiously refuse to use an objectively better replacement?
I'm legitimately curious
bc its shit & I got it to work
old school is better 🙂
Why is it shit?
You are avoiding my question
it was good until maybe 2015
It's shit
Always was shit, there's no denying it
Just cause there wasn't anything better, doesn't mean it was ever good
luckyperms is so different to every other permission plugin I refuse to use it
tbh its personal preference
Yet it is actually what a permissions plugin should be, professional and easy to use
But yea use whatever you want, just an opinion
its just that /mangaddp or /manuaddp is fried into my brain that ik what it is at any given time
its super easy to use
I remember first learning pex, it was a nightmare
now its second nature
I mean yeah the first time you use anything it's gonna be hard
yes
I remember something about not using LP bc of version control
like it was only for newer forks
well it depends how old you mean with "older versions"
the regular bukkit build works on 1.8.8, there's a separate bukkit build for 1.7.10
now ik that anything using java 1.8 can support all the way up to 1.16
import static fr.revosia.moderation.utils.ListUtils.hiddenUsernames;
public class TabEvent implements Listener {
final List<String> pluginCommand = Arrays.asList("?", "help", "bukkit:", "ver", "about");
@EventHandler(priority = EventPriority.HIGHEST)
public void onTabComplete(TabCompleteEvent ev) {
if(ev.isCancelled()) {
return;
}
String partialPlayerName = ev.getCursor().toLowerCase();
int lastSpaceIndex = partialPlayerName.lastIndexOf(' ');
if (lastSpaceIndex >= 0)
partialPlayerName = partialPlayerName.substring(lastSpaceIndex + 1);
pluginCommand.forEach(cmd -> {
if(ev.getCursor().startsWith("/" + cmd)) {
ev.getSuggestions().clear();
ev.setCancelled(true);
}
});
//Ajoute les joueurs du proxy au complete
if(partialPlayerName.isEmpty()) {
for (ProxiedPlayer p : ProxyServer.getInstance().getPlayers()) {
ev.getSuggestions().add(p.getName());
}
} else {
for (ProxiedPlayer p : ProxyServer.getInstance().getPlayers()) {
if (p.getName().toLowerCase().startsWith(partialPlayerName)) {
if (!hiddenUsernames.contains(p.getUniqueId())) {
ev.getSuggestions().add(p.getName());
}
}
}
}
}
}
Hello i want to make a system that when i type /players <tab> it will show the list of all players currently connected on the proxy
Could some1 help me
The following code dont work
implements TabCompleter <-----
I figured out why I never used it.. So I have a world guard region where it gives the player speed, if the player is an operator, it neglects the speed entirely because they are an operator & its a bypass.. On Group Manager, the * perm doesn't make you an operator, it just gives you every permission. On LuckPerms, it makes you an operator which means it bypasses the speedway unlike group manager does. This way anybody with the * perm can't fully experience the game aka super admins.
what
It doesn't make you an operator and WG has a bypass permission
And I mean yeah using wildcard is not meant to be taken lightly lol
im pretty sure that "super admins" aren't supposed to experience the game like a normal user anyways lol
You should never even give the * perm to anyone
That's just poor management
Not even your own user should have that
What is the best way to make an custom gui? With an dependency? Manual with the Inventory Object?
Inventory inv = Bukkit.createInventory(null, <slot-amount>, "Inventory Name")
i'd use something like triumph gui https://mf.mattstudios.me/triumph-gui/introduction
Thank you, I am going to try it
Hey
Did anyone ever made a fork or something for EzBlocks?
Would be cool to have an API to SET the blocks
Just ask your question lol
!paste
I'm trying to set a higher note than 24 on noteblock (it's for making custom blocks), does any one have an idea about how to bypass the limit ?
bump
What’s the accepted practice when “forking” free, closed source plugins from spigot?
go for it
Just do it and link credit back?
if you're reuploading somewhere then yeah credit, permission if you can get it (especially if the original is still active)
however legally you're in the clear
"Closed source" ...
Dunno how you'd fork a closed source plugin anyway
Apart from decompiled code which is probably a legal grey area
Decompiling.
it's a plugin
If its not open source the code is not be used by others.
sure that may be your personal opinion, but your personal opinion is not factored in the license all plugins are under
All plugins are unlicensed until the author puts them under a certain license. (All rights reserved)
no, all plugins are under gplv3
Can't be as minecraft server isn't under GPL
Ehh I thought the GPL thing wasn't true?
Can't GPL code that contains another license (countering the GPL licensing terms)
it's not so much that it isn't true, it's more the case that it hasn't been tested in court
Ah I see
The bukkit API is
Its marked as that yes. But it doesn't follow proper licensing.
how
How so?
what about its licensing is invalid
bukkit does not contain any nms references
Legally also I'm sure you could argue that decompiled code isn't licensed, since it's virtually unrecognisable from the source - change a few names and there is practically no way of linking them together
here's the thing, bukkit's license isn't invalid
As piggy just said, bukkit does not contain any mojang licensed code
bukkit is without a doubt gpl
craftbukkit on the other hand, its license (lgpl), is a bit more iffy
however plugins which do not depend on craftbukkit will be depending on bukkit, and therefore are under gplv3
i.e. 99.9% of plugins
the fact of the matter is even if you are breaking the license, I highly doubt anyone is actually going to take you to court over it
it's ambiguous enough that you'd struggle to make a strong case
And if it's free then it would be literally just burning money
Lets use everyone elses example.
People claim that because plugins "link" to bukkits api they have to follow bukkits GPL (Which is invalid).
So since Bukkit "links" to code that contains a license that counteracts to the GPL terms it cannot be GPL and falls under the licensing of the minecraft server software.
Mojang authorizes the ability to use its code but not authorization to change its licensing.
bukkit does not link to any code
bukkit is a standalone api with references only in other libraries that fit within bukkit's choice of license
craftbukkit, which is under lgpl, implements bukkit
it is craftbukkit's license which is invalid
yeah the bukkit license is perfectly sound
regarding why plugins are under gplv3 because of bukkit, give me a moment, I'll link you to the official word of gnu
God bless Richard stallman
Proving my point
no
not at all lmao
most plugins have no reference to craftbukkit
and bukkit also has no reference to craftbukkit
Does someone know about my issue ?
Bukkit interfaces craftbukkits code xD
Other way around
bukkit does not contain any reference to craftbukkit code
Craftbukkit implements bukkit, which is just a set of interfaces
I see no craftbukkit imports, reflective or explicit
Yeah where's the CB code there?
"links"
Ok, maybe I'm wrong about Bukkit.
Lets say spigot as thats what most people use. Spigot does "contain" and "link" to craftbukkit and the minecraft server code
The short answer is that if they did, then the version agnosticism of the apis wouldn't work
Also Spigot is not the most used, Paper is nowadays
eh
...
maybe more servers run paper but I assure you more plugins exist out there right now that use the spigot api
I said spigot.
ok?
Oh true sadly
it's probably going to stay like that for... quite a long time
😔
people didn't move to spigot from bukkit for ages
actually that's not a good comparison
people sorta had to
i'm stupid ignore my statement
yeah enough people still use spigot that targeting the paper API is a pain
Some still use the Bukkit website, like world edit
Paper causes to many issues when I have used it in the past.
Also had an issue with entities and chunk loading/unloading on my minions plugin.
IDK if these issues are fixed just know me and others had them.
it's probably going to be a few years before the number of new plugins built against paper will be larger than the number of new plugins against spigot
- assuming paper's growth continues as is
Fucking lmao
I remember it through velocity errors on my grappling hook plugin.
The plugins will only chance when hangar is released or spigot allows paper only
Neither of which are happening
Yup
😔
Didn't MiniDigger say paper wasn't doing hangar anymore?
It went through a complete redesign
matt are you a mod in paper or something?
oh lol
Nah i hardly talk on paper but I talk with people that are part of the team pretty often
what's happening in #dev-general ?
genocide
o
Yeah not finding where I read it.
Actually its probs in one of the discords I left xD
Sponge team and paper are both working on hanger iirc
craftPlayer = Class.forName("org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer");
Method getHandle = craftPlayer.getDeclaredMethod("getHandle");
Field playerConnection = getHandle.invoke(craftPlayer.cast(p)).getClass().getField("b");
ConsoleOutput.debug("ConnectionField: "+playerConnection.getType().getName());
Arrays.asList(playerConnection.getClass().getFields()).forEach(
field -> ConsoleOutput.debug("Name: "+field.getName()+" Type: "+field.getType().getName()));
```Any ideas why this worked in every version but 1.18.2? (Of course with adjusted names)
In 1.18.2 it outputs ```
[DEBUG] PlayerConnection: net.minecraft.server.network.PlayerConnection
[DEBUG] Name: PUBLIC Type: int
[DEBUG] Name: DECLARED Type: int
and what exactly is "this"?
... the code in the message...
what is that supposed to do lol
Output all fields of the PlayerConnection class
ok, and what doesn't work? It doesn't find any fields or what
Yeah. Read the output.
d;jdk Class#getFields
public Field[] getFields()
throws SecurityException```
Returns an array containing Field objects reflecting all the accessible public fields of the class or interface represented by this Class object.
If this Class object represents a class or interface with no accessible public fields, then this method returns an array of length 0.
If this Class object represents a class, then this method returns the public fields of the class and of all its superclasses and superinterfaces.
If this Class object represents an interface, then this method returns the fields of the interface and of all its superinterfaces.
If this Class object represents an array type, a primitive type, or void, then this method returns an array of length 0.
The elements in the returned array are not sorted and are not in any particular order.
1.1
SecurityException - If a security manager, s, is present and the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of s.checkPackageAccess() denies access to the package of this class.
the array of Field objects representing the public fields
Returns an array containing Field objects reflecting all the accessible public fields of the class or interface represented by this Class object.
probably fields were made private
No they're public
CraftPlayer.getHandle() returns EntityPlayer
EntityPlayer.b returns PlayerConnection
Any other ideas @dense drift ?
the output does not match the code, first line of the output should be different already
??
??
net.minecraft.server.level.EntityPlayer
The above code works on all versions except 1.18.2 as long as you change "b" and the version in the package.
Your code still cannot produce the given output
no??
in 1.18 packages changed
The nms packages did. Not the craftbukkit packages
Why can't i use a lambda parameters for methods like Material.getMaterial()?
nvm fixed it
Does anyone know a fix for this?
I can't delete a file for some reason
It's probably opened by another program
How would I spawn creepers in nether (like in overworld)
i mean, make it spawn "naturally"
You probably have to make your own spawning system which runs periodically
Oooooor, one hacky way to do it would be to replace some of the mobs that spawn in the nether with creepers
Listen to the spawn event, do some checks to see if its in the right spot, then have some sort of random (maybe configurable) chance to set the type to creeper
Could spawn both or search with in a radius around the spawn location for another spawn location
that means i'd need to check a safe location to spawn creeper
You'd have to do that anyways
is there any way to parse a papi placeholder inside another placeholder, The only way i can think of is in onRequest doing PlaceholderAPI#setPlaceholders on whatever is supposed to return
but i can see that going very badly
setBracketPlaceholders
How can I detect if a player is in a area and then the plugin do something without any repeating?
Well... you could use PlayerMoveEvent and check if they enter a region. (Either calculate xyz or use BoundingBox)
Or have a timer checking if the player is in the region/boundingbox.
Then add them to a list if they are in it and remove players that arn't.
Okay, I try it, thanks 😄
Which apparently would be better? This one is like a long grown question on my mind
I mean... it kinda depends. If you have like 50+ players I would go with the timer checking locations.
You could even switch between the two. When a player joins and its over 50 uninitialize the listener and start the timer (if not already running) and reverse.
50 might be a bit high so you'll need to adjust accordingly.
is there a way to open a writable book gui to a user?
From what I've read you can't open a writable book. only a written book.
I mean the player move event would lead to a cleaner end result however it will be more expensive, I would just do a simple xyz check with a min and max value, if you have multiple "regions" then maybe have a que type thing where a different thread runs the calculations instead of the main thread. that is overcomplicating it imo but if you have lots of regions and lots of players than that would prob lead to a better result
just throwing ideas out there
I do that by depending on worldguard and making a PlayerRegionCrossBorderEvent
I have strange issue when load my custom menu from cache first time it take much longer time. the cache is made on plugin startup (so is always same instance and data is already loaded) and the menu is new instance every time you run the command. any ideas?
[20:23:40 INFO]: broken_arrow1 issued server command: /menu testCache Main_Menu
[20:23:40 INFO]: [inventoryTest 1.0-SNAPSHOT] Command /menu testCache Main_Menu took 466.47 ms
[20:23:43 INFO]: broken_arrow1 issued server command: /menu testCache Main_Menu
[20:23:43 INFO]: [inventoryTest 1.0-SNAPSHOT] Command /menu testCache Main_Menu took 10.36 ms
Show code
Hold on here
command https://paste.helpch.at/uzolikexuv.cs
menu https://paste.helpch.at/bepuzikiji.java
logic to load data for the menu https://paste.helpch.at/suvixodege.cs
If you want more I have to post the source from github.
is only 1 item added to the inventory (no head or custom heads) and I know the menu is not a issue (it is the GetMenuButtonsData some add the load).
Hello to everyone who knows how to solve this problem https://paste.helpch.at/amumukesib.sql
The error tells you what you need to know
That class doesn't have a field of type EnumItemSlot, it is an int
Actually take that back, it's an int for the id of the Entity, and a List<Pair<EnumItemSlot, ItemStack>> for the equipment
For 1.18.2 at least
thanks
Hey, when I try to put a player into Spectator mode using
player.setGamemode(Gamemode.SPECTATOR)```
It doesn't seem to work unless the player is op. Anyone know if this is something built into spigot or if another plugin is interfering?
Are you running this on a server with just your plugin and nothing else?
No
It’s likely something else interfering, I just wanted to double check that it wasn’t an intended feature
It’s probably essentials or something
yeah that method definitely works fine regardless of anything "vanilla"
I'm trying to do a "grid" on a JavaFX canvas, but when I draw the individual tiles, lines appear between them when resizing the canvas for some reason.
The width / height of the tiles are all constant, and they are just drawn as rectangles.
My code is basically this:
for (int i = 0; i < 10; i++) {
(for int j = 0; j < 10; j++ {
Point point = Point.at(i * width, j * width);
drawRect(point.x, point.y, width, height);
}
}
If anyone has any ideas about how to fix it please ping me, thanks.
Sorry meant to say between them but left out a word
So basically it appears like a grid when it should be smooth
So I am looking into the "look" packet and for some reason the xRot is limited from -90 to 90 but the yRot goes way passed 360. Anyone know why?
ServerboundMovePlayerPacket playerLook = (ServerboundMovePlayerPacket) packet;
Location loc = p.getLocation();
ConsoleOutput.debug("[ServerboundMovePlayerPacket] | XRotation: "+playerLook.xRot+" YRotation: "+playerLook.yRot);
ConsoleOutput.debug("PlayerPitch: "+loc.getPitch()+" PlayerYaw: "+loc.getYaw());```
> [DEBUG] [ServerboundMovePlayerPacket] | XRotation: 15.716471 YRotation: -2819.1729
> [DEBUG] PlayerPitch: 15.868381 PlayerYaw: 60.82715
Cause, why not
how i can create a region?
2 points of XYZ or if you're using latest BoundingBox
Just a bitch to have to calculate offsets based on that.
Shitty design
you mean save x,y,z from 2 locations?
yeap
like java private Location point1, point2;?
yeap
and after that, what else xd
Calculate min and max and if something is within the min and max its in the region.
Could use a BoundingBox
Does the calculation for you
Did not see you already said it, but mk
Yeah I just assumed he wasn't using latest when he continued with the XYZ side lol
I want to learn how to do it for myself, maybe that way I'll learn more :p
the result is still the same @hoary scarab
Can you screen shot? Also add debug code and make sure the code is even running
And also send the updated code.
it works its just somehow called DataWatcher instead of EntityData
Spigot mapped name yeah
((CraftPlayer) p).getHandle().playerConnection.sendPacket(packet1);```
thats what I added
And did it work?
yup
👍
would you give me a challenge? something to do to learn more.
How advanced?
eehmmm
Not embedding...
sry
I got it.
okay okay
Well if you made reports, move to punishments.
Bans, warns, kicks, tempbans, mutes etc...
is that I already did it, and I would like to learn things like particles, mysql and more things like that
Well particles is pretty easy in the latest versions. Unless you want to do packets to send them to individual players, then it gets a bit more complicated.
If you're good with math though particle displays are pretty fun.
Same
and make a minigame? It is very difficult?
Depends on the minigame
which one is easy and would help me learn?
I'm not the best teacher. My explanation skills are mediocre at best.
but something is something xd
What minigame? I'll try to simplify what the code would be
What would be a good formula to calculate for an enchant to proc, x would be the level of the enchant
spleef?
Arena creation commands/game commands
Saving arena (Schematic or copied from another location) or you can make a list of broken blocks during the game.
Game states; queue, starting, running, stopping etc...
In game handle block breaking when shovel is right/left clicked (fire eggs if wanted)
Handle death
Handle spectating
End game
Reset arena (Depends how you saved the arena originally)
Teleport users out of arena
Handle rewards
Over simplification but this is what you would need to do.
to use schematics i need to use world edit api, right?
You could.... Or could make your own.
that would be very advanced I think xd
ill try the list of broken blocks xd
The broken blocks is very easy
Store the original BlockStates and then just call update() to reset
at the moment i have this xd
public class MainCommand implements CommandExecutor {
private KumaSpleef plugin;
public MainCommand(KumaSpleef plugin){
this.plugin = plugin;
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length == 0) {
sender.sendMessage(color("&cError! Type &o/" + label + " help&c to get help."));
return true;
}
switch (args[0].toLowerCase()){
case "creategame":
if (!(sender instanceof Player)) {
System.out.println("Only for players!");
return true;
}
Player player = (Player) sender;
if (args.length < 2){
player.sendMessage(color("&cYou need to specify a name!"));
return true;
}
String arenaName = args[1];
break;
}
return false;
}
}```
package com.realxode.kumaspleef.arena;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.util.List;
import java.util.UUID;
public class Arena {
private Location spawnLoc;
private List<UUID> playersIg;
private int maxPlayers, minPlayers;
public void join(Player player){
if (playersIg.contains(player.getUniqueId())) return;
if (isFull()) return;
playersIg.add(player.getUniqueId());
player.teleport(spawnLoc);
}
public void leave(Player player) {
if (!playersIg.contains(player.getUniqueId())) return;
playersIg.remove(player.getUniqueId());
}
public boolean isFull() {
return playersIg.size() == maxPlayers;
}
public Location getSpawnLoc() {
return spawnLoc;
}
public void setSpawnLoc(Location spawnLoc) {
this.spawnLoc = spawnLoc;
}
}
this works?
?paste
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
Any ideas?
The orange is what I mean by grid lines, orange is the background color of the cavnas.
is it the same code?
I don't see pointX and pointY defined in that loop
I edited it to make it more clear
ohhhhhhhh
how is width/height calculated?
maybe it's the way it was resized
those squares are 76x76 (if you include the orange) and 74x74 if you exclude it
so maybe if it was 75x75 it would look okay?
I'm just taking stabs in the dark fyi, I dunno
Oh I should clarify, the squares aren't resized, just the canvas
It was even worse when I scaled the squares with the canvas
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
I'm trying it keeps saying error adding document lol
paste service
HelpChat
click how to use if you need help
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
A member of staff has requested I move your pastebin.com paste to our paste.helpch.at!
good job barry
ohhh I see you're saying helpchat paste is having problems
Yeah
yes
at least I can use skyslycer's
xd yes
It might be from when I convert it to a coordinate system of spacing of 1 to using the width of the tiles
That wouldn't really make a difference would it though?
Also I had it at 50 before lol
Yeah in this picture you don't see any (The right is the background)
Orange ones?
not sure how to avoid it though
would setting the background to white help/work for you?
Not really because the squares are different colors
what does it look like when you do it?
if you expand does it just end up showing white grid lines, ye?
Yeah
Hey, is deluxemenus open source ?
no
Ow, and is there any way to make suggestions ?
Just kind of here, well, moreso #general-plugins
Resource pack
I figured out how to fix it, before I was doing GraphicsContext2d#fillRect, but apparently I needed to also do GraphicsContext2d#strokeRect.
I didn't realize gridlines were showing up even before resizing so that helped me figure it out, thank you.
Alright so first, do you know how to make custom GUIs?
or custom inventories with bukkit
then do you need to do custom font characters for the inventory
thats pretty much on your own
is it possible to change the main world? trying to reset it and the easiest way to do it that i can think of is:
- create temporary world (world-temp)
- switch the main world from world-1 to world-temp
- unload/delete world-1
- create new world-1
- change main world to the new world-1
- unload/delete world-temp
ping me if reply
no
I mean, you ""can"" (just like you ""can"" do literally anything else ever), not in any supported way by any means, but you're going to break way more many things than solve
try returning the same prompt maybe. return this;.
or make a new prompt and return that one.
you create a new string prompt and return that when the input is invalid.
the getPromptText would return the message saying "the time you have inputted is wrong" and the acceptInput would basically do the same thing as your current prompt.
What if I edited the server properties file and then restarted the server?
if you're just resetting the world, then you can just delete the world folder (while the server is stopped)
I thought you were trying to do it without restarting
At least that's what I think you meant by
trying to reset it
How would I delete it when the server is offline :/
manually
I wanna do it with code
as emily mentioned, there's no supported way of doing it with code. well I'm fairly certain even manually resetting it can lead to some stuff breaking.
I think it just gives some warnings about player data iirc
But it usually just creates a new world on start
I think this plugin does it somehow but all I found is practically the same thing I do: https://github.com/Shiirroo/ManHunt/tree/main
Yeah that definitely will not unload the overworld, the server won't allow it
Use WE or CP to reset the terrain
have you tested the placeholder with /papi parse first to make sure they work at all?
confusion 🤔
the compiler doesn't know that taskID exists
consider ```java
int x = new Object() {
int get() {
return x;
}
}.get();
what's the value of x?
same thing
it doesnt make sense and the compiler isn't smart enough to know that the lambda will run later / async
oooh thx
using the exit handler or whatever its called
shutdown hook?
yes
🥲
iirc that's also how File#deleteOnExit works
but i dont know if deleteOnExit is a recursive delete
d;file#deleteonexit
public void deleteOnExit()
throws SecurityException```
Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates. Files (or directories) are deleted in the reverse order that they are registered. Invoking this method to delete a file or directory that is already registered for deletion has no effect. Deletion will be attempted only for normal termination of the virtual machine, as defined by the Java Language Specification.
Once deletion has been requested, it is not possible to cancel the request. This method should therefore be used with care.
Note: this method should not be used for file-locking, as the resulting protocol cannot be made to work reliably. The FileLock facility should be used instead.
1.2
SecurityException - If a security manager exists and its SecurityManager.checkDelete(java.lang.String) method denies delete access to the file
oh
so it does work ig
Hm
although
it doesn't work for this guy
Or you can load your plugin before the world loads
and either delete the world in the constructor or onLoad
or onEnable
ah right
imma try deleteonexit first
it seems like it only works for empty folders
idk if apache commons IO is included in spigot, but if so: ```java
Runtime.getRuntime().addShutdownHook(new Thread(() -> FileUtils.deleteQuietly(new File(Bukkit.getWorldContainer(), "world"))));
and if not: ```java
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
deleteDir(new File(Bukkit.getWorldContainer(), "world"));
}));
public void deleteDir(File dir) {
File[] files = dir.listFiles();
if(files != null) {
for (final File file : files) {
deleteDir(file);
}
}
dir.delete();
}
Maybe send then a packet as they are on gamemode 3, but without the ability to pass trough blocks and such
ok so i created ItemStack of diamond sword and i made it unbreakable
now i want to check on PlayerItemHeldEvent event if the item from player's hand isSimilar with the one created as itemstack BUT i want to ignore checking of unbreakable flag (i used setUnbreakable)
is this possible?
so you just want to check if the player is holding a diamond sword?
Mby Just check the type?
ok so basically i just want to check if player's sword DOES NOT (!) have unbreakable flag
i already have code that checks if he has diamond sword with specific name
Check item meta
what does WordUtils.capitalize?
Capitalizes all the whitespace separated words in a String.
How much time it takes to remove the getLastDamage() from an entity after it receives damage?
public interface Entity
extends Nameable, CommandSender, PersistentDataHolder, Metadatable```
Entity has 66 methods, 4 extensions, 6 super interfaces, and 154 sub interfaces.
Represents a base entity in the world
Yeah looks like if an event was fired (and even cancelled) it would show there.
If it does the Javadoc should specify that, but no I don't think so.
I suppose it takes as much time as it takes the entity to be damaged again..?
I'm trying to set the enabled faces of a mushroom in 1.18, It doesn't work for some reasons.
My code : https://paste.helpch.at/qiqiyugeyu.cpp
Here is the code where my function is executed:https://paste.helpch.at/muropekuba.cs
(Both are executed and after debugging it doesn't seems to set the blockdata to the block)
can I use the same attribute uuid for two similar items or should I generate a new one every time?
Any maven pros that knows how to fix this java.lang.NoSuchMethodError: 'void org.apache.commons.io.FileUtils.copyToFile(java.io.InputStream, java.io.File)'? Here is my pom https://paste.md-5.net/sasavodane.xml
How are you building the plugin?
Why would you use that method
I'm using Eclipse, so Run -> A maven config with package as the goal
To copy config-defaults to a file?
Idk any better way so...
And this has worked fine for me before
I'm making a plugin for someone and they want it in 1.8
And now it does not work
:/
Files.copy
The method copy(InputStream, OutputStream) from the type Files is not visible?
How do I fix the java.nio.file.AccessDeniedException when using Files.copy?
"it depends"
you're basically saying "Hey guys this isn't printing anything System.out.println("Hi"), what do i do"
Share the whole stack trace, share contextual code
🔮
you are shading papi
if you open your jar, you will see papi classes there. Use <scope>provided</scope> for maven or compileOnly for gradle
Thanks 😄
Hey, My plugin is responding with a null error every time I'm executing the report command.
Can someone please help me fix it?
https://paste.helpch.at/luteyuqudu.java
did you register it in your plugin.yml?
yep
that's the viewreports one erroring
?
the s
different reason now
Look at the error
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.set(String, Object)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null
and the stacktrace
at me.fozystyle.easyreports.commands.Report.onCommand(Report.java:51) ~[EasyReports-1.0.jar:?]
so go to Report class line 51
does Reports exist in your config?
yep
send it over
and does it exist in the config on the server? not just the one you package with the .jar
yep
there's no value
it's null
don't get it
just set it
plugin.getConfig().set("Reports."+finalTitle, finalReport);
try that
oh
use . to go layers deep into yml
Thanks
still erroring
nevermind
I know why
ok nevermind again
idk what is the problem
please @grim oasis
Are you sure you've used the correct .jar?
and restarted/reloaded?
the error still says it's doing getConfigurationSection
and it's not
nevermind I'm using minehut so reloading doesn't change anything
Just restarting
can I ask one more question
What does the last boolean "deep" means ?
plugin.getConfig().getConfigurationSection("Reports").getKeys(true)
I'm not sure
so how can I get their value?
fine
I'm not very familiar with coding java plugins
So I don't know everything yet
I'm very new to this topic
can I get example?
plugin.getConfig().getConfigurationSection("Reports").getValues(true)
thanks
np
Is it possible for an subclass that extends a abstract class to not implement one of the methods?
For example i have a abstract class CustomEnchant and i have 4 events that can happen for enchants, onBlockBreak(), onHoldPickaxe(), onReleasePickaxe() and onDropPickaxe(). And i only want to import the onBlockBreak() for this enchant
and give them no body?
yeah
or whatever u want the default behaviour to be
longer answer, make 4 separate subclasses, each with 1 abstract method then you have to implement 1 and only 1
Or you could make the classes generic and accept a Event in the method
Hello, anyone know if the Guilds API is publicly available?
yeah guilds is open source
thank you 🙂
if (!file.exists()) {
file.mkdir();
you're creating the path as a directory, you want too call mkdirs on the parent "file"
getParent or smth
Hello, I found https://wiki.helpch.at/glares-plugins/guilds-w.i.p-migration/developer-api while looking for a way to integrate guilds plugin into my plugin so I can get guild members from it
and my question is, would the info on the link work for that purpose?
@grim oasis umm so yeah it doesnt really work as it should i guess
do you have the statistic expansion?
ok
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
that would be a bit of problem
cuz it is main class
scoreboard is in on join event
i can send you on join event
so you have whole scoreboard class ?
A member of staff has requested I move your message to a paste,
Most likely because it contains a config/error/code snippet.
and it just isn't setting them?
and /papi parse me %killstats_kills% works
yup
oh
are you sure?
I just realized you said it sends %placeholder%
did you test with the actual placeholder?
because you wrote
and it returns the number?
%placeholder%
that's an example of how to use it, yes
no
no it doesnt
it return %placeholder%
and /papi parse me %killstats_kills%
returns %killstats_kills%
okay it's not working then
not sure why hahah
ok so i have String[] args, how can i get all of the args after args[0] (preferably into a String[])?
Arrays,copyOfRange
Cannot resolve method 'copyOfRange(String, int, int)'
d;jdk Arrays#copyOfRange
public static T[] copyOfRange(T[] original, int from, int to)
throws IllegalArgumentException, NullPointerException, ArrayIndexOutOfBoundsException```
Copies the specified range of the specified array into a new array. The initial index of the range (from) must lie between zero and original.length, inclusive. The value at original[from] is placed into the initial element of the copy (unless from == original.length or from == to). Values from subsequent elements in the original array are placed into subsequent elements in the copy. The final index of the range (to), which must be greater than or equal to from, may be greater than original.length, in which case null is placed in all elements of the copy whose index is greater than or equal to original.length - from. The length of the returned array will be to - from.
The resulting array is of exactly the same class as the original array.
1.6
original - the array from which a range is to be copied
from - the initial index of the range to be copied, inclusive
to - the final index of the range to be copied, exclusive. (This index may lie outside the array.)
IllegalArgumentException - if from > to
NullPointerException - if original is null
ArrayIndexOutOfBoundsException - if from < 0 or from > original.length
a new array containing the specified range from the original array, truncated or padded with nulls to obtain the required length
if you look at the method params, it accepts an array
nvm its just me 
i dont have any dependencies so gradle is not building a jar, what do i do?
Can you give us more information?
i dont need any dependencies for my project, so i dont have any set, and apparently the java gradle plugin requires one to build a jar, so how can i make it so that i dont need to define a dependency for the jar to still be built?
description = "Exhibit-Scorer"
version = "0.0.1"
group = "xyz.srnyx"
plugins {
java
}
tasks {
compileJava {
options.encoding = "UTF-8"
}
}```
What if you make a dependency block but don’t put anything in it
that should have some errors btw
since the plugins block has to be at the top
^
oh, ive never gotten any
huh
and i have it like that in all my projects
yea
and also are you doing gradle build
yeah
oh prob only groovy
since i dont get any errors either
thats quite interesting though
yea and github runs it fine: https://github.com/Venox-Network/bromine/actions/runs/2444358351 (this is different project)
imagine using groovy 😌
fr
still doesnt work
no hes using kts
^
none it says build successful
and refreshed
build/libs?
why did intellij move the terminal to a completely different folder...
ok i moved it to where it should be and it worked 😔
good to know
🥲
wow this is all i need:
description = "Exhibit-Scorer"
version = "0.0.1"
group = "xyz.srnyx"```
iirc none are required
and idk what description is used for
i think the name of the file
no thats from settings.gradle.kts
i think
unless description overrides it
oh
🥴 then i guess those are required
did u try intellij double click ctrl
and in build/libs
¯_(ツ)_/¯
ok java plugin is required
but u already have it
.
Oh
🥲
imagine not having a 211 line build.gradle
(older project back when I used groovy 🤢)
im not doing version control so i dont even a version in the name lol
yucky
Mhm
dw ill change to
plugins {
java
}```
plugins { java }
```🙃
imagine not using 25 dependencies
ok ill do that
no main manifest attribute, in Exhibit-Scorer.jar 
u need application plugin
noooo 😭
🥲
application
application {
mainClass.set("a")
}
thats groovy :(
😭
try application.mainClass
idk if its only groovy
but
¯_(ツ)_/¯
ay that worked
plugins {
java
application
}
application.mainClass.set("xyz.srnyx.exhibit_scorer.Main")```
plugins{java;application}application.mainClass.set("xyz.srnyx.exhibit_scorer.Main")
```ez
ok it didnt work
same error?
yeah
tried this format too
try adding shadow plugin then and then gradle shadowJar 🤷 since I always use shadow
so
still worth a shot tho
but my code didnt :(
lol 💀
Score: 1
PASSED words: [whats, up, swag]
FAILED words: [whats, up, swag]```
it got the score right but not the passed/failed words
oh im so silly
whats the API version for guilds
^^
I mean it's in the name
universally unique identifier
unless it's exactly the same thing, I would have a different one
right click
How can i add support for emoji's in my scoreboard?
Whats the fasted way to find a memory leak inside of your plugin
profiler i guess
this is a memory leak right, from the moment i reload my plugin, it goes down and then it keeps going up and never stops
does look a little sus
heap dump and looking at that then
is this not typical behavior? this is how it's looked on all of the servers i've ran, including ones without plugins installed
I'm trying to add a potion effect while the player is crouching but i can't figure out what to use instead of a while loop.
public void onSneak(PlayerToggleSneakEvent event) {
while(event.getPlayer().isSneaking()) {
event.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 1, 1));
}
}
i figured it out
cool
I guess it would be typical if you didn't have to reload, that growing constantly until you reload the whole thing (basically flushing everything and re-creating the plugin) isn't precisely a good sign
OH i see
So im trying to make it so that a sword can be activated and deactivated, i currently have a countdown setup and everything works for the most part. my issue comes into line when two people activate at the same time. when players do this it breaks one players countdown and stops the other players countdown. https://paste.helpch.at/uxesubenoq.cs <--- here's the code that i have written for it.
Any help would be gladly accepted as i've been struggling to figure out whats wrong for some time now
it looks like you never use timeleft as far as I can see
you should be putting it back into cooldowns instead of storing it to timeleft ||also please make it timeLeft if you keep it||
i removed it, totally forgot about that, Thank you. does anything else look out of place?
Can you send the class?
Sure
it never looks like you remove the cooldown from what I see (not saying it breaks)
because it'll just return
It's a bit messy and i fully apologize for that, https://paste.helpch.at/wuromijuna.cs



