#development
1 messages · Page 104 of 1
wait you can extend multiple things?
in interfaces?
that's sick
I tried with BlockState alreadyt
BlockState state = block.getState();
if (!(state instanceof ShulkerBox)) return;
ShulkerBox box = (ShulkerBox) state;
even added box.update();
getting the block state, modifying it and updating it after will work
here's all my code
100%
Block block = chunk.getBlock(t.getFirst(), t.getSecond(), t.getThird());
block.setType(Material.GREEN_SHULKER_BOX);
BlockState state = block.getState();
if (!(state instanceof ShulkerBox)) return;
ShulkerBox box = (ShulkerBox) state;
NamespacedKey key = new NamespacedKey(instance, "spectral");
box.getInventory().addItem(new ItemStack(Material.BOW) {{
ItemMeta meta = getItemMeta();
meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "true");
meta.displayName(MessageUtils.miniMessage("<gold>Spectral Bow"));
setItemMeta(meta);
}}, new ItemStack(Material.SPECTRAL_ARROW) {{
ItemMeta meta = getItemMeta();
meta.getPersistentDataContainer().set(key, PersistentDataType.STRING, "true");
meta.displayName(MessageUtils.miniMessage("<gold>Spectral Arrow"));
setItemMeta(meta);
}});
box.update();
and it is set to a green shulker successfully
I try to open the launcher and it opens the ms store ._.
it doesn't even take me to the mc launcher page on the store
fun
Does someone know how I can use the mojang-mappings for 1.17.1 on gradle ?
Is there any way to change plugin commands ? ... like i want to change the cmi plugins commands example .. : default commands /cmi warp /cmi tpa i want to change it to /warp /tpa just want to remove the /[cmi]
aliases.yml
or something like that
so player no need to type the extra cmi thing
in plugins/CMI
okay
any idea how I can stop these entities from turning black? https://imgur.com/OFVh4Q0 they are some armor stands with a block on their head
do you remove the item from the armor stand first? 
Today at 11:19 AM
ah maybe you fixed it already
what version is that
Despawn the armor stand quicker than the dia block get's spawned
yeah. but he's not despawning it at all.
Or remove the head, and once the block passes set it back
that's probably what he needs to do tho
👌
1.17
Removing and setting the head back will mostlikely fix it
Set them on fire
This is not a joke, it's a legit answer that actually works
but can you set them on fire without showing the fire animations? or will it not show because they're invisible?
Yeah using fire tick
That's what i do to make armor stand not go dark inside blocks
What in the fuckery
lmao
yeah
How does that make sense
I actually am not sure but what I think happens is that it sees the entity is in a dark area and just sets its light level to 0 or something. I never looked into this stuff
do I have to run the method constantly or is it enough to do it once?
Are you sure?
I am very positive I've done it and it worked
The fire? It takes a tick for duration iirc, so you can just set it something big enough
@rigid basin I can't seem to get on your Discord, I only need help in updating some code on hooking into your Quest plugin
so if my task requires me to have a natural number should I use an unsigned int or an int? My problem is that most of the stuff I work with doesnt support int so should I Just make a check for the int to be >= 0?
ye happened to me
does anyone know a tutorial or documentation about how to create my own api and connect it with my plugin via maven?
public static void test(ClanManager manager, Clan.Builder clanBuilder, ClanMember.Builder memberBuilder) {
Clan clan = clanBuilder.tag("test").displayName(Component.text("Test")).build();
ClanMember member = memberBuilder.uuid(UUID.randomUUID()).build();
manager.addClan(clan);
manager.editClan(clan, clanEditor -> {
clanEditor.setDisplayName(Component.text("Test 2"))
.addMember(member)
.editMember(member, memberEditor -> memberEditor.setRole(member.getRole()));
});
}
Hey! What do you think about this design? All Objects are immutable, and to modify them, i use Editors, to avoid unecessary object creation. When editor session is done, updates got applied on database asynchronously in a transaction.
never mind, I already finished it and it is working.
Is there a good way to make a respawn system? For example i am trying to make a system where when someone dies and then after 15 seconds they respawn and i dont know how to get that to work.
1.17.1 btw
you can use an event for when you die and then in that event you do a teleport to a location and then just generate random locations or grab a location from your .yml file you make
Just check in the entitydamageevent if the damage dealt is bigger then the persons health. If it is, put the player to spectator and tp them to a location wherever you want. Then just start a bukkit task and teleport them back after 15 seconds
oh i see ok thanks
wait is there a way to do it within a datapack cuz that would be preferable
but if not then dw
I am trying to make a GUI but for some reason when you click an Item you can take it instead of it opening the submenu... https://cdn.skymc.cc/images/h1g3m.gif
/*
* Made by SoNot
*/
package tech.sonot.blockshop;
import tech.sonot.blockshop.shops.ClayShop;
import tech.sonot.blockshop.shops.GlassShop;
import tech.sonot.blockshop.shops.WoodShop;
import tech.sonot.blockshop.shops.WoolShop;
import tech.sonot.blockshop.util.CC;
import tech.sonot.blockshop.util.ItemBuilder;
import tech.sonot.blockshop.util.menu.Button;
import tech.sonot.blockshop.util.menu.Menu;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.ItemStack;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class BlockShopMenu extends Menu {
@Override
public String getTitle(Player player) {
return "&b&lBlock Shop";
}
public int getSize() {
return 27;
}
@Override
public boolean isPlaceholder() {
return true;
}
@Override
public Map<Integer, Button> getButtons(Player player) {
ItemStack woolshop = new ItemBuilder(Material.WOOL)
.name(CC.translate("&b&lWool Shop"))
.lore(CC.translate(Arrays.asList("&7Click to open the &7&lWoolShop&7!"))).build();
HashMap<Integer, Button> buttons = new HashMap<>();
buttons.put(10, new Button() {
@Override
public ItemStack getButtonItem(Player player) {
return woolshop;
}
public void clicked(Player player, int slot, ClickType clickType, int hotbarSlot) {
player.closeInventory();
new WoolShop().openMenu(player);
}
});
buttons.put(12, new Button() {
@Override
public ItemStack getButtonItem(Player player) {
return glassshop;
}
public void clicked(Player player, int slot, ClickType clickType, int hotbarSlot) {
player.closeInventory();
new GlassShop().openMenu(player);
}
});
}
Uhm next time post it inside this https://paste.helpch.at/
Sorry..
Are you acctualy canceling the event?
Or even did you register the event in your main class
Yeah, happens to the most of us
my InventoryClickEvent isnt being called when I click on orange dye. I am using 1.8.8, and this worked on 1.17.1, but when I switched it doesnt.
the event works for every other item
I think it has something to do with the fact that there isnt a actual item for dyes, you set the dye color with a int and ItemMeta#setDurability(int i)
have you tried just logging smth to console as the first thing that happens in the listener
how do I get what level an advancement is?
yeah, nothing is outputed when I click the dye, but stuff is when I click any other item
anyone here uses maven?
just ask your question
I wanted to add Purpur as a dependency but it gave me errors and I did it exactly as said in their Github
https://github.com/pl3xgaming/Purpur#dependency-information
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
let me reproduce them one sec
Dependency 'net.pl3x.purpur:purpur-api:1.17.1-R0.1-SNAPSHOT' not found
my pom.xml for the dependency looks like this:
<repositories>
<repository>
<id>purpur</id>
<url>https://repo.pl3x.net/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.pl3x.purpur</groupId>
<artifactId>purpur-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
I sent them as a code block because I don't think its long enough to make a paste for it
wdym
bossbar?
armor stands maybe
you can disable armor stand hitbox
cant you debug it
on some event
entityhit or smth like that
interact
idk
How can I send titles in 1.16? When I send the title packet por I use p.sendTitle It doesn't work
For mysql what's better
teamid, teamname, leader, color, homeX ,homeY, homeZ, homeWorld```
or
```teams table:
teamid, teamname, leader, color
homes table:
teamid, homeX, homeY, homeZ, homeWorld```
So basically is it better to keep all the data in that one table and row or is it better to spread it out
I'd say second, but don't forget to add a homesid as well
how come homesid @pulsar ferry?
A table should always have its own id
You could use the foreign key as the primary key but i'd say that's not scalable
If later on you want to allow multiple homes for example
I still recommend having a different id for primary key
alrighty
@pulsar ferry So in the case of the teams
the team uuid would be primary key right?
or is that also not good
Yeah that'd be fine
@pulsar ferry but in this case how do i update the home location
Since the primary key is an auto-increment int, there would be no duplicate I can update
You can still update it by the foreign key aka teamid
Would be the same way, for example UPDATE teams SET homeX = 5 WHERE teamid = "uuid", the homesid would just be a background thing
Ah okay so you meant homesid is a string/uuid and not auto increment?
No no, it is auto increment, you just don't need it to update
Something isn't clicking for me

This is my usual statement
INSERT INTO homes (teamid, x, y, z, world) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE x=VALUES(x), y=VALUES(y), z=VALUES(z), world=VALUES(world)```
So this is what I would do if I made teamid the primary key for homes
How would I do it differently if I did it the way you said @pulsar ferry
REPLACE INTO, if the teamid is marked as unique index REPLACE INTO homes (teamid, x, y, z, world) VALUES (?, ?, ?, ?, ?)
Right but I'm doing insert into because I'm not sure if it's there or not
Replace into will insert if there is no value or replace if there is
I still don't see the benefit of having the auto increment primary key
Mostly for future proof, like if you want to allow multiple homes, but i guess if you feel like that won't ever happen then sure i guess it'd be fine to have the teamid be the primary key
right but what I meant is how does it allow for multiple homes?
right but if its auto increment then it doesnt really help
and home ids are incremented values
the home id would have to be a varchar
For example if you make both homeid and teamid primary keys, you can have 1, uuid, x, y, z and 2, uuid, z, y, z
Sure it allows me to save multiple locations but I still need to know which home is which, and at that point I'd rather have a string for my homeid
Those would be 2 homes for the same team
Yeah, in this case it would be both primary keys, so you can have multiple of both but never the same
Which should still work well with replace into
Right but then if I do it this way
then how do I limit homes?
Like lets say they have one home, they cant give it a name or anything
table is
homeid (auto increment), teamid (uuid), x, y, z
You'd limit it by checking for the count(teamid)
Well this would be my suggestion, if you feel like i am over complicating it for you, feel free to just use teamid as the primary key alone ;p
Is REPLACE INTO really does that? update if exist and insert if it's not exist.
All this time I need to query SELECT and check the result set.
Yeah
REPLACE works exactly like INSERT, except that if an old row in the table has the same value as a new row for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the new row is inserted.
Okay, no more
ResultSet resultSet = statement.executeQuery();
if(resultSet.next()){
update();
} else {
insert();
}
It is Default sql syntax or specific feature of some implementation like mariadb or postgre?
if you search on google sql replace into the results are from mysql, so i assume it is specific to mysql
^
Yeah
pretty cool
Can the 1.17 and 1.17.1 javadocs be added to HelpChat's website please?
@wheat carbon ^^
@wheat carbon ^^
will do soon
Ty
ty ty
ty ty ty
is been 30m already @wheat carbon
heyo, i got a problem: i have spigot imported into my intellij project but when i try to import "JavaPlugin" it says that it "Cannot resolve symbol 'JavaPlugin'", so i cant import the library
anyone knows whats the problem there?
maven or gradle?
nope, plain java
maven and gradle arent flavours of java.
they give you the ability to compile your java plugin without requireing a server jar inside your plugin.
just look at the guide on spigot about using maven or gradle, whichever you prefer cause without them your going to have a fun time and a base file size of 45mb or more.
or grab yourself the minecraft plugin developement plugin from the intellij plugin hub
why does it takes a lot of time to set blocks to air using EditSession#setBlocks
even the fastmode is enabled
"a lot of time"?
i mean given the amount of detail you've given I can only conclude that it doesn't
like after ~20-30 secs
EditSession editSession = FaweAPI.getEditSessionBuilder(FaweAPI.getWorld(min.getWorld())).limitUnlimited().fastmode(true).build();
Region region = new CuboidRegion(new Vector(min.getX(), 1, min.getZ()), new Vector(max.getX(), 256, max.getZ()));
editSession.setBlocks(region, new BaseBlock(0));
``` 1.8 
🤢 
forgot the flushQueue lol, fixed
yes 1.8 bad
🌚
I am using 1.8.8, and my InventoryClickEvent is only triggering on the first menu. I have 2 menus, one has a item that when you click on it leads you to another, but the item on the next doesnt trigger the onInventoryClick event
How do I put in DeluxeMenus the requirement that I need to be in a specific LuckPerm Parent to left / right click?
i think u can set a permission requirement to group.admin for example
How can I add full support for PAPI in my plugin? Like so that it supports any plugins placeholder, or is that not possible?
simply PlaceholderAPI.setPlaceholders(Player, String)
Yeah I mean your plugin supports PAPI placeholders, but the admins/managers ought to download/install the expansions
oh alright 😄
For does it return the string or no?
yeah nvm, I saw that it does
to remove hitboxes of an armorstand set it to be a "marker"
it has no hitbox in that case
and is also correctly centered iirc
_ _
is PDC data sent to the client in the form of an NBT tag?
I'd like to have custom textures based on data
and I'm wondering if PDC is okay for that
the PDC lives in the NBT yes
cool, ty
Whats the proper way of using nms for 1.18?
I'm having a wierd issue, and I'm not sure the right way to solve it.
basically, to launch a firework rocket in a crossbow you need to have the rocket in your offhand.
but I (for cosmetic reasons), have a different slot that I keep the arrows that have yet to be shot in (code-wise, since arrows don't exist in my gamemode).
is it possible to let it shoot them without being in the off-hand
I used scoreboards to mimic it before. Set the player name to your wanted text and the scoreboard below name to the players name.
custommodeldata?
I'm gonna use model data, I was just looking for a way to get it straight from NBT tags that were already there
wdym?
a way to not add a second layer of data, but just use the data already there
does anyone have the website for the deobfuscated NMS for 1.17 please
That is very much illegal
it shows what is what class not the actualy code
Oh you mean the mappings, not the jar?
the mappings yes
Use https://paste.helpch.at/ for errors, logs and configs. So we don't spam the discord.
Umm guys im new to bukkit coding B:)
i was making a plugin for easy gamemodes
like gmc gms gma gmsp
but after i was done this error came out
please help me
first things first
lowercase your packages
change Main.java to SimpleGamemode.java
this doesn't improve code but improves my mental sanity
then uh did you register the Gamemode.java command
yeaa
new Creative(this);
new Survival(this);
new Spectator(this);
new Adventure(this);
new Gamemode(this);
i assume your Gamemode.java class is a command
yes its a command
it will print all commands which is available
./gm
Are you registering the command using PluginCommand#setExecutor(CommandExecutor) and registering your command in plugin.yml
i did register the commands in plugin.yml
show your Gamemode.java class
huh, double check that plugin.yml
wait i will send u plugin.yml
name: EasyGamemode
version: 1.0
author: Apex i7
main: me.Apexi7.EasyGamemodes.Main
commands:
gmc:
aliases: [gm c]
gms:
aliases: [gm s]
gmsp:
aliases: [gm sp]
gma:
aliases: [gm a]
yeah
I always take the route of
PluginCommand command = this.getCommand("cmdName");
if (command != null) {
command.setExecutor(this);
}
o
what does if (command != null) { mean?
that would check if the command exists in your plugin.yml first
ooo
to prevent an error
so if its not in your plugin.yml, it just wont try to make the command and throw an error
oo
imma try remaking it with ur route
@tight junco omg bro it started working
[12:10:23 INFO]: [EasyGamemode] Enabling EasyGamemode v1.0
[12:10:23 INFO]: ºf------------------------
[12:10:23 INFO]: ºaPlugin has been enabled
[12:10:23 INFO]: ºbAuthor - Apex i7
[12:10:23 INFO]: ºf------------------------
[12:10:23 INFO]: Server permissions file permissions.yml is empty, ignoring it
[12:10:23 INFO]: Done (5.462s)! For help, type "help" or "?"
again tysm

xD
package names should be lowercase
oh
but without lowercase it works fine
does PlaceholderAPI.setPlaceholders() also translate & colour formatting, without needing to use ChatColor.translateAlternateColorCodes?
Rn it spawn in an area of like 8 blocks long instead of 1.5
hey how can I give a player a glowing effect of a specific color when they join the server
that uh
requires scoreboard teams iirc?
assign the player to a scoreboard team that has a specific colour
and give them the glowing effect
Yeah, it's scoreboard teams
ah okey thanks
what has changed for 1.18 that i should know about?
ok thanks was just wondering as i got a message saying to add 1.18 support for my plugin :/ but it should load if nothing has changed
id just test out the 1.18 support
ya never know
you're only somewhat fucked if you're using NMS
Why cant i get the Main from a other class?
This is the code in the other class:
CorePacket.get();
}```
And this is what i use in the main:
```private static CorePacket instance;
public static CorePacket get() {
return instance;
}```
It works in all other classes
You aren't assigning it to anything?
private CorePacket corePacket = CorePacket.get();?
yeah you prob aren't assigning the corepacket instance
i couldnt use tab so i assumed something was wrong but ty
Why can't i use ReportMain.load2(); ?
public static void load2() {
CorePacket.get().getServer().getPluginManager().registerEvents(new AsyncChatEvent(), CorePacket.get());
}
}```
restart ij
no
nvm
if you want that code to run you need to put it in a method/function or an initializer
isnt this a method?
you're calling a method
from a method right?
How would i register all the listeners in the folder listeners automaticly?
or isnt that a possiblity
it's possible but quite messy
is it easy?
this i think https://youtu.be/dWDOXeOx8z0
oh ty!
How can I give a player a specific spawner like a zombie spawner or a spider spawner
Why do you bold it?
I assume due to you being here you want it from a coding perspective correct?
yes
First comment by outdatedVersion
Don’t believe it’s changed since 1.11 to my knowledge
So i am trying to make something happend at a specific time but it just executes every 10 seconds instead of the specified time:
Date date = null;
try {
date = dateFormatter .parse("16:53:00");
} catch (ParseException e) {
e.printStackTrace();
}
Timer timer = new Timer();
int period = 10000;
timer.schedule(new AutoRestartTask(), date, period );```
Anyone know how i would fix it?
int period?
For timer.schedule the number you defined as “period” is that 10 seconds you are talking about if you check where you assign it 10000/1000 = 10 seconds as that is in milliseconds.
So just change period to whatever you want the specific time to be
Hi, i'm trying to update a plugin using NMS to support 1.18 the issue I'm having is that 1.17 and 1.18 use the same package names for NMS and the plugin uses abstraction with an interface class. Is there any way I can compile the plugin so it uses the 1.17 api in NMS_1_17_R1.java and 1.18 in NMS_1_17_R1.java possibly looking at using reflection.
I understand that this is possible with maven modules but I don't know that much about maven.
Reflections? 
Whyyyy

becauze
ItemBuilder.from(Material.AMETHYST_SHARD)
.name(Component.text(Util.color("test")))
.lore(listOf(
Component.text(Util.color("&71")),
Component.text(Util.color("&ftest")),
Component.text(Util.color("&7test1")),
Component.text(Util.color("&7223"))
))
.glow()
.build()
what does the color method return? u sure it returns the string back?
because if its kotlin.Unit I assume its not returning anything
ughh, lemme check
uhmm, i don't know what did i do, but it fixed it
The color method didn't return the translated string
as expected
shouldn't it give an error saying that String was expected 🤔
unless Component.text accepts a Void parameter 🙃
ugh. dkim. look at the image. kotlin was doing Unit#toString
kotlin doesn't return void
it returns Unit
yes ik
but in kotlin things get "converted"
ex int to Int, i assume void = Void in kotlin's mind 🤔
and iirc string params dont automatically call #toString, idk
ye
Thanks this might really help!
Does anyone know a good documentation/tutorial for sqlite?
@warm steppe can you humour me and show what your color method looked like before please?
also. is this method inside a companion object?
now it's
fun color(color: String): String {
return ChatColor.translateAlternateColorCodes('&', color)
}
yes
why?
yeah. no idea what is going on there. lol xD
you using adventure right? for components
epic kotlin fail
yeah. no idea what is going on there. lol. it errors for me. unless its just a "soft" warning and it actually would compile
which I did not test
to be honest
idk "No problems found" for me
Hey so, I have a module based Discord Bot. I create URLClassLoaders for each module that is loaded. it works great no issues. But once I close that ClassLoader and recreate it, which kinda works fine. I get ClassNotFoundExceptions
the Main file works fine aswell as other classes, just some cause issues
anyone having an idea how to fix that
lol
For what classes do cnfe yield?
Hey, its possible to change a no premium player's game profile to give him a skin? Because I'm making a skin system and I've only achieved changing premium players skins. Thanks!
You can do it based on nickname only but it’s not recommended at all and can cause you future issues, that’s why you should support only premium (:
What JDK do you need for the source code for papi?
16
can someone help me because I use an blockbreak event. And i want to make it so when I mine a spawner it drops the specific spawner I mined with the right egg in it.
Is anyone here familiar with CMI's API?
hmu in dms, i will assist you with that
papi is in java 8
thanks
thanks
thanks
Does anybody know how I can display a different item (helmet to be more precise) than what they currently have, to a player?
I want to replace their helmet with a jack o lanter with a custom model, but withour affecting their actual helmet. With equipement packed I was able to display it to other players only.
Anyone know how to get corebot to run commands for their shop. I am using the crafting store gift card add on for corebot.
What is core bot
Ask the dev of the addon. Good luck. If it's the one im thinking of you'll get either a nasty answer or none at all
Not sure if anybody knows
but is there a way to get a specific sound from a single sound
i.e i'm trying to get the laugh from ENTITY.PILLAGER.CELEBRATE
but sometimes there is a horn sound. I don't want the horn sound
1.18 is killing me recently
L
suck a dick frosty
hey hey that's not nice
literally idk if im being stupid
but dependencies lowkey just stop working for no reason
building with java 17?
yeah
but even then
I have some projects that are building with java 16
and it works
CONCLUSION
gradle cached some scuffed shit
i have been banging my head against a table
intellij was getting invalid files 
conclusion: if in doubt invalidate cache?
Delete .gradle
Uninstall IJ
no im not redoing it
Did you update to the latest 2021.3?
Do you have the mcdev plugin installed?
yes 
Delete it for the time being
There was a change between the RC and release for 2021.3 that's breaking some projects
Mcdev is working on an update to fix it
./gradlew build --refresh-dependencies 
Change between RC and release for IntelliJ**
That broke mcdev
Like some projects not loading properly
i'll try 
Hi, so im trying to check if the name of player's held item contains something in the string. But this doesn't work
String names = "Funko, Computer, Monitor, Store, Laptop, Vlag, Verkoopbord, Trophy, Troffee";
String meta = p.getItemInHand().getItemMeta().getDisplayName().toLowerCase();
if (names.toLowerCase().contains(meta)) {
//magic code
}
Your string names is not an array or a list so you are just storing one string inside it instead of 9 different strings
When you make it an array or list etc you can use contains
^
Anyone here experienced with Sponge Configurate? I am really struggling rn
how can I do
delay = 0;
if(delay >= 30){
//do a thing
}else{
delay += 1;
}```
to add a delay
package me.jaredy00.bedrockminer;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.event.player.PlayerInteractEvent;
var delay = 0;
public class PlayerInteract implements Listener{
@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent event){
Block block = event.getClickedBlock();
ItemStack tool = event.getItem();
//System.out.println(tool.getItemMeta());
// the item meta you want to find
if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
if(block.getType() == Material.BEDROCK ){
if(delay >= 30){
if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
block.setType(Material.AIR);
}else{
delay += 1;
}
}
}
}
}
}```
are there any good libraries for caching placeholders, or should I just stuff things into a hashmap?
As in placeholders that you're providing, or placeholders that you're consuming?
providing
Oh yeah I just use the cache that I already have for user data to provide placeholders
Since SQL be slow af
👍
I don't have a cache :p
I'm currently calculating everything at runtime
when called for
Oh jeez
I swapped to a new nickname plugin recently on my server, turned out it didn't use async SQL access, so every player join event it would pause the server for a good 2 seconds looking up their nickname for the join message lmao
lmfao
I'm not entirely sure what you're doing, but if you want a 30 second delay, you can use BukkitRunnables to delay things nicely.
💀
bukkitrunnables ?
Man this is really sad.
I tried to implement some leaderboard placeholders in my (fairly complicated) event plugin, but at this point I'm just gonna give up ;-;
this is why Leaderheads and AJLeaderboards exist ig
so much value mapping
mine will kill performance
and me
Yeah this is why AJLeaderboards exists lmao
is there a good way to measure how "optimized" a piece of code is? eg. if there are better ways to do it or not
Uh, run some profiling on a server and see what takes up the most time and try to optimize that?
And I guess get more experience and have others look at your code for differing perspectives
how do I use bukkit runnables outside the main class
this only shows me how to use it inside the main class
You use dependency injection to pass around your main class instance so you can start tasks
how do I do that
?di
Dependency Injection
Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
Read more here: https://en.m.wikipedia.org/wiki/Dependency_injection
Dependency Injection in Java:
https://paste.helpch.at/yijawupoju.java
Dependency Injection in Kotlin:
https://paste.helpch.at/esogakutod.kt
i have a map of strings to lists var indexMap: MutableMap<String, List<String>> = mutableMapOf() and im trying to add an item to the relevant list given the key
but i have a problem with nullability
i've tried
if (indexMap.containsKey(w)) {
indexMap[w].plus(listOf("test1"))
} else {
indexMap[w] = listOf("test2")
}```
I'm even more confused now
Main.java
public final class Main extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
getServer().getPluginManager().registerEvents(new PlayerInteract(), this);
}
BukkitTask join = new PlayerInteract().runTaskLater(plugin, 20)
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
PlayerInteract.java
public class PlayerInteract extends BukkitScheduler implements Listener{
@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent event){
Block block = event.getClickedBlock();
ItemStack tool = event.getItem();
//System.out.println(tool.getItemMeta());
// the item meta you want to find
if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
if(block.getType() == Material.BEDROCK ){
if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
@Override
public void run() {
block.setType(Material.AIR);
}
}
}
}
}
}
no videos to recommend
learning how to code from one youtuber is like an awful way
?learn-java
nope
whatever the command is
?kotlin

:/
oh barry is dead
anyway yeah make sure you learn Java first
that's your priority
stick to basic conventions and good practice first 
then look at spigot javadocs and look at examples from good developers
Just as importantly, keep your expectations reasonable. You will not be able to code a flawless anti cheat an your first plugin
i have java.util.ArrayList and want to get java.util.Arrays$ArrayList, how do i do that?
in Kotlin
this is important lmao
me thinking i could make a skyblock plugin within 1~ month of knowing java & spigot 
please?
i tried Arrays.asList(myList) but that creates a list within a list
fun addAB(): List<URL> {
//val b = ...
val linkList = mutableListOf<URL>()
for (a in b):
linkList += a
}
return linkList
}```
linkList is of type java.util.ArrayList, but i need type java.util.Arrays$ArrayList which is immutable and of fixed size
java.util.Arrays$ArrayList
what requires this type
you can get a java.util.Arrays$ArrayList by doing Arrays.asList(linkList), but that creates a list of size 1 containing that list
the spec im working to
its not set by me
it's likely unintentional
i just need to solve this, if you know the solution i'd appreciate it
just gotta pass the test
been confused for about 4hrs
is this for school?
java.lang.AssertionError: expected: java.util.Arrays$ArrayList<[...]> but was: java.util.ArrayList<[...]>
what are you passing the value into
what do you mean? im just returning linkList from my function and the test gets the value from my function
it's just assertEquals(listOf(...), addAB())
i don't mind if there's a hacky solution, i can come back to it once i've spoken to them. i just need to pass this test to continue working on the rest
that seems to be the correct way to do it
i don't think i can change the tests
they want me to return an immutable fixed list which java.util.Arrays$ArrayList is, and java.util.ArrayList is not
terrible test but just convert ur list into an array and pass it into arrays.aslist
how?
that's what i said here
it's just a list containing a list
can i just do var linkList = emptyArray<x>()?
Required:
List<URL>
Found:
(Mutable)List<Array<URL>!>
var linkList = emptyArray<URL>()
//...
val linkListImm = Arrays.asList(linkList)
return linkListImm
it's returning a list inside a list
needs to be a java array
Array<URL>
idk if kotlin converts that into a java array
it says (kotlin)
well you need a java array to use Arrays.asList
i'm not really sure how
I’m not going to do all the work for you…
and i don't expect you to, but you're explaining a concept i dont understand properly so i can't then search for it effectively
google how to convert a kotlin array to a java array
val linkListImm = Arrays.asList(linkList.toTypedArray()). same issue it just makes a list containing the list
val linkListImm = Arrays.asList(*linkList.toTypedArray())
java.lang.AssertionError: expected: java.util.Arrays$ArrayList<[https://en.wikipedia.org/wiki/HTML, https://www.w3schools.com/html/html_links.asp]> but was: java.util.Arrays$ArrayList<[https://en.wikipedia.org/wiki/HTML, https://www.w3schools.com/html/html_links.asp]>
fantastic
yeah this isn’t something you should try to solve
it’s a fault of the assignment
are you meant to be using kotlin for it?
yeah, i guess. thanks. sunk cost fallacy is making me keep going lol
i should stop i guess
yeah
public class PlayerInteract implements Listener{
int delay = 0;
@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent event){
Block block = event.getClickedBlock();
ItemStack tool = event.getItem();
if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
if(block.getType() == Material.BEDROCK ){
if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
if(delay >= 30){
delay = 0;
block.setType(Material.AIR);
}else{
delay += 1;
}
System.out.println(delay);
}
}
}
}
}
how do I make the int delay per player rather than per triggered event
Guys This code is giving error? can you guys please help me im new to bukkit coding. in this class i was making a event which will play sound on join
@pearl topaz call toList() on the array, should work
... seriously learn java
https://img.olziedev.com/G242472477247hHwjA.png thats now how you access an enum during runtime
Sound#valueOf
I like the fact he did most of dependencyInjection correct but still decided to make it static
wait
LMAO
i didn't even realise 😭
he doesn't even use the global field anywhere else in his class apart from his constructor to register the class
He does
He accessed the config
Yeah just realised
Personally I’d just store the enums for the sounds in memory
Config calls can be expensive
Also it’s only 2 Enums wouldn’t use much memory
Ohh and toUpperCase and Sound.valueOf spam would also be expensive
how? if you mean return linkList.toTypedArray().toList() then no that doesn't work
it's just this
^
youd think so
The offer is still here if anyone wants to collab with me on a magic plugin for 50/50 profit share
Maybe make both collections arrays and use smtng like assertTrue on Arrays::equals
Or iirc junit assertions got a method for that
My papi reload isnt working
i loaded a expansion then typed /papi reload
it says no expansions loaded
i checked the files it has the expansion there
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
ItemStack is = p.getItemInHand();
ItemMeta im = is.getItemMeta();
List<String> lore = im.hasLore() ? im.getLore() : new ArrayList<String>();
if (isSignedItem(lore,p)) {
for (String st : lore)
{
p.sendMessage(st);
p.sendMessage("Lore:" + lore);
if (st.startsWith("§6Firmato da: ")) {
p.sendMessage("Lore in if:" + lore);
p.sendMessage("St in if:" + st);
lore.remove(st); //E' questo l'errore ma non capisco :c
im.setLore(lore);
is.setItemMeta(im);
}
}
}
}
return false;
}
public boolean isSignedItem(List<String> lore, Player p) {
for (String st : lore) {
if (st.startsWith("§6Firmato da: "))
return true;
}
return false;
}```
Hi, I have a problem with this code, basically lore.remove is null and I don't understand why
@EventHandler
public void onClick(PlayerInteractEvent e) {
Player player = e.getPlayer();
Location location = e.getClickedBlock().getLocation();
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && player.isSneaking())
instance.getGenService().upgradeGen(player, location);
}
Any idea why my PlayerInteract even is sending twice?
When clicking a block once it'll run the method twice
it fires once for each hand
Is there a way to prevent this?
Ahh yes
there is an #getHand
if (e.getAction() == Action.RIGHT_CLICK_BLOCK && player.isSneaking() && e.getHand() == EquipmentSlot.HAND) {
``` Should work, thank you for your help emily.

Anyone know how to make a serializable version of a BukkitTask?
I'm trying to serialize a class containing a BukkitTask object into Byte64, however BukkitTask doesn't implement serializable, anyone have a resource or something that could solve this problem, thanks in advance.
Why do you want to serialize a task?
Unless it is a custom class that extends BukkitRunnable and you want to store the data that wasn't processed yet, I don't see a reason to do so
public class PlayerInteract implements Listener{
int delay = 0;
@EventHandler
public void onPlayerInteractEvent(PlayerInteractEvent event){
Block block = event.getClickedBlock();
ItemStack tool = event.getItem();
if(block != null && tool != null && tool.getItemMeta() != null && tool.getItemMeta().getLore() != null){
if(block.getType() == Material.BEDROCK ){
if(tool.getItemMeta().getLore().contains("Breaks Bedrock")){
if(delay >= 30){
delay = 0;
block.setType(Material.AIR);
}else{
delay += 1;
}
System.out.println(delay);
}
}
}
}
}
how do I make the int delay per player rather than per triggered event
Easiest way that I can think of is adding player and currentTimeMillis() of the last usage to some kinda static list. And in the event check whether currentTimeMillis() is greater than the number stored in the list + 1000. @icy thistle
Does anyone know how to set up a maven repo
what software? or maven central?
Doesn't really matter, I'm trying to set up a maven at my website
So I can push artifacts from my dev group
I have a jenkins set up but idk how to use it
if you want to do maven central:
sign up: https://issues.sonatype.org/secure/Signup!default.jspa
apply: https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134
- summary can just be group id, same with description (since it's required)
- group id is, again, group id (ex: io.github.dkim19375 - com.github is replaced with io.github)
- project url, a project that you'll upload to sonatype, im assuming its so that they know you're not botting or anything, you only have to include 1 project
- scm url, tbh idk what it is but if you use github i just did https://github.com/username/project.git and they accepted
- username is your jira username for sonatype
- already synced to central: no
then within a few minutes you'll get a reply which will ask you to verify ownership, for github they just make you create a repository with your ticket name (took 3 minutes for me)
then you reply saying that you did it, then you'll have to publish an artifact, then tell them that you published it so that they can enable syncing (took 6 minutes for me)
lmk after this if you want to use maven central so that i can write more stuff
Thanks that's complicated but I'll try it
lol
(also i wrote this already for someone else too - so hopefully this will go smoothly)
DkimTutorial™️
also note that you only have to do this once
not for every project
but ig to verify that you're actually putting something there you'll have to specify a project
So there's like, 4 different Inventory move events that all do slightly different things if I recall correctly
So it's probably just another event is getting called instead
@tender thicket also actually, if you wanna setup it by hand and you have a vps and a domain you could try reposilite, it is really easy to use
maven central is really easy to set up; it seems waaay more complicated than it actually is but it's pretty simple
Should Builder patterns have interfaces? (Java)
i don't know if they should, but they can that's for sure
like e.g. you have an abstract builder interface for building different buildable types, each with its own builder impl yet all common components would lie in the abstract class / interface
it would also be kinda mandatory if you have an exclusively interfaces-only exposed API, and all the implementation is hidden in a non-exposed module or something like that
loose coupling good
Okay, thanks
explain dis to my brain:
paperweight requires a development bundle to be added to the 'paperweightDevelopmentBundle' configuration, as well as a repository to resolve it from in order to function. Use the paperweightDevBundle extension function to do this easily.
Hi, so I use Maven for my projects because I have not learned any other method and maven seems to be the easiest for me and my libraries. I was wondering if there was a way to remove this from the dependency section because it wont pass a build on jitpack because the dependency goes off of a local file. If it's not possible that fine I was just wondering 🙂
<dependency>
<groupId>net.ricecode</groupId>
<artifactId>string-similarity</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/string-similarity-1.0.1.jar</systemPath>
</dependency>
If it references a local file then sadly not, your best bet would be to put that code on GitHub and include it as a Jitpack dependency
If adding similarity is yours
how can i set my plugin to support different versions?
This line is supposted to only continue if the player is holding a netherite sword and is right clicking, but it fires when left clicking too and on any item
```
if (p.getInventory().getItemInMainHand().getType() == Material.NETHERITE_SWORD && e.getAction() == Action.RIGHT_CLICK_BLOCK || e.getAction() == Action.RIGHT_CLICK_AIR) {```
p is the event player
Use ( )
where
In the actions
ill try
Also why are you doing that?
I mean, interact event?
Cant you simply use e.getItem()?
:wat:


damn yea i can use that, but still, the statement fires at the wrong times
i would of seperated them into two different ifs
so put the item type check in its own if statement
ItemStack#getType != NETHERITE_SWORD
why !=, i want it to fire if the player is holding one, not if he isnt holding one
ill try
i said != to hopefully make sure you dont start arrow code
if (ItemStack#getType != NETHERITE_SWORD)
return
if (action != RIGHT_CLICK_BLOCK && action != RIGHT_CLICK_AIR)
return
hey guys does someone have experience with votifiers?
is it possible to delete certain statistics from world/stats
im wanting to reset only the play_time statistic to 0 but its different for some mc versions
very likely
in specific worlds? not entirely sure
but you could just cancel PlayerStatisticIncrementEvent if the statistic equals one very specific one
How subcommands works in /help pluginame how can i set them because in plugin.yml i only have MighyClass Command
Quick question, I need to split a String after 1027 characters BUT not split it just somewhere, I need to split it at the next whitespace so it doesn't cut off a word
anyone an Idea how to do it?
This room is dead 😄
So true
split by space and check if the current length + next word is more than 1027? @marble nimbus probably not the best way to do so
its fine. matt found this for him: https://stackoverflow.com/a/7528259/3783087
easy
Everybody here is so smart then there's me who don't understand a thing 😄
im not 100% sure what you're asking but if you want subcommands you have to handle that yourself its not something that the plugin.yml handles; same thing with autocomplete for those subcommands
I want to make plugin and there commands to starth with mightyclass so for that i only register one command and that is mightyclass but the commands will me bile mightyclass create maybe mightyclass list or something but the second word i check when he executes the mightyclass command i will set cases for list and create so when i tipe mighty help it will show only this command but not my subcommans like create list reload etc
its not going to show them because the server has no idea what they are; your best bet is to write your own help menu so if they just run /mighty or whatever it will show the help menu with all the subcommands
Thats the idea buy how can i execute another file or maybe text whats in it?
boolean onCommand() {
if (args.length == 0) { /* show help */ }
switch (args[0]) {
case "create":
// handle create
break;
case "othersubcommand":
// handle the other subcommand
break;
// etc etc
}
}```
should be as simple as that; if you want to store the logic or strings for your help message or smth in another class,enum,etc. feel free
so Server Plugin\build.gradle.kts:41:13: Val cannot be reassigned
https://paste.helpch.at/itukobaxan.cs
The player need to set the options for the server.
Prompt will gives player an option whether to accept/declined.
Enabled will automatically enable resource pack
Disabled will automatically disables resource pack
yeah. just so you understand why, when the player first accepts/declines it just sets it as accepted/declined forever for that server and the player has to change it back to either prompt or enabled
Can you change default minecraft help? because i want to make help mightyclass the same message like mightyclass help
Hello,
I'm currently dabbling with PathfinderGoals but I can't seem to get it to work? I'm assuming I'm not setting it right causing it to just not work at all. The entity I'm trying to edit is a ender dragon and trying to make it go from one point to another then to another again then loop through the points. (1.16.5)
Codes a bit messy but here we are:
https://paste.helpch.at/rumohegewe.java <-- Strong Dragon Class
https://paste.helpch.at/awegajocum.java <-- PathfinderGoalFlyToLocation Class
None of the Bukkit.broadcastMessage() are showing up.
Assuming off what I read on the spigot forums, the sequence of the functions go like: a>c>e>b>[e>b...]>d but as this is my first time doing this, not 100% sure
umm, explain more
So when i write command help mightyclass help it will show me the same thing when i whrite mightyclass help
oh, then you should override it, but I dont really remember how
still having this damn problem
Can use CommandPreProcessEvent (something on that lines) or see if you can do something with the default CommandMap?
no idea if the commandmap option works or not never tried
Thanks i will see if it will work! 😉
np
Thanks
finally someone with light lol
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release.set(targetJavaVersion)
}```
This doesn't really makes sense, because if you target version 8 but current java version is compatible with 10, the release will be set to 8
Server Plugin\build.gradle.kts:50:9: Val cannot be reassigned 
that still says val
it points to line 50
processResources {
eachFile { expand version: version }
}```
This is what I use on groovy
this is kotlin DSL
I just
dont get it
I was told to move to kotlin for mojang mappings but now this shit appears
I only want to code some weird mc stuff
smh
smh x2
Server Plugin\build.gradle.kts:50:31: Type mismatch: inferred type is Map<String, Any!> but String! was expected
https://paste.helpch.at/buwumogadi.cs
processResources {
val props = mapOf("version" to project.version)
inputs.properties.putAll(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
}
or ```kt
tasks.processResources {
outputs.upToDateWhen { false }
expand("pluginVersion" to project.version)
}
Kts has compile time errors, it tells you what to do
why does args.length == 3 not work in onTabComplete
arglist1.clear();
arglist1.add("help");
arglist1.add("bind");
arglist1.add("item");
return arglist1;
}
if (args[0].equals("item") && args.length == 2) {
arglist1.clear();
arglist1.add("spell");
return arglist1;
}
if (args[0].equals("spell") && args.length == 3) {
arglist1.clear();
arglist1.add("bind");
return arglist1;
}```
the other ones work find its just adding bind that doesnt work
Server Plugin\build.gradle.kts:51:26: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: public inline operator fun kotlin.text.StringBuilder /* = java.lang.StringBuilder */.set(index: Int, value: Char): Unit defined in kotlin.text
lel
smh
Integer.toHexString(inventory.hashCode())
i think
=dontasktoask
dam
=
@wintry grove, Help menu!
=help
@wintry grove, Help menu!
Various Commands for Barry.
• General Bot/Guild Commands
• Miscellaneous Commands
• XP and Level Commands
• ChatReaction Help
Commands for Barry.
/paste <message> - Paste your message to paste.helpch.at
/ver <plugin/list> - Which versions of various plugins work on 1.8 - 1.13
/status <service> - Check various services to see if they're online
=faq <key/list> - Retrive a faq answer
/skin <username> - View a minecraft player skin
/head <username> - View a minecraft player head
/yaml <paste link> - YAML Parser for paste links
/fools <@user> - April Fools Stats
/links <list/plugin/service> - Get useful links and information on a plugin or service
/banner [Gradient ID] [IMG URL] <text> - Generate plugin page Banners
/plugin <Plugin Name/ID> - Search Spigot for a plugin
/buyercheck <spigot username> - Check if someone bought clip's plugins
?help
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
:))
FUCK
There is no time to wait! Ask your question @dusky harness!

try using this
There was a failure while executing work items A failure occurred while executing io.papermc.paperweight.tasks.GenerateMappings$GenerateMappingsAction Unable to resolve class data binding for 'java/lang/Record' which is listed as the super class for 'zc$a' 

I have been with this for a day now
I really want to end it
what are you even trying to do lol
change to kotlin DSL and use paperweight for mojang mappings
kekw
Use cmake for jvm 
Hi, so I'm working with item-stacks with amounts greater than 64, how would I go about making it so that the item doesn't get removed when I've only got enough room in my inventory for half of the items.
smh
someone help....
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
that
ask suitable questions I am
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
its not returning
try sending a message to the sender on each Ifs at the start of them, so we can see if they are running correctly
I can do that but its clear that the third if is not activating
well, first do that so we can see
does this work for sending to console? Bukkit.getConsoleSender().sendMessage("activated");
it should
ok it worked but why is it like that if all args = 0 in the space
I dont understand that
in the onTabComplete each new arg is assigned to 0
or at least thats what I was told so many times
ok
but if it were that way this should be the 2nd item in the array
unless /magictools doesnt count as an arg
so it must be that
it doesnt
/command arg0 arg1 arg2 arg3 and so on
anyone knows how to detect if player was pushed by some entity?
ugh arguments are bugged as f bro
haha what do you mean?
like If I use the same argument spot or another onTabCommand just because another if statement uses that spot it wont let me
so Im taking out length to see if that works
java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2
its on index 0
check arg size
and I used index 0 for the same placement of another tab command
can I even do -2 index
its always indexing to 2
Index 2 out of bounds for length 2
I set it to -2
even if I take out args length it still shows for length 2
I cant change the index at all wtf
so bugged
fml
?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
// Extends Profile is bugged
and anything past that
I tried taking out clear
I tried taking out length but that messes it up
I tried indexing to a negative number to stop to index of 2 always being there
It is static and stuck at Index 2 and Length 2
for anything past // Profile
I dont get it and find this function is broken
if anyone knows of another way to code this please let me know because this is not working
I just about had it with this args
been messing around for days on the same thing
please if anyone knows of a tab completion api send a link
the spigot one is broken
or Im not coding it in a super professional manor
@EventHandler
public void onPickUp(EntityPickupItemEvent e) {
if(e.getEntity() instanceof Player player) {
ItemStack pickUpItem = e.getItem().getItemStack();
Bukkit.broadcastMessage("Attempting to pickup " + pickUpItem.getAmount());
HashMap<Integer, ItemStack> remainder = player.getInventory().addItem(pickUpItem);
if (!remainder.isEmpty()) {
pickUpItem = remainder.get(0);
e.getItem().setItemStack(pickUpItem);
Bukkit.broadcastMessage(pickUpItem.getAmount() + " is the amount left.");
} else {
pickUpItem.setAmount(0);
e.getItem().setItemStack(pickUpItem);
}
e.setCancelled(true);
}
}
Anyone know why this gives me two items instead of one when only one item is on the ground?
I think that it does fire 2 times, try checking so by sending a message to the player that picks up it
so I have decided to give up on the goddamn mojang mappings for a while and decided to go, but now this throws:
Script compilation error:
Line 45: dependsOn(reobfJar)
^ Unresolved reference: reobfJar
build.gradle.kts: https://paste.helpch.at/vonowegolu.cs
Best way to check if item has been modified?
I mean if it has nbt tags (like custom ones), if metadata has displayname, lore, enchantments, custom model data, if has custom effects (firework), colored (leather armor), etc
without checking one by one, would creating a new item of the same material and comparing itemmeta with equals work?
or maybe directly using isSimilar comparing the item with a new ItemStack of the same material?
How can I send actionbar message with animation, like
&8Hi
&6Hi
runtasklater?
i guess, probably async one can be used too
hasItemMeta should also check for nbt and such
Ty

import de.zerakles.clanapi.ClanAPI;
import de.zerakles.main.Clan;
import de.zerakles.utils.Data;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
public class RaidTeleportListener implements Listener {
private Data getData(){
return Clan.getClan().data;
}
private Clan getClan(){
return Clan.getClan();
}
private ClanAPI getClanAPI(){
return getClan().getClanAPI();
}
String ShopName = "§c§lGuardian Of The Sea Messenger";
@EventHandler
public void onEntityInteract(PlayerInteractEntityEvent event) {
Bukkit.getServer().broadcastMessage(event.getRightClicked().getCustomName());
if(event.getRightClicked().getCustomName().contains(ShopName)) {
Bukkit.getServer().broadcastMessage("Test 1");
Player player = event.getPlayer();
Bukkit.getServer().broadcastMessage("Test 2");
event.setCancelled(true);
Bukkit.getServer().broadcastMessage("Test 3");
if (player.getItemInHand().getType() == Material.IRON_INGOT)
player.sendMessage(ChatColor.BLUE + "Guardian Of The Sea Messenger" + ChatColor.YELLOW + "You have summoned the Guardian Of The Sea" + ChatColor.GRAY + "Be wise on the deciisons you make further on");
else {
player.sendMessage(ChatColor.BLUE + "Guardian Of The Sea Messenger" + ChatColor.YELLOW + "You don't have the right materials to summon the Guardian of The Sea");
}
}
}
}
Why wont this run even atleast public void onEntityInteract(PlayerInteractEntityEvent event) {
Bukkit.getServer().broadcastMessage(event.getRightClicked().getCustomName());
bc that wont even go through
In plugin.yml whats the purpose for usage?
for the default /help command
i have usage: "Exapmle: /mightyclass help" but it wont show that example
Any idea for mine
are u registering the event
Yes
pm.registerEvents(new RaidTeleportListener(), getClan());
PluginManager pm = Bukkit.getPluginManager();
PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(new InventoryMasterListener(), getClan());
pm.registerEvents(new RaidTeleportListener(), getClan());
pm.registerEvents(new JoinEvent(), getClan());
pm.registerEvents(new BreakListener(), getClan());
pm.registerEvents(new ChatListener(), getClan());
pm.registerEvents(new DamageHandler(), getClan());
pm.registerEvents(new MovementListener(), getClan());
pm.registerEvents(new VillagerListener(), getClan());
pm.registerEvents(new BankShopListener(), getClan());
pm.registerEvents(new SupplieShopListener(), getClan());
pm.registerEvents(new OrganicShopListener(), getClan());
pm.registerEvents(new MiningShopListener(), getClan());
pm.registerEvents(new PvpGearShopListener(), getClan());
pm.registerEvents(new TravelLIstener(), getClan());
}
}```
shouldnt be this instead of getClan()?
Probably some static method
?
So what would be the way to get it working
Are you calling that method on your onEnable?
can someone help me with changing a players name?
i used Player#setCustomName but that doesn't work
he probably doesn't call loadListeners() method
i got problems at changing player name with this
p.displayName(Component.text("test" + p.getName()));
and this
p.setDisplayName("test" + p.getName());
and this
p.setCustomName("test" + p.getName());
what can i do?
What can be the issue when usage wont work for my command?
I hate how broken tab complete is
the indexing is broken af
like why and how do you index an item at -1
what
How do I update my gradle version?
Online I saw I gotta do ./gradlew wrapper --gradle-version 7.3 but that does nothing in my project
I normally just manually change it in the gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip is this the latest version
make sure IJ uses gradle-wrapper.properties
Alt s brings up the VCS window
o
uhhh
File -> Settings
then Use Gradle from:
and make sure it says 'gradle-wrapper.properties' file
was it that or something else already?
I mean I am having issues with fabric/geckolib but they told me the issue is the gradle version so I am asking here since a lot of people know gradle here already
click OK and double click control and type gradlew to see gradle version
and if you haven't already press this
Do I need to fix any errors that are happening in my IDE before I do that
Cause it keeps crying about stuff related to Geckolib
i dont think so
Whenever I try running ANY command
gradle command?
gradlew
cause I am getting these errors
But apparently to fix them I need to update my gradle version
I cannot check my gradle version if I dont fix them though
Issue wasn't related to gradle oh well
Unsupported Java.
Your build is currently configured to use Java 17 and Gradle 7.1.1.
Possible solution:
- Use Java 16 as Gradle JVM: Open Gradle settings
- Open Gradle wrapper settings, change `distributionUrl` property to use compatible Gradle version and reload the project
``` anyone know though what this gradle error means
I swear I have changed the version in my gradle-wrapper.properties
🤔
i got that error not while ago
and i just changed it in gradle-wrapper.properties
which fixed it
Go to Settings -> Build, Execution, ... -> Build Tools -> Gradle and change the gradle JVM to 17
You… don't?
What?
onTabComplete
I mean it's as simple as it gets, each separate argument is an element in the array
/command well hello there has args as ["well", "hello", "there"]
if you think its simple then make one that has multiple line based args
You can't send multiple lines
like
bind
profile - myspells
item - spell - bind - spellname - slotnumber
modifiers - spell - spellnames
modifiers - set - slotnumber - modifiername - modifier amount ```
you will understand how useless the api is at this
I don't even understand what that is
it cant index for shit
thats the input for ontabcomplete
it goes in a line
bind is one command
profile is another starting command
Oh so they different possible combinations
And what's the issue…?
it wont index properly it saves the old indexs and makes it impossable to index at the same spot
it actually adds onto the index you will try to use next that is in the same spot then make it come out with index/length errors
Because onTabComplete doesn't save/cache anything internally unless you do of course
What??
here take a look at my code
if you think its fixable thank you...
I am actually trying to get another command api because this one is broken but if you can find a fix I will go with it
the error is easily reproduceable
ok thanks
I do agree it is far from ideal and annoying to use on medium command structures, that's where command frameworks come into play, but it isn't broken
@EventHandler(priority= EventPriority.HIGH)
public void onPlayerUse(PlayerInteractEvent event){
Player player = event.getPlayer();
Location playerloco = player.getLocation();
if(event.getAction().equals(Action.RIGHT_CLICK_AIR)){
Bukkit.getServer().broadcastMessage("Test 1");
final org.bukkit.Location locationraid = new Location(Bukkit.getWorld("world"), 102, 67, -25);
Bukkit.getServer().broadcastMessage("Test 2");
if (playerloco.equals(locationraid)) {
Bukkit.getServer().broadcastMessage("Test 3");
if(player.getItemInHand().getType() == Material.IRON_INGOT){
Bukkit.getServer().broadcastMessage("Test 4");
player.sendMessage(ChatColor.BLUE + "Guardian Of The Sea Messenger> " + ChatColor.YELLOW + "You have summoned the Guardian Of The Sea \n" + ChatColor.GRAY + "Be wise on the decisions you make further on.");
Bukkit.getServer().broadcastMessage("Test 5");
final org.bukkit.Location location = new Location(Bukkit.getWorld("world"), 10, 10, 10);
player.teleport(location);
}
else if (!playerloco.equals(locationraid))
event.setCancelled(true);
else {
player.sendMessage(ChatColor.BLUE + "Guardian Of The Sea Messenger> " + ChatColor.YELLOW + "You don't have the right materials to summon the Guardian of The Sea");
}
}
}
}}
Why does that not work
it stops at if (playerloco.equals(locationraid)) {
But I ran a broadcast it says im on the exact coords





