#help-development

1 messages · Page 1791 of 1

ember estuary
#

is there a way to detect a continuous leftclick?
Besides making the player mine a block

#

can be nms ofcourse

ember estuary
#

nope, only gets triggered once

young knoll
#

No

#

Unless you like, spawn a block in front of them

ember estuary
#

if ur leftclicking air, yea

#

ah u mean no to the question

#

alright

#

guess im gonna set the players head into a barrier

#

and cancel swimming + suffacation

#

the he continuously left clicks

summer scroll
#

Can someone help me how to parse Enum field into a Json using Gson?

eternal night
#

doesn't gson do that for you automatically

ember estuary
#

how can i cancel the block break sound on Interact?

#

cancelling the interactevent doesnt cancel the sound

#

just makes the block re-appear

#

there is Player#stopSound, is there any way to use that for this case?

summer scroll
eternal night
#

idk I am looking at the Gson javadocs

#

and it clearly states it provides enum support

#

Gson provides default serialization and deserialization for Enums, [...]

summer scroll
#

Okay, this is the result

Channel channel::clanplayer has sent a message: {"name":"aglerr","uuid":"null"}
```and that is from
```java
String jsonData = gson.toJson(clanPlayer);
jedis.hset(key, "details", jsonData);
jedis.publish(RedisHandler.CHANNEL_CLAN_PLAYER, jsonData);
young knoll
#

There should be a stopAllSounds method in modern versions

quaint mantle
#

gson.toJson(new ClanPlayer("aglerr", UUID.randomUUID().toString(), ClanRank.OWNER))

{
  "name": "aglerr",
  "uuid": "f51c981d-a5ba-4e4e-ad1e-868fc671c9cc",
  "rank": "owner"
}

Works fine for me

summer scroll
#

Oh what

summer scroll
#

Still doesn't work for me for some reason.

jsonData = {"name":"aglerr","uuid":"null"}
#

Oh, maybe the ClanRank is null so it won't parse to Json, that might be the problem.

#

Yeah, it's because the ClanRank is null

ember estuary
#

why does rightclicking a block double-trigger the PlayerInteractEvent

#

is that intended?

young knoll
#

Yes

#

Both hands

ember estuary
#

ahhhhhh

#

lol

quaint mantle
#

i have a question; what does the return statement in the onCommand @Override do

#

does it actually do something? or nah

sullen marlin
#

No, it's just a helpful reminder

quaint mantle
young knoll
#

Yes

#

That is exactly what it does

quaint mantle
#

so if i returned true for the entire thing i wouldnt get the usage message?

young knoll
#

Yes

quaint mantle
#

cool, thank u

sullen marlin
#

Oh

#

Sorry I misread

#

I thought you were asking what @Override did

young knoll
#

@Override is only for you, and the compiler I guess

upper niche
#

I can't figure this out
I'm trying to make a simple little thing where I send an item's display through a chat hover event
looked at the BungeeCord chat api
used some textComponents and a hoverEvent with SHOW_ITEM
the part I can't figure out is actually creating the Item object to show
Creating the base item works fine, hovering over the item's name shows the window for it, but any custom data like lore or enchantments is lost during the conversion from the bukkit ItemStack to the BungeeCord Item and instead it's just the base item's data
my current method is constructing the Item using an ItemTag from ItemTag.ofNbt(item.toString())
Am I understanding something about this wrong?

quaint mantle
#

how can i set each command to be its own Command_the command name class, automatically

#

i have all the classes setup,,, is this a thing of the future? should i set them all.. manually?

molten plover
#

Is there an updated version of PacketWrapper for ProtocolLib?
I get a little confused when it comes to managing the packets myself

waxen plinth
#

You can drastically simplify commands using libraries though

quaint mantle
waxen plinth
#

Yes you could use reflection but that seems overkill

quaint mantle
#

im just trying to move all this into a few lines, other than .setExecutor( each thing here )

waxen plinth
#

Especially when you could just use a library that takes away a lot more pain points

quaint mantle
worldly ingot
#

Line count isn't a bad thing lol

quaint mantle
waxen plinth
#

Okay you can use reflection

#

But I would really consider using a library

#

Anyways

#

You would first need to get a list of all commands defined by your plugin

#

You can get that from the PluginDescription

quaint mantle
waxen plinth
#

Then you could iterate over them and do something like this

quaint mantle
#

i have the everything setup, im just not quite sure how to Class.forName

waxen plinth
#
String name;
Class<?> clazz = Class.forName("package.here.Command_" + name);
CommandExecutor executor = clazz.getDeclaredConstructor().newInstance();
getCommand(name).setExecutor(executor);```
waxen plinth
#

@quaint mantle but seriously, next time you should really just use a library, they will make your commands 10x easier to implement

#

If you want, I can show you how

quaint mantle
#

if you want to you can, if it makes my life easier ;o

#

to not flood this channel though you can DM me if you are willing to show me

waxen plinth
#

Ok

lean gull
#

can someone please help me with this? i'm making a gamerules gui thing for easier access to gamerules, and i need a bunch of simillar methods to this one, but it will probably cause lag

young knoll
#

You can have a thousand methods and you won’t really get any lag

#

Because you aren’t calling them

lean gull
#

i am though

#

that's just a part of my code

young knoll
#

I mean are you calling them all at once

lean gull
#

i only have one method as of right now but yeah i'm going to be doing that

young knoll
#

Why

lean gull
#

and i'm also going to be calling them again when i need to toggle a gamerule in the gui

#

the method sets the item in the gui red if the gamerule is false, and green if it's true

young knoll
#

You could compress all this gamerule toggle stuff down to very few lines

lean gull
#

so whenever you open the gui or toggle a gamerule, i'd have to call the method/s

young knoll
#

Just loop over all game rules and add an item to the inventory based on the state

#

Can do that in like, 10 lines

lean gull
#

each gamerule in the gui is supposed to have an explination of what it does though

ember estuary
#

How can i extend a class (which I can't edit) to add my own features?
I can't mnanage to cast the instance from superclass to new subclass

young knoll
#

Store the descriptions in a map

#

And just grab the right one from there

lean gull
#

a hashmap?

young knoll
#

Yes

lean gull
#

ok

#

is it bad to call the same method like 15 times at once but with different parameters?

young knoll
#

No

lean gull
#

ok

#

thank you

quaint mantle
eternal oxide
#

you have shown no relevant code to comment on.

stone sinew
eternal oxide
#

I'll assume UUIDObject is a Json?

stone sinew
#

yeap. Ill show whole method one sec

eternal oxide
#

so the failing is mAPI.getUUIDFromUsername(name)

stone sinew
eternal oxide
#

This works fine ```java
public static UUID getUUID(String name) throws IllegalStateException {

    try {
        URL url = new URL("https://api.mojang.com/users/profiles/minecraft/" + name);

        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setReadTimeout(5000);
        conn.setInstanceFollowRedirects(true);
        conn.addRequestProperty("User-Agent", "Mozilla/4.0");
        conn.setDoOutput(false);

        try    (JsonReader reader = new JsonReader(new InputStreamReader(conn.getInputStream()))) {

            reader.setLenient(true);

            // read JSON data
            JsonObject json = new Gson().fromJson(reader, JsonObject.class);

            // close reader
            reader.close();

            return UUID.fromString(json.get("id").getAsString().replaceFirst( 
                    "(\\p{XDigit}{8})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}{4})(\\p{XDigit}+)", "$1-$2-$3-$4-$5" 
                    ));

        } catch (IOException e) {
            throw new IllegalStateException("ERROR_CHECKING");
        }

    } catch (Exception e) {
        /*
         * Fail quietly.
         * No need to spam a stack trace.
         */
        return null;
    }
}```
stone sinew
#

It outputs the correct UUID but doesn't return it...

eternal oxide
#

its a Json Object, you shoudl use getAsString() not toString()

stone sinew
eternal oxide
#

but that code you just posted, its impossible for it to correctly print the uuid and not return it in teh very next line

stone sinew
#

Thats why I'm confused xD

eternal oxide
#

try using getAsString()

#

my method is a lot smaller and cleaner than yours too 🙂

stone sinew
sullen marlin
#

public String getUUIDFromUsername(String name) { return Bukkit.getOfflinePlayer(name).getUniqueId()); }

#

?

sullen marlin
#

when did it not work

stone sinew
#

1.8 - 1.12

stone sinew
#

Oh I remember. I used my method because I thought Bukkit.getOfflinePlayer only showed users that joined the server.

#

I found my issue... somewhere, somehow name is changing to the uuid.

#

I still have no clue how though xD

eternal oxide
#

my guess you are somehow calling it using a UUID/string instead of a name

stone sinew
#

Yeah I'm gonna have to rewrite a few of my methods.

#

I honestly have no clue how this is ocurring.

oblique wigeon
#

How do I check whether a recipe is matching with a custom recipe?
I've tried:

e.getInventory().getRecipe().equals(customrecipe)

and this disgusting loop that checks if the items match an array...

        List<ItemStack> inv = Arrays.asList(e.getInventory().getMatrix());

        //Check if the recipe is the heart recipe
        List<Material> itemlist = Arrays.asList(Material.AIR, Material.ENCHANTED_GOLDEN_APPLE, Material.GHAST_TEAR, Material.GHAST_TEAR, Material.NETHER_STAR, Material.GHAST_TEAR, Material.GHAST_TEAR, Material.ENCHANTED_GOLDEN_APPLE, Material.AIR);

        for(ItemStack recipeitem : inv){
            Material recipeitemtype = Material.AIR;
            if(recipeitem != null){
                recipeitemtype = recipeitem.getType();
            }
            this.plugin.getLogger().info("Actual Material: " + recipeitemtype.toString());
            this.plugin.getLogger().info("Recipe Material" + itemlist.get(inv.indexOf(recipeitem)).toString());
            if(recipeitemtype.equals(itemlist.get(inv.indexOf(recipeitem)))){
                this.plugin.getLogger().info("Found material that matched recipe!");
                continue;
            }
            return;
        }```
But.. nothing seems to work
hollow spindle
#

Hello! I'm trying to make my own custom GUI class to help assort and manage my "screens/pages" of GUIs. I've worked with many languages, however java being my least skilled I do believe I may be at fault here because I could be following another language's syntax/execute flow.

I have the main code here that is expected to run from a command class. It pretty much instates the class, switches screen and display GUI with event handlers.

new ScreenManager(plugin).get("Dropbox", (Player) commandSender).display((Player) commandSender);

I now have the manager class being called here. This is the main driver of all the GUI work and I work all screens on this class.

public class ScreenManager implements Listener {
    Inventory session;
    Screen gui;
    Plugin plugin;
    Player player;

    public ScreenManager(Plugin plugin) {
        this.plugin = plugin;
    }

    public ScreenManager get(String screen, Player player) {
        // Saves the Inventory stack to the class.
        switch (screen) {
            case "Dropbox" -> this.gui = new Screen_Dropbox(player);
            case "DropboxAdmin" -> this.gui = new Screen_AdminDropbox(player);
        }

        return this;
    }

    public void display(Player player) {
        // Displays the current stack GUI to the player.
        if (player == null) this.player.openInventory(gui.getGUI());
        else player.openInventory(gui.getGUI());
        this.session = gui.getGUI();
        // Bukkit.getLogger().severe(gui.toString());
    }


    @EventHandler
    public void onInventoryClick(InventoryClickEvent e) {
        if (e.getInventory().getHolder() instanceof Screen) {
            Bukkit.getLogger().warning(String.valueOf(this.gui)); // This should effectively give me the GUI ID/Instance. But it's returning null.
            this.gui.eventClick(e); // Point of error.
        }
    }
}

For some reason, the re-declarement of the this.session variable is not persisting or saving. I'm sure that looking through the script it should work as intended but visually and on hand, it doesn't work and seems to be "null".
I'd like someone's opinion and feedback in regards to this.

Error Stack (From a fresh clean server):

[17:47:05 WARN]: null
[17:47:05 ERROR]: Could not pass event InventoryClickEvent to Dropbox v1.0.0
java.lang.NullPointerException: Cannot invoke "xyz.nekonii.hexcraft.dropbox.gui.screens.Screen.eventClick(org.bukkit.event.inventory.InventoryClickEvent)" because "this.gui" is null
eternal oxide
hollow spindle
stone sinew
#

@eternal oxide It was another method sending the UUID to the method 🤦

eternal oxide
#

Your switch statement in get also falls though

final fog
#

Is it possible to remove or disable the spectator mode menu or teleporting

#

(When you press 1 while in spectator mode)

quaint mantle
#
if (false == false) {
  return false;
}
return true;```
hollow spindle
eternal oxide
#

you have no break; it will always fall through to admin

hollow spindle
#

Oh i see

#

I'll wrap that up then

final fog
worldly ingot
hollow spindle
quaint mantle
worldly ingot
hollow spindle
#

Yeah it just doesn't save the gui property at all after the get method finishes

eternal oxide
hollow spindle
#

yaya

final fog
# worldly ingot Disable the menu? No. That's client sided. Disable the teleporting? Absolutely. ...

I have a bit of a problem, the teleportation cancelling works perfectly. But while I have an active spectator target (when you left click an entity while in spectator mode) it kicks me out of that state, anyway to fix it? java @EventHandler public void onSpectateTeleport(PlayerTeleportEvent event) { Player player = event.getPlayer(); this.data = new Files(Main.getInstance()); Player spectator = (Player) player.getSpectatorTarget(); if (this.data.getConfig().getBoolean("Players." + player.getUniqueId() + ".Banned")) { if (event.getCause().equals(PlayerTeleportEvent.TeleportCause.SPECTATE)) { event.setCancelled(true); player.sendMessage(ChatColor.RED + "This is disabled!"); player.setSpectatorTarget(spectator); } } } here's what I currently have when I tried to fix it

worldly ingot
#

Suppose you could re-enter them into that same entity

#

Oh, actually you're doing that already

#

Do it one tick later

final fog
#

Alright, ty for the help btw

#

can go to bed sooner

worldly ingot
#

Also, don't assume that the spectator target is a Player. It might not be. No reason for it to be anything more specific than an Entity

hollow spindle
worldly ingot
#

That's what they're doing

hollow spindle
#

Ah my bad, i guess i didnt read it thoroughly

worldly ingot
#

Yeah, seems that even if it's cancelled it jumps them out of their spectator target

#

Delaying a target set by one tick should resolve that

final fog
#

Hmm it still kicks me out when I teleport

worldly ingot
#

Even with a tick delay?

#

o.O

final fog
#

Yeah.

#
    @EventHandler
    public void onSpectateTeleport(PlayerTeleportEvent event) {
        Player player = event.getPlayer();
        this.data = new Files(Main.getInstance());
        Entity spectator = player.getSpectatorTarget();
        if (this.data.getConfig().getBoolean("Players." + player.getUniqueId() + ".Banned")) {
            if (event.getCause().equals(PlayerTeleportEvent.TeleportCause.SPECTATE)) {
                event.setCancelled(true);
                player.sendMessage(ChatColor.RED + "This is disabled!");
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        player.setSpectatorTarget(spectator);
                    }
                }.runTaskLater(Main.getInstance(), 1);
            }
        }
    }``` here's what I got
worldly ingot
#

Strange... Confused

final fog
#

I was expecting that to work too

#

;/

worldly ingot
#

I mean... sounds like a stupid attempt, but delay it for 10 ticks I guess? lol

#

I'm running out of ideas. I've no clue why that wouldn't work

final fog
#

maybe something went wrong in the uploading proccess ill try that part again

#

I do that a lot

worldly ingot
#

If not, wonder if it's just a client-sided issue

#

e.g. out of the spectator view on the client but on the server they're still spectating

stone sinew
#

Are you sure its running?

worldly ingot
#

I'd hope so. The teleportation is cancelled 😛

stone sinew
#

Didn't read the whole convo

final fog
#

I know why it isn't working, when I exit it says the spectator variable is null

eternal oxide
#

check in teh event that you have a valid spectated Entity

final fog
#

wdym?

eternal oxide
#

Entity spectator = player.getSpectatorTarget();

#

make sure you actually have a target, its nullable

final fog
#

I think I just need to serialize the thing

#

than maybe I can go to sleep

summer scroll
#

Can I code 1.16 plugin with Java 16 but compile it with java 8? So the code is on java 16 but can be used in java 8.

eternal oxide
#

you can have JDK 16 and compile for java8

summer scroll
#

I really like the switch lambda feature and the instanceof variable thingy.

#

Oh I can!? that's pretty awesome

stone sinew
#

java is backwards compatible so you can compile in java 8 and your code will function on above versions. However minecraft is not backwards compatible so you still need to run the java version for your server version

final fog
#

Why is spectator mode like this

#

I just fixed me leaving the spectator target

#

but now apparently entering it also counts as a teleport

summer scroll
stone sinew
#

You can't code with java 16 without compiling it in java 16 if thats what you mean. (Unless you use reflection)

#

can only use the code from the java version you're compiling with.

summer scroll
#

Maven compiler?

#

Evem with maven compiler I can't?

stone sinew
#

Hmmm actually you might be able to. At that point you would have to just try it.

#

But your gonna have issues if the point is to support -1.17

summer scroll
#

kk, ill try it later

stone sinew
#

Yeah I build with spigot 1.17 and support down to 1.8.8 but compile against java 8 so thats what I thought you were asking.

calm star
#

When I check if an action from an event is right click air or right click block. When I right click a block the code repeats twice

#

doing this

        if (a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK) {
            System.out.println("Hi");
        }
``` prints hi twice when I right click block
#

But when I right click air, it only runs once

#

How can I only make it run once for both right clicking air and block?

eternal oxide
#

event.getHand()

quaint mantle
#

im wondering why my events aren't working.. trying to make some items undroppable, for staff mainly but for some reason... they just aren't working

#

events are registered*

#

and do have @EventHandler

#

events are registered

#

yes

#

i already said, my events are registered

#

yes

#

my class implements Listener

eternal oxide
#

one of your above statements must not be true or your events would be firing.

quaint mantle
#

so im checking if the item they are dropping is that itemstack

#

i'll System.out.print the boolean for whether they equal, but its obviously no.. for some reason

eternal oxide
#

if the sysout happens then your events are firing

quaint mantle
#

yeah, it seems like they aren't, but its just conditions i guess?

#

how should i check if the itemstack they drop, is equal to my static one

eternal oxide
#

.isSimilar not ==

quaint mantle
#

ahhhh

#

its just like Strings lmfao weird

#

thank u Elgar <3

calm star
quaint mantle
#

nms

#

im too lazy to find you the post bout it

#

or any plugin similiar to that

#

¯_(ツ)_/¯

calm star
#

Ay @delicate raptor u here yet?

calm aurora
#

Hello I want some people to help me in Coding the Plugins is anyone free

onyx shale
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Create a thread in case the help channel you are using is already in use!

calm aurora
onyx shale
#

isnt there a param to tell it for how long to show?

#

a nvm

#

thats a plugin question not a development

spare prism
#

Recipes

calm aurora
#

@onyx shale Can you help me in Developing my Server?

onyx shale
#

nope,pretty much everyone its working on theyr own thing so i doubt many will accept

#

as its a rather time expensive service

#

if ur willing to pay try here tho

#

?services

undone axleBOT
red sedge
#

sendMessage is deprecated?

#

p.sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(message));

hollow spindle
#

Try p.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(message));?

quaint mantle
#

oh

eternal oxide
#

not in spigot it isn't

hollow spindle
#

Worked fine on my end?

red sedge
#

i mean i can just ignore it maybe?

hollow spindle
#

Where's the error from?

eternal oxide
#

You are not using Spigot API

#

Its deprecated in Paper

hollow spindle
#

Ahhh

eternal oxide
#

they deprecate all BaseComponent methods in favour of their Adventure system

slim kernel
#

If I wanna set a texture pack and I upload it to google drive where do I get the link from that I need to put in the code?

full holly
#

!paste

#

?paste

undone axleBOT
primal sequoia
#

How does one setup

#

permissions for their commands

#

as in shad.feed for example

#

or smth

calm star
#

Hey guys when I use the e.getAction in my event, when I do ‘if(a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK) {}’

#

When I right click I block it output the code underneath twice

#

But it only runs it once when I right click air

#

How can I make it so that when I right click a block, it only runs the code once

tardy delta
#

how can i override this?

full holly
#

Help me wtf... After setting blocks to air in 1.17 spigot I need to left/right click them that they are air? how can I fix this? help

tardy delta
#

meh static interface method overriding isnt possibl

misty current
#

you can't change the return type if you override

misty current
slim kernel
#

I am setting a texturePack with a link to google drive. When I set the texture pack it says "Downloading ResourcePack Making Request 100%" then it goes away and I dont have the texturePack. What did I do wrong?

misty current
#

did you make it into a .zip or .rar?

slim kernel
misty current
#

which one

slim kernel
fast onyx
#

This event is properly coded, but when a player joins it didn't do anything

misty current
#

if you listen for the event, it should also be called when the resourcepack is refused for any reason

#

maybe debug with that

misty current
fast onyx
#

onEnable event?

full holly
misty current
#

with Bukkit.getServer().getPLuginManager().registerEvents()

misty current
#

did you try restarting?

fast onyx
#

i did it with another code

full holly
fast onyx
#

registerListener(this, this);
instead of registerEvents

misty current
#

use registerEvents

misty current
#

PlayerResourcePackStatusEvent

#

iirc

full holly
#

you have an idea

#

?

fast onyx
misty current
#

then you can do PlayerResourcePackStatusEvent#getStatus()

#

and it returns an enum value

misty current
#

send the code for the block removing

full holly
#

loc.getBlock().setType(Material.AIR);

misty current
#

this should be right

#

do you host it on local?

#

or do you have any anti-viruses that block outgoing/incoming data?

slim kernel
misty current
#

where did you upload it?

slim kernel
misty current
#

and are you using a custom client

slim kernel
misty current
#

hm

#

send the link you used

misty current
full holly
misty current
#

hm i have no idea

primal sequoia
#

I have a commands class (In IntelliJ IDEA) and was wondering how I add a permision to this:

            player.setGameMode(GameMode.SPECTATOR);
            player.sendMessage("§a§l(!) §eGamemode set to Spectator!");
        }
misty current
#

you either check if the sender has permission or add a permission in your plugin.yml

primal sequoia
#

How does one add a permission into plugin.yml

#

Is it
permission: shad.gm3 for example?

misty current
#

yep

primal sequoia
#

Bet

#

Thanks!

misty current
#

np

hazy rock
#

does anyone know how to make it so when a player places a block it turns into a idfferent block

eternal oxide
#

?stash

undone axleBOT
hazy rock
#

so when you place a dirt block, it turns into a different block

quaint mantle
#

block place event

hazy rock
#

theres getBlockPlaced() but no setBlockPlaced()

quaint mantle
#

then get the position of that block

#

then set a random block there

hazy rock
#

kk

quaint mantle
#

after doing all of that now you can cancel

#

just do some workaround lol

hazy rock
#

lol thanks

quaint mantle
#

or you can #setBuild(false)

#

i think setbuild is better than cancel it ngl

misty current
#

what's the maximum distance a client can render an entity? I'm tryna spawn an entity when a player gets close to a location with packets, tried spawning on chunk loading but had no success

quaint mantle
#

i think some percent depends on their view distance

misty current
#

yeah that's why i tried listening for chunk packets

quaint mantle
#

nah

#

chunks load further than the distance that client can render entities

#

but why do you need it?

misty current
#

i have an entity spawned with packets

#

and when the player gets away, it obviously disappears

#

i'm tryna make it appear back

#

when it comes in your render distance

quaint mantle
#

it will always appear back?

#

dont it?

primal sequoia
#
            player.setGameMode(GameMode.SPECTATOR);
            player.sendMessage("§a§l(!) §eGamemode set to Spectator!");``` What would I add if I want it to say a message if they do not have permission to use this?
misty current
#

it's spawned in with packets

#

so no

#

it won't

quaint mantle
# primal sequoia ``` else if (cmd.getName().equalsIgnoreCase("gm3")) { player....

this is my very old example for how i code for each commands

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (sender instanceof Player p) {
            if (p.hasPermission("risingcore.spawnsystem")) {
                if (args.length == 1) {
                    String locationName = args[0];
                    if (!locations.getConfig().contains("Locations-Data." + locationName)) {
                        locations.getConfig().set("Locations-Data." + locationName, p.getLocation());
                        locations.save();
                        language.setSpawn(p);
                        return true;
                    }
                    language.alrName(p);
                    return true;
                }
                language.noArgs(p);
                return true;
            }
            language.noPerm(p);
            return true;
        }
        language.playerOnly(sender);
        return true;
    }```
#

i think this is cleaner than doing multiple else if lol

misty current
#

oh no the pyramid of pain

quaint mantle
#

😠

misty current
#

imagine not having a command builder

quaint mantle
#

old example

limber perch
#

I wanted to ask, what would I add for map resetting, ik how to world reset, but im not at all sure how to reset a region, linking it to worldguard flags etc

misty current
#

but still

#

imagine not having one

quaint mantle
#

😠

#

🧑‍🍳

#

gonna slap you with my

#

🥄

misty current
#

oh no

quaint mantle
#

what do u mean by reset a region?

#

the region in worldguard will be the same if you dont delete the file

#

so if you still have an exact copy of that world

#

then i dont feel like you really need to care bout that

tardy delta
#

resetiing a wg region?

limber perch
#

Reset an arena basically, which is also a region “regionarena”

#

An addon for strikepractice

#

Or a plugin along with strikepractice

quaint mantle
summer scroll
fast onyx
#

is possible to change the line 1 & line 2 of the server motd?

primal sequoia
#

@fast onyx I know it is possible just not how to do it- lol

fast onyx
#

well

#

i just searched on bukkit forums

#

i found one of 5 years old maybe it works

#

xd

primal sequoia
#

lol

#

doesn't hurt to try

fast onyx
#

yep

#

trying

quaint mantle
#

Why this not work

McPlugin.java

package com.AshKetchum.FirstPlugin;

import com.AshKetchum.FirstPlugin.Commands.TestCommands;
import com.AshKetchum.FirstPlugin.Events.TestEvents;
import org.bukkit.ChatColor;
import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;

public class McPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new TestEvents(),this);
        getServer().getPluginManager().registerEvents(new TestCommands(), this);
        getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "[McPlugin] Enabled made by AshKetchumPL!");

    }

    @Override
    public void onDisable() {
        getServer().getConsoleSender().sendMessage(ChatColor.RED + "[McPlugin] Disabled -made by AshKetchumPL!");
    }

}
#

TestEvents.java

package com.AshKetchum.FirstPlugin.Events;

import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.plugin.Plugin;

public class TestEvents implements Listener {

    @EventHandler
    public static void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        player.sendMessage(ChatColor.LIGHT_PURPLE + "Welcome to the server :) ");
    }

    @EventHandler
    public static void onEnterBed(PlayerBedEnterEvent event) {
        GameMode gm = event.getPlayer().getGameMode();
        if(gm != GameMode.CREATIVE &&gm != GameMode.SPECTATOR) {
            World w = event.getPlayer().getWorld();
            w.createExplosion(event.getBed().getLocation(),5);
        }
    }

    @EventHandler
    public static void onPlayerWalk(PlayerMoveEvent event) {
        Player player = event.getPlayer();
        int x = player.getLocation().getBlockX();
        int y = player.getLocation().getBlockY();
        int z = player.getLocation().getBlockZ();

        player.sendMessage("x: " + x + " y: " + y + " z: " + z);
    }
}

TestCommands.java

package com.AshKetchum.FirstPlugin.Commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

public class TestCommands implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {

    }

}
#

Error:

Error: Could not find or load main class com.AshKetchum.FirstPlugin.Main
Caused by: java.lang.ClassNotFoundException: com.AshKetchum.FirstPlugin.Main

Process finished with exit code 1```
#

Why this not work

drowsy helm
#

well you name it Main in your plugin.yml but its McPlugin

quaint mantle
#

dis my plugin.yml

name: McPlugin
version: 0.0.1BETA
author: AshKetchumPL
main: com.AshKetchum.FirstPlugin.McPlugin
api-version: 1.14```
drowsy helm
#

well it cant be

#

the error is saying com.AshKetchum.FirstPlugin.Main

#

unless you didnt recompile

quaint mantle
#

i will try changing com.AshKetchum.FirstPlugin.McPlugin to com.AshKetchum.FirstPlugin.Main

drowsy helm
#

no

#

what you sent is right

#

it just means whatever you're running isnt updated

noble lantern
#

Is there an event for when a player trades with a Villager?

quaint mantle
misty current
#

there's an event for selecting a trade

maiden mountain
#

Does anyone know how the change the skin of a citizens npc?

#

I'm trying to spawn an NPC and then change its skin to mine

maiden mountain
#

Its development

#

I'm currently using this code

  CraftPlayer craftPlayer = (CraftPlayer)player;
        GameProfile profile = craftPlayer.getProfile();
        Property skin = Iterables.getFirst(profile.getProperties().get("textures"), null);
        String value = skin.getValue();
       // player.sendMessage("Texture Value: " + value);
        NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, "james");
        npc.spawn(player.getLocation());

        SkinTrait trait = npc.getTrait(SkinTrait.class);
        trait.setTexture(value, skin.getSignature());
        trait.setShouldUpdateSkins(true);
drowsy helm
#

the api should have a method

#

not sure if they still use traits

maiden mountain
#

I cannot find any method for changing the skin

fast onyx
#

How this is called?:

random-string:
              - "hi"
              - "how this type of string is called?"
onyx shale
#

stringlist?

fast onyx
#

#getStringList()?

maiden mountain
#

So is anyone able to help me?

noble lantern
#

Look into citizens source code

#

and see how ./npc skin --url works

maiden mountain
#

Already got it working:

#

just give the metadate skin name the same as the player Name

fast onyx
#

is possible? at least i cannot, the ide throw error saying require string

drowsy helm
#

what are you trying to achieve?

fast onyx
#

set server motd

drowsy helm
#

yeah but how would that work with a list

fast onyx
#

i want to go to the next line xd

drowsy helm
#

going by your "random-string" name do you want to chose a random one out of them?

drowsy helm
#

just concat the two strings with an "\n" in the middle

fast onyx
#

there is no way to use a string list?

#

like replace or smth?

drowsy helm
#

if you want make your own method for it

#

but a string list can be more than 2 lines

fast onyx
#

mm

#

weird

#

okay, ty

limber perch
peak granite
#

trying to make a /rename command, this doesn't rename my item player.getInventory().getItemInHand().getItemMeta().setDisplayName(String.join(" ", args));

manic furnace
#

Is there a way to make a donation link without paypal?

drowsy helm
#

You have to set the meta again

#

You cant directly edit it like that

noble lantern
#

Is there any reason why a BOOLEAN PersistentDataType doesnt exist?

eternal oxide
#

(BYTE) 0

noble lantern
#

I mean i can just do it with integers too, but im just curious as to why it doesnt exist in the first place

eternal oxide
#

a waste of space to use an integer

fast onyx
#
 if(!(sender instanceof Player)) {
            plugin.reloadConfig();
            Bukkit.getConsoleSender().sendMessage(config.getString(reloaded));
        }

getting this error:
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_8_R3.command.ColouredConsoleSender cannot be cast to class org.bukkit.entity.Player (org.bukkit.craftbukkit.v1_8_R3.command.ColouredConsoleSender and org.bukkit.entity.Player are in unnamed module of loader java.net.URLClassLoader @61a485d2)

tardy delta
#

does plugin.saveDefaultConfig() also loads the config.yml yamlconfiguration?

fast onyx
#

yes, i guess

#

works perfectly the command and reload the config perfectly if you're a player

#

but if is sent by console then error

tardy delta
#

what does copydefaults do?

fast onyx
#

copy the config to the plugin folder

#

like create a new one

tardy delta
drowsy helm
#

Dont need to spoonfeed

tardy delta
#

he/she forgot one line

eternal oxide
eternal oxide
fast onyx
#

it does

eternal oxide
#

No it does not

fast onyx
#

it works perfectly

#

my problem is on reload command sent by console

#

not that

tardy delta
#

no i was just wondering

eternal oxide
#

CopyDefaults simply returns a boolean state of the default setting

tardy delta
eternal oxide
#

copyDefaultConfig() created teh folder and copies the resource from yoru jar to the folder (if it exists)

fast onyx
#

thats not my problem

peak granite
#

setting name:

        ItemMeta meta = stack.getItemMeta();
        meta.setDisplayName(Color.translate(String.join(" ", args)));
        stack.setItemMeta(meta);
        player.getInventory().setItemInHand(stack);```

is there a more efficient way in doing so
eternal oxide
red sedge
#

How can I get the location of a random block around an entity's head

eternal oxide
#

if its a human entity p.getEyeLocation().getBlock()

red sedge
#

if its not?

fast onyx
#

i found the problem

#

is because the string contains color codes

#

so how i can remove color codes on console message?

#

Because the string is used for players and for console

#

chatColor.stripcolor? i tried that and not working

peak granite
#
        ItemMeta meta = stack.getItemMeta();
        List<String> lore = meta.getLore();
        lore.add(Color.translate(String.join(" ", args)));
        meta.setLore(lore);
        stack.setItemMeta(meta);
        player.setItemInHand(stack);```
doesn't work, errors ingame & console
undone axleBOT
peak granite
floral pier
#

Hi!

I'm having an issue. I'd like to be able to access the running instance of a plugin in a separate plugin; the consensus seems to be that you include the JAR file of the dependency as a library to the dependent (https://www.spigotmc.org/threads/how-to-access-an-entire-plugin-from-another-plugin.248672/).
That doesn't seem to be true since when I try to access a field in the dependency it is null although should be set during onEnable, suggesting that the included library is it's own instance of the plugin being used as an API.

#

t57r

#

yftrtfdxgyytygygfthgtyfhttgig766tyihy

peak granite
visual tide
#

i assume your item is null

grim ice
# red sedge if its not?

Just get the entity location, up it by 1, then randomize the x and z value while setting a max amount it can't go more than it, so u won't get a location very far away.

peak granite
visual tide
#

well something is

grim ice
#

Show AddLoreCommand.java:37 @peak granite

grim ice
limber perch
#

Ok i actually need some help

#

idk how to reset arenas ; - ;

#

linking it to duels

#

strikepractice*

grim ice
peak granite
#

fixed it

#

had to check player.getInventory().getItemInHand().getItemMeta().hasLore() if it did, add onto it, if it didn't, set it

#

thanks@visual tide

grim ice
peak granite
#

they told me something was null

#

gave me a clue

grim ice
#

If you didn't know what was an NPE then I have better help

#

?learnjava

undone axleBOT
visual tide
grim ice
#

Knowing what's a NPE is day 1 of java

floral pier
#

titguityruyryyggttutttiggru4i

visual tide
grim ice
#

I'm helping them

#

That's how I was replied to when I started out and I definitely got better

quaint mantle
floral pier
#

Hi!

I'm having an issue. I'd like to be able to access the running instance of a plugin in a separate plugin; the consensus seems to be that you include the JAR file of the dependency as a library to the dependent (https://www.spigotmc.org/threads/how-to-access-an-entire-plugin-from-another-plugin.248672/).
That doesn't seem to be true since when I try to access a field in the dependency it is null although should be set during onEnable, suggesting that the included library is it's own instance of the plugin being used as an API.

(Sorry for the spam, went out for a smoke and the kids decided to discuss the issue.)

limber perch
#

damn everyone ignoring me

#

:welp:

#

:welp:

grim ice
ivory sleet
#

Bump it then?

limber perch
#

i did smh

grim ice
#

Please know how to use q&a

ivory sleet
#

Bump it relevantly then

limber perch
#

I dont know how to reset an arena

grim ice
#

You don't just say, how do I reset an arena in my plugin

#

Bro

ivory sleet
#

Well can you contextualize your issue a bit?

#

There’s only so much to go on

limber perch
#

I elaborated on 'I dont know how to reset an arena' last night, yet no one answered

#

i'll do it again

#

so basically

grim ice
#

You can create new dimensions every time an arena gets created.

ancient plank
#

Explanation 100

limber perch
#

I have strikepractice installed, but I dont know how to create a code/addon to strikepractice, so whenever someone loses/wins a duel the arena resets for the next duel

#

if you know what im saying

grim ice
#

Isn't that how to use a library?

#

If it's using a library then go to their support section

quaint mantle
low marten
#

I'm having an odd issue with my gradle tasks.. it all started when I added the following to my build.gradle

    // in repositories
    flatDir {
        dirs 'libs'
    }

    // in dependencies
    implementation name: 'SomeLocalAPI'

The error report:
Entry META-INF/maven/com.zaxxer/HikariCP/pom.properties is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.1/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
Here is my jar task:

jar {
    from {
        configurations.runtimeClasspath.collect {
            it.isDirectory() ? it : zipTree(it)
        }
    }
    destinationDirectory = file("$rootDir/build/libs")
    archivesBaseName = project.name
}

It compiled just fine with Hikari before but now it doesn't compile for some reason

floral pier
limber perch
grim ice
#

@floral pier the plugin is loading before the dependency maybe

gray comet
grim ice
quaint mantle
# floral pier Indeed

not sure if this would help then but try using maven or gradle to add the api instead of just directly adding the jar

limber perch
#

my question sorry

#

im dumb

ivory sleet
#

No worries

low marten
ivory sleet
floral pier
grim ice
limber perch
ivory sleet
floral pier
grim ice
limber perch
#

whoops

floral pier
#

@grim ice I'll give it a shot and let you know the result

grim ice
#

Alright

#

And show me the code

low marten
peak granite
#

how do i check if line number of lore is set

ivory sleet
#

That has nothing to do with gradle?

low marten
#

this worked before I added my dependencies 😂

#

Am I including them in a wrong way?

ivory sleet
#

I mean that just looks like you’ve passed a bad input to some sql dependency of yours

low marten
#

I once had a problem where my plugin tried creating a spigot server within the plugin itself

#

Am I not excluding things correctly

ivory sleet
#

lol

low marten
#

xd

#

trust me

ivory sleet
#

Did you shade spigot?

red sedge
#

How can I remove all potion effects from player

low marten
#

im doing it the right way now lol

peak granite
red sedge
#

thank you!

floral pier
#

Dependent

public class Main extends JavaPlugin
{
    Plugin powerMiner = null;

    @Override
    public void onEnable()
    {
        PluginManager manager = Bukkit.getPluginManager();
        Plugin plugin = this;

        BukkitScheduler delay = Bukkit.getScheduler();
        delay.scheduleSyncDelayedTask(plugin, new Runnable()
        {
            @Override
            public void run()
            {
                powerMiner = JavaPlugin.getPlugin(PowerMiner.Main.class);
                //if(!manager.isPluginEnabled(powerMiner)) manager.disablePlugin(this);

                ServerDataInfo.setServerPluginInfo(plugin, powerMiner);
            }
        }, 2400L);
    }

    @Override
    public void onDisable() {}
}

@grim ice

low marten
#

god i hate it when people call their main class "Main"

ivory sleet
#

Something like PluginMain would be better

low marten
#

Or hb

#

PowerMiner

hybrid spoke
#

Main is fine

low marten
#

xD

hybrid spoke
#

but most people dont like it

#

since a plugin is an addon

#

and main is mostly used for standalone software

low marten
#

Not the main

#

fr

peak granite
ivory sleet
low marten
#

?

ivory sleet
#

But Ig it’s inconvenient since you can only import one class named exactly Main

peak granite
#

i'm trying to create a command /removelore <line number> and i want to see if the number they specified exists on the lore

peak granite
#

thanks

low marten
#

if the # they put in is less than or equal to the length of the lore, then it is set

#

if not, it would be out of bounds

ivory sleet
#

Btw you might wanna use the shadowJar gradle plugin for shading and stuff

low marten
#

never learned how

#

ill look into it

floral pier
ivory sleet
#

Sure thing

low marten
#

¯_(ツ)_/¯

#

just my 2 cents

#

keep naming it main and nobody will care lol

#

😄

ivory sleet
#

KCWCJ yeah it’s good keeping those internals internally

peak granite
#

how would i remove line x of an item

paper viper
#

I’m here

#

I will send my thread

ivory sleet
paper viper
low marten
#

lmao thanks for the needed thread we didnt have before

ancient plank
#

0 1 2 3, size of 4

noble lantern
#

Would anyone know why Citizens2 API says that the NPC#getEntity() is always a null entity?

I am loading my things that use Citizens after CitizensEnableEvent (When citizens logs how many npcs is loaded)

I tried checking if isSpawned() was true, it wasnt, i tried spawning the NPC it failed, however when you login to the game the npc is just fine?

#

Do i need to be calling my enable methods another tick after the CitizensEnableEvent?

ivory sleet
#

Always null?

noble lantern
#

Pretty much

stone sinew
noble lantern
#

Code im using to get NPC's ^

ivory sleet
#

Hmm I believe npcs aren’t always spawned? Like someone must be loading the chunk in order for them to be physically spawned maybe?

noble lantern
ivory sleet
#

Yeah could have

stone sinew
noble lantern
#

Yeah, the NPC from citizens is fine, its just the actual Entity

low marten
#

bro

#

wtf

#

conclure

noble lantern
#

Citizens API is always weird asf

chrome beacon
#

Not really

ivory sleet
low marten
#

when i print out it like this:

jar {
    from {
        duplicatesStrategy = DuplicatesStrategy.EXCLUDE
        configurations.runtimeClasspath.collect {
            System.out.println(it.name)
            it.isDirectory() ? it : zipTree(it)
        }
    }
    destinationDirectory = file("$rootDir/build/libs")
    archivesBaseName = project.name
}

it prints:

slf4j-simple-1.6.4.jar
slf4j-api-1.7.30.jar
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE

> Task :jar
HikariCP-4.0.3.jar
slf4j-simple-1.6.4.jar
slf4j-api-1.7.30.jar
HikariCP-4.0.3.jar
slf4j-simple-1.6.4.jar
slf4j-api-1.7.30.jar
HikariCP-4.0.3.jar
slf4j-simple-1.6.4.jar
slf4j-api-1.7.30.jar
HikariCP-4.0.3.jar
slf4j-simple-1.6.4.jar
slf4j-api-1.7.30.jar
#

bruh

ivory sleet
#

I don’t know what you’re trying to do

low marten
#

compile a mf plugin 😂

ivory sleet
#

But use shadowJar my buddy

low marten
#

aight

ivory sleet
#

Also if you have the effort, switch to kotlin dsl

young knoll
#

Does the NPC entity ever exist?

#

I thought they were all client side

full holly
noble lantern
#

Im gonna load the configs on NPC spawn

chrome beacon
waxen plinth
#

I have seen that happen because of viaversion for people running 1.8 on a 1.16 server

noble lantern
full holly
#

loc.getBlock().setType(Material.AIR);

waxen plinth
noble lantern
#

Wouldnt you normally use the generate chunk event anyways? and generate it off the event?

young knoll
#

?jd

young knoll
#

Take a look at the various methods in said class

young knoll
#

That wasn’t the question

low marten
#

conclure

#

im actually

#

so

#

SO

#

stupid

#

BRO

ancient plank
#

Spammy too huh

low marten
#

my bad

#

you see uh the problem was... everything was working fine, i forgot i changed a plugin name in the plugin.yml and it changed the plugin config folder path meaning it's sql connection details were invalid

waxen plinth
ancient plank
#

Patience young greenhorn

young knoll
fast onyx
#

how i can set a motd with color codes?

#

color codes not working

paper viper
#

cause you need to translate them

fast onyx
#

i guess

paper viper
#

use ChatColor#translateAlternate something like that

fast onyx
#

chatcolors?

#

mmm

eternal oxide
#

&

fast onyx
#

i know that works for messages but for motd idk

tight crow
#

Or §

paper viper
fast onyx
#

lemme try

paper viper
#

do not replace directly to that

#

that leads to many issues

tight crow
#

ikr

ancient plank
#

It works for motd

#

How do you think ppl get colored motds

tight crow
#

if it's linking config, then use it manual code

fast onyx
#

done

misty current
#

i wish u could still make animated motds

fast onyx
#

thanks :D

misty current
#

😦

peak granite
#
        ItemMeta meta = stack.getItemMeta();
        List<String> lore = meta.getLore();
        lore.remove(Integer.parseInt(args[0]));
        meta.setLore(lore);
        player.getItemInHand().setItemMeta(meta);```
command is /removelore <line number>
error below
https://paste.md-5.net/esotajocov.cs
grim ice
noble lantern
#

parseInt throws an exception

#

So you need to handle it

ancient plank
#

Index 3 size 3

misty current
#

no, he's getting index 3

#

in a 3 size list

grim ice
#

if it leaks without spigot translating it then it leads to crashes

noble lantern
#

oh oop

#

6am programming go brrt

ancient plank
#

0 1 2, size 3

#

0 1 2 3, size 4

misty current
#

alisa you should learn java before developing spigot plugins

grim ice
#

I usually just use a method for chatcoloring

misty current
#

indexes start from 0

noble lantern
#

6am programming

peak granite
noble lantern
#

why null 😐

grim ice
#

@peak granite

#

a 3 sized arraylist

#

contains

#

0,1,2

misty current
#

btw i have discovered that minecraft has a packet for when you eat or shoot your bow while mining

grim ice
#

not 0,1,2,3 because that is for a 4 sized one

noble lantern
misty current
#

wdym trigger?

fast onyx
#

how i can put this

#

and a text before

misty current
#

packettt

fast onyx
#

like "Maintenance" and the red X

misty current
#

you need to manipulate pings

fast onyx
misty current
#

unless they've added support for it in ping events, packettttttt

fast onyx
#

example?

misty current
#

or use it

glossy venture
#

all packets

#

I think it may be this one

mortal hare
#

this is the dumbest protocol for entity metadata of minecraft

glossy venture
misty current
glossy venture
#

because there is no way to reference a single bit in memory

mortal hare
#

0000 0001 = pumpkin hat off
0001 0000 = pumpkin hat on

0001 0001 = Pumpkin hat on and off

misty current
#

why not use a boolean

red sedge
mortal hare
fast onyx
glossy venture
#

lmfao

#

try sending that

misty current
#

either use its code or use it as a dependency

#

you decide

fast onyx
#

okay thanks

misty current
#

wait isn't 0x10 0001 0000

mortal hare
#

yea

#

corrected

misty current
#

and 0x02 is 0000 0010

mortal hare
#

but this still makes no sense

misty current
#

ah kk

#

yea lol

#

why tho they call it 0x10 and not 0x16

glossy venture
#

or does that not matter in java

#

jvm

fast onyx
misty current
#

what version are you in?

fast onyx
#

spigot api 1.13

#

plugin version 1.7 to 1.17

misty current
#

no point in using the entire plugin

peak granite
#

how do i gen a random string consisting of A-Z a-z 0-9 (length 7)

misty current
#

wait do you need it to be multiple version compatible?

fast onyx
misty current
#

pingapi supports only from 1.7 to 1.14

#

and it's discontinued

paper viper
hybrid spoke
mortal hare
#

generate random number for each iteration of string character

#

and pick that character via random number index

misty current
peak granite
#

String charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"; what do i do next

smoky oak
#

does not calling the update method after inventory manipulation cause any issues besides desynchronization for the client?

ivory sleet
#

Probably not

misty current
#

depends on what you manipulate

#

iirc setting the result slot of a crafting table requires you to send a refresh

smoky oak
#

Shulker Box inventory

peak granite
#

nvm

calm star
#

when I right click a chest with my custom stick, how can i check and edit the contents of that chest?

manic furnace
#

When i get a player with the name of J, and any players first character in his nametag is J, it gets this player. How can i avoid that?

quaint mantle
peak granite
#

how do i

#

check if an item is unbreakable

ancient plank
#

i think that does what you want

#

never used it myself 🤔

peak granite
#

if(player.getInventory().getItemInHand().isUnbreakable()) { doesn't work

#

if(player.getInventory().getItemInHand().getItemMeta().isUnbreakable()) doesn't work either

#

it's in red

#

:/

quaint mantle
#

^

peak granite
#

how do i see if a player's inv is empty

stone sinew
#

Thats if full

noble lantern
#

Does anyone know how to make a CitizensNPC able to be itneracted with either via API or by a settings?

#

EG: When i right click on a CitizensNPC, i should be able to get the NPC shaking its head at me

stone sinew
#

nope still can't be used for that

hollow bluff
#

Can I stop a server somehow with spigot?

worldly ingot
#

/stop?

#

lol

stone sinew
worldly ingot
#

Oh. API. Yeah. #shutdown() 😛

hollow bluff
#

Thanks!

ivory sleet
#

Yeah just don’t use System::exit banana

peak granite
#

player.removeMetadata("test"); doesn't work

smoky oak
ancient plank
#

I was mindlessly rewriting my discord integration plugin and ended up putting a shutdown hook in instead of using ondisable

worldly ingot
#

You shouldn't need to do this yourself

smoky oak
#

ah

#

is there documentation?

hushed hedge
#

It helps because this error marks the eclipse to the private one to be able to pass the screenshots, someone help me?

chrome beacon
#

Verify to send screenshots

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

worldly ingot
#

You can skip the whole driver registration. The more important bit is establishing a connection with DriverManager.getConnection()

#

Skip, don't skin*

floral pier
#

@grim ice Still no luck.

visual tide
#

1.8 = pain

late sonnet
#

1.8? D:

stone sinew
late sonnet
visual tide
#

anything that isnt 1.14 - 1.17 = pain

peak granite
#

true true

#

thanks

grim ice
#

I Don't really know then

#

because

#

majority of pvp before dream and the other kids went too famous

visual tide
#

basically every pvp server runs it

grim ice
#

was 1.8

stone sinew
hushed hedge
#

@chrome beacon

peak granite
#

no

#

don't use eclipse

#

pls

#

and why are u on windows 7

visual tide
#

^^

stone sinew
peak granite
#

😭

#

intellij is better

#

much more user friendly

stone sinew
ancient plank
#

they both have their pros and cons

visual tide
#

the ide is not the issue
the os is
no more security patches for win7

peak granite
#

"i like men"

hushed hedge
#

Any solucion?

peak granite
#

nice

west oxide
#

👀

hushed hedge
#

Any solution?

peak granite
#

someone just said that

#

and they

west oxide
#

yeah wonder who

peak granite
#

deleted their message

west oxide
#

o.o

stone sinew
visual tide
#

^

ancient plank
#

i only moved to intellij because when i used eclipse it didn't have inbuilt maven support, and it wouldn't let me install the maven plugin for one reason or another, mostly user error

ivory sleet
# stone sinew

With that being said, you should still give other tools a chance and not neglect an impartial judgement.

late sonnet
#

i only remember move from netbeans to intellij many time ago... xd

worldly ingot
stone sinew
#

I don't use intellij cause it gives me constant errors for no reason. So I just use it to export plugins to eclipse xD

ancient plank
#

thats some old ass ui design

#

unless they use some 3rd party software to change it

peak granite
#

no

#

that design exists

#

on 7

ancient plank
#

oh wtf there is that's gross

hushed hedge
#

w

#

So what should I do so that the eclipse lets me give that error?

worldly ingot
#

curious what version of Eclipse you're on

#

I've never seen that error in my life

fast onyx
#

How I can open a menu with 27 slots and add items?

worldly ingot
#

Bukkit#createInventory() is your friend

fast onyx
#

Ty

mortal hare
hushed hedge
mortal hare
#

I've seen applications on windows 10 that run under windows 7 basic theme

hushed hedge
#

@worldly ingot

worldly ingot
#

4.9 SDK? Why does that sound... old

ancient plank
worldly ingot
#

*goes to check my version*

#

my guy

fast onyx
paper viper
#

for custom heads, use skullcreator

#

or something

ancient plank
hushed hedge
#

what should I do?

worldly ingot
#

Probably well before that

mortal hare
paper viper
peak granite
#

how would i return true; if shooter in ProjectileHitEvent isn't a player

#

(1.8)

paper viper
#

ew

ancient plank
#

in recent versions getEntity returns a Projectile object, which you can check the Shooter then checking if its an instance of player :)

fast onyx
#

Material.?

paper viper
#

you should get an itemstack

peak granite
#

thanks

paper viper
#

check the methods of inventory

warm crane
#

heyo quick question idk if anyone can help me with that
but is there any update on how fast spigot would be available for 1.18? will it take a couple days/weeks or the same day?

stone sinew
#

?eta

undone axleBOT
#

There is no ETA. Having an ETA leads to unrealistic deadlines, false hope, and a bad product. It will be ready when it's ready.

warm crane
#

ah alright thx^^

stone sinew
#

There are pre updates out if you want to try those

ancient plank
#

just check the server every now and then after release, there'll be a post in #announcements by md_5 when it does eventually come out

warm crane
#

well rn im trying to make a server with an 1.18 map on a 1.17 server but i tried to make a 1.18pre map but that didnt work on the 1.17 server
so rn i kinda have to figure something out to get a 1.18 map thats 10kx10k prerendered and that works on a 1.17 server
and since i wanted to use some plugins that wouldnt work without spigot when 1.18 releases on the 30.

stone sinew
#

1.18 won't work on 1.17 servers

#

I'll be surprised if viaversion even updates for this version.

warm crane
#

thats the thing theres a German minecraft vanilla project that has a 1.18 map working on a 1.17 server so somehow it does work but i have no idea how xD

visual tide
#

maybe the old 1.18 datapacks

warm crane
#

ye someone told me its 1.18 experimental snapshot 7 with the datapack but that just confused me and i have no idea how that works

ancient plank
warm crane
#

ah alright my bad

smoky oak
#

how to save a baked in config to the drive again?

sharp bough
smoky oak
#

i looked it up but it only says how to save the default config

ivory sleet
#

well whats a baked in config?

smoky oak
#

baked in config

#

like

#

you know

eternal night
#

presumably one inside the jar file

smoky oak
#

config.yml

ivory sleet
#

oh

smoky oak
#

the issue is the only thing I've found is how to a) write configs using code and how to b) save config.yml

#

neither is really something viable

fast onyx
#

The way on the title are sended is the same on 1.8 and 1.17?

#

#sendTitle() for all versions?

quaint mantle
#

welp, the sendtitle will work for every version has it

#

but the function in sendtitle is different each version

fast onyx
#

Weird

#

How I can send the title if my plugin is multiversion?

eternal night
#

you still use the API ?

fast onyx
#

Spigot API 1.13, yes

eternal night
#

I mean, then what is the issue

fast onyx
#

My plugin is 1.7-1.17