#help-development

1 messages · Page 1639 of 1

regal moat
#

i have a EntityFallingBlock, and i need to get the material out of it
but that returns net.minecraft.world.level.material.Material
and not org.bukkit.Material
i need the material because i need to summon another falling block

rigid otter
#

Yes, show fine

eternal oxide
#

Then I see no reason for you to be having an issue. You could invalidate caches and restart

rigid otter
#

Wait

#

but

#

Error when apply that javadoc

eternal oxide
#

what error?

lost matrix
#

Example for Consumer<T> being used to delegate a functionality to a new thread:

  @Override
  public void onEnable() {
    applyToConfigAsync(new File("test.yml"), config -> {
      config.set("TestKey", "TestValue");
    });
  }

  public void applyToConfigAsync(final File configFile, final Consumer<YamlConfiguration> configConsumer) {
    CompletableFuture.runAsync(() -> {
      final YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
      configConsumer.accept(configuration);
      try {
        configuration.save(configFile);
      } catch (final IOException e) {
        e.printStackTrace();
      }
    });
  }
eternal oxide
#

I'm using those exact same dependencies here with zero issues

rigid otter
quaint mantle
#

@lost matrix, help please

lost matrix
lost matrix
#

Its a helper class to manage a players experience

quaint mantle
#

Okay, I'll take a look, thank you very much

barren granite
#

So, I'm trying to make it so that when a player clicks on a block in a GUI, they get $10. I'm using Vault for the economy API stuff. I tried the following bit of code: https://paste.md-5.net/conewulufu.cs

It gets a red line under it. How can I fix that?

rigid otter
barren granite
#

the eco.bankDeposit(player, 10);

#

more specifically, the bankDeposit part

lost matrix
barren granite
#

The method bankDeposit(String, double) in the type Economy is not applicable for the arguments (Player, int)

lost matrix
#

Wrong arguments then. Look up the method and check what argument types it takes.

eternal oxide
fluid cypress
eternal oxide
rigid otter
#

I'll try

lost matrix
rigid otter
#

It has error on javadoc dependency

eternal oxide
fluid cypress
rigid otter
#

Bruh

eternal oxide
#

The last thing I've found googling change <type>javadoc</type> to <classifier>javadoc</classifier>

#

No clue if it will work as type is teh default to use for specifying javadocs

rigid otter
#

Ok, I'll do it

opal juniper
eternal oxide
opal juniper
lost matrix
# fluid cypress so CompletableFutures are from the Future API?

Yes. Stream API and Future API.
Here is an (ugly) example of how to chain functions to run async and sync after another.

    final File configFile = new File("test.yml");
    // Load config async
    CompletableFuture.supplyAsync(() -> YamlConfiguration.loadConfiguration(configFile))
        // Do some stuff afterwards (still async)
        .thenApply((yml) -> {
          yml.set("Test.Key.One", "ValueOne");
          yml.set("Test.Key.Two", "ValueTwo");
          return yml;
        // Do more stuff afterwards (still async)
        }).thenApply(yml -> {
          // Do some stuff that can only be done on the main thread
          final Future<YamlConfiguration> syncFuture = Bukkit.getScheduler().callSyncMethod(this, () -> {
            this.getSomeData().load(yml);
            return yml;
          });
          // Block this thread until the main thread is done with the method
          try {
            syncFuture.get();
          } catch (final InterruptedException | ExecutionException e) {
            e.printStackTrace();
          }
          return yml;
        // Do the rest async again
        }).thenAccept(yml -> {
          try {
            yml.save(configFile);
          } catch (final IOException e) {
            e.printStackTrace();
          }
        });
eternal oxide
opal juniper
#

i really hate the ui

eternal oxide
#

I saw that

opal juniper
#

hahahaha

crimson terrace
#

hey, Im making a plugin and wanted to ask if it affects performance much to run a RepeatingTask for the duration of the instance which checks something every 5 or 6 seconds.

rigid otter
crimson terrace
#

wether or not the player is standing on a block to remove a NoFallDamage ScoreboardTag

eternal oxide
#

Not that heavy then

#

less than watching the move event

lost matrix
crimson terrace
eternal oxide
#

run it Async as data reads are mostly ok from loaded chunks.

#

as you are getting the block below a player you know the chunk will be loaded

crimson terrace
#

alright, thanks for your help 🙂 was worried that there would be lots of problems on bigger servers

lost matrix
crimson terrace
#

not sure what you mean by async, would you kindly explain?

eternal oxide
#

most tasks run sync with the main server thread.

lost matrix
#

You might get a problem if you bulk check every player with a fixed delay of N ticks

eternal oxide
#

so anythign you do in yoru task makes the server wait for yoru task to finish

#

running tasks async they run in parallel with the main thread, so will not make it wait

crimson terrace
#

oh so basically offset the tasks so they will never overlap?

eternal oxide
#

no

crimson terrace
#

ok I will look into it then. thanks for the idea 😄

fluid cypress
#

if i extend from the Location class, how can i directly modify its x, y and z values? they are private. if i create my own xyz properties, they will be used instead when casting back to Location?

eternal oxide
#

don't extend location

#

create your own class that can return a location when you need

fluid cypress
#

casting to Location looks prettier

#

is that a bad idea?

hybrid spoke
#

yes

eternal oxide
#

.toLocation() is cleaner

#

Why are you wanting to extend Location?

fluid cypress
#

bc im just adding some stuff that i need related to locations

eternal oxide
#

if they are not already in Location then odds are they don;t belong there

fluid cypress
#

ofc, theyre just specific to this plugin

hybrid spoke
#

just wrap your location and your custom stuff into a new class

eternal oxide
#

Probably better to create a Utility class

signal atlas
#

hi guys who can help me ? i got this error when i try to commit and push a project. (eclipse ide )

signal atlas
#

it's not a private repository, its public

eternal oxide
#

Its not public for anyone to push to

whole stag
#

It's also a completely empty repo, so there's not anything to push to

signal atlas
#

https://www.youtube.com/watch?v=LPT7v69guVY i watched this video and I followed all the steps but not work

Free Courses - https://automationstepbystep.com/
Today we will learn:

  1. How to create github repository
  2. How to clone repository in eclipse
  3. How to add eclipse project to github repository
  4. How to commit, push and pull the changes

Step 1 : Create GitHub account and SignIn

Step 2 : Start a Project = Create a repository

Step 3 : Start Ec...

▶ Play video
regal moat
#

i used #setVelocity

lost matrix
lost matrix
regal moat
#

with the same blockdata

#

its a normal falling block

#

FallingBlock

#

@lost matrix

#

...

tardy delta
#

worst code made ever

public PrefixGui(Player p) {
        super("Prefix", 6);
        if (LP.getPlayerGroups(p) != null) {
            for (int i = 0; i < LP.getPlayerGroups(p).size(); i++) {
                List<String> prefix = LP.getPlayerGroups(p);
                if (!(prefix == null || prefix.isEmpty())) {
                    int finalI = i;
                    setItem(0, createItem(Material.OAK_SIGN, Utils.colorize(LP.loadPrefixes(p).get(prefix.get(i))) , null), player 
                            -> Main.api.getUserManager().getUser(p.getUniqueId()).setPrimaryGroup(LP.getPlayerGroups(p).get(finalI)));
                }
            }
        }
    }
whole stag
#

!(prefix == null || prefix.isEmpty()) 😬

#

de Morgan's law. Learn it folks

#

prefix != null && !prefix.isEmpty()

unique halo
#

how do i stop players from taking items from an armorstand

hybrid spoke
tidal socket
#

Hi, after some tests about plugins in minecraft I had a doubt: how should be done in case of multiple gui to pass any parameters (without interfering with simultaneous use by other players)?

silver shuttle
#
                while (resultSet.next()) {
                    int karma = resultSet.getInt("karma") - 1;
                    int id = resultSet.getInt("id");
                    statement.executeUpdate("UPDATE xpunishments_playerdata SET karma = \"" + karma + "\" WHERE id = \"" + id + "\";");
                }

How do I prevent this from giving Operation not allowed after ResultSet closed?

eternal oxide
tardy delta
#

if i want to give the player names as tabcomplete is returning a new arraylist good or do i need null?

tidal socket
eternal oxide
#

If your GUI is static then you can use one for all players.

regal moat
#

i cant launch a falling block
i used #setVelocity

tidal socket
eternal oxide
#

as I said, if your GUI is static you only need one GUI for all players.

#

all click events have the Player thats clicking

tidal socket
silver shuttle
#
                while (resultSet.next()) {
                    int karma = resultSet.getInt("karma") - 1;
                    int id = resultSet.getInt("id");
                    statement.executeUpdate("UPDATE xpunishments_playerdata SET karma = \"" + karma + "\" WHERE id = \"" + id + "\";");
                }

How do I prevent this from giving Operation not allowed after ResultSet closed?

#

Like, why is it slosing the ResultSet?

eternal oxide
#

As soon as you execute yoru second query yoru resultset is closed

unique halo
#

when a player right clicks an armor stand, playerinteractionevent isn't called, is this suppose to happen

silver shuttle
eternal oxide
#

use a separate statement

silver shuttle
#

oh i just change the statement

#

ok

#

thanks a lot

main dew
#

how to turn off the physics of blocks such as gravel and sand?
spoiler BlockPhysicsEvent don't work

regal moat
#

How can I launch a falling Block at the direction the player is looking?

regal moat
#

use blockplaceevent

#

get the block

#

wait no

#

dskjflksdfjsd

regal moat
main dew
#
public class Main extends JavaPlugin implements Listener {
    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void physicsDisable(BlockPhysicsEvent e) {
        System.out.println("WORK");
        e.setCancelled(true);
    }
}```
eternal oxide
main dew
#

this is perfect idea but how?

crimson terrace
#

cant you give them some sort of nbttag for that? (not that i know how, I just read about it somewhere)

regal moat
# main dew this is perfect idea but how?
    @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
    private void onSandFall(EntityChangeBlockEvent event){
        if(event.getEntityType() == EntityType.FALLING_BLOCK && event.getTo() == Material.AIR) {
            event.setCancelled(true);
            event.getBlock().getState().update(false, false);
        }
    }
#

like this

main dew
regal moat
#

what

main dew
#

.

quaint mantle
#

hello, anyone know how i can see performances of my plugin ? With spark ? (timings, lag impact...)

regal moat
#

How can I launch a falling Block at the direction the player is looking?

quaint mantle
main dew
#

realy give me link

quaint mantle
main dew
#

name your plugin?

quaint mantle
#

WSS

main dew
#

sorry but I don't know how good read paper timings

main dew
regal moat
#

uh

main dew
#

and FallingBlock#setDirection

#

sorrry no

main dew
signal atlas
# eternal oxide Github now uses auth tokens

what should i do ? i watched almost 10 video and they are same like this video https://www.youtube.com/watch?v=LPT7v69guVY&t=1s

Free Courses - https://automationstepbystep.com/
Today we will learn:

  1. How to create github repository
  2. How to clone repository in eclipse
  3. How to add eclipse project to github repository
  4. How to commit, push and pull the changes

Step 1 : Create GitHub account and SignIn

Step 2 : Start a Project = Create a repository

Step 3 : Start Ec...

▶ Play video
compact creek
#

how do i get the name of an EntityType?

quaint mantle
#

read the doc

#

rtfm

compact creek
#

getName is deprecated

tame coral
#

Pretty sure toString works

wary harness
#

So I got a problem players can take items from my gui shop by spamming shift+left click for example
and then exiting from it with E
should add delay to solw that or is there some other way

#

?

toxic mesa
#

So i've got some question about protocollib, I've got this so far which should be triggered when an entity moves. Can anyone explain to me why event#getPlayer#getName always returns my own player? I Am alone in the server so I don't know if that plays a role. It's still strange to me why even if I do not move it still broadcasts my name multiple times a second.

        ProtocolManager protocolManager = mainPlugin.getProtocol();
        protocolManager.addPacketListener(new PacketAdapter(mainPlugin,
                ListenerPriority.NORMAL, 
                PacketType.Play.Server.REL_ENTITY_MOVE) {
            @Override
            public void onPacketSending(PacketEvent event) {
                if (event.getPacketType() == PacketType.Play.Server.REL_ENTITY_MOVE) {
                    PacketContainer packet = event.getPacket();
                    Bukkit.broadcastMessage(event.getPlayer().getName());
                }
            }
        });

I should be able to get the deltaX, Y and Z of the entity position, how would I do that?

wary harness
#

from some reason weird

#

just tested

toxic mesa
#

Possible but that would still be weird, it'd be more logical to give the entity sending the packets instead of recieving them right?

#

At least that'd be my logic lol

#

Correct

#

Wait I can test this by just leaving and looking at the console

#

Ye fair

#

Yup can confirm

#

The broadcasts stop when leaving

shell dove
#

How can i reference element from one public void into another?

echo basalt
toxic mesa
echo basalt
chrome beacon
#

?learnjava You really should learn Java basics before starting with Spigot

undone axleBOT
shell dove
#

I cant put it outside

#

I will provide code wait a second

chrome beacon
#

Then pass it along

shell dove
#

public final class Credit extends JavaPlugin {

private Map<Player, Player> fireballHits;

@EventHandler
public void onProjectileLaunch(ProjectileLaunchEvent event){
    Projectile snowball = event.getEntity();
    ProjectileSource shooter2 = snowball.getShooter();
}

@EventHandler
public void onProjectileHit(ProjectileHitEvent event) {
    if(event.getEntityType() != EntityType.FIREBALL) return;
    if(!(event.getEntity().getShooter() instanceof Player)) return;
    if(!(event.getHitEntity() instanceof Player)) return;
    // remember this action
    fireballHits.put((Player)event.getHitEntity(), (Player)event.getEntity().setShooter(shooter2));
}

@EventHandler
public void onPlayerDeath(EntityDamageEvent event) {
    if(event.getEntityType() != EntityType.PLAYER) return;
    if(event.getCause() != EntityDamageEvent.DamageCause.VOID) return;
    if(!event.getEntity().isDead()) return;

    final Player player = (Player)event.getEntity();

    if(fireballHits.containsKey(player)) {
        Player shooter = fireballHits.get(player);
    }
}

@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
    fireballHits.remove(event.getEntity());
}

}

#

i need shooter2 referenced from onProjectileLaunch to onProjectileHit

eternal oxide
#

Thats not how you do it

#

you get teh Projectile and from that you getShooter()

chrome beacon
#

?paste Please ;/

undone axleBOT
shell dove
#

I will explain why is this the code. I code datapacks, and i made auto launch fireballs using snowballs. When snowball is launched it summon fireball with motion of where player is looking, and it countinue moving, while snowball get killed. Thats why i need to set snowball shooter as fireball shooter

rotund pond
#

Hello !
Does anyone know why this is deprecated ?
I'm wondering why this method is deprecated but the same method with a Runnable instead of a BukkitRennable is not deprecated 🤷‍♂️

shell dove
eternal oxide
#

At no point are you creating a fireball

#

you also do nothing with teh snowball and assume it is a snowball

shell dove
#

I just want to reference it. Is there way to do it or no?

eternal oxide
#

From what you have posted you have no working code

shell dove
#

fireballHits.put((Player)event.getHitEntity(), (Player)event.getEntity().setShooter(shooter2));
i need shooter2 to work here

eternal oxide
#

You can set the shooter on the snowball, but also no need to spawn a fireball, just set the item for the snowball

shell dove
#

Set item for snowball?

eternal oxide
#

setItem

#

seems only legacy fireballs still exist

#

ok, where are you spawning your fireball?

shell dove
#

Code is for giving credit to player who killed another player with fireball

#

I spawn fireball next to snowball when its launched

eternal oxide
#

I'd assume you would spawn it in the projectile launch event for the snowball

shell dove
#

I coded that in datapack(fireball launcher)

eternal oxide
#

then take the shooter from the snowball and put it on the fireball

shell dove
#

I want that but they are in diffirent voids

eternal oxide
#

you mean methods?

shell dove
#

Yes

#

I cant use shooter2 in onProjectileLaunch

eternal oxide
#

why can you not get the snowball when you spawn the fireball?

shell dove
#

Can i somehow use shooter2 in onProjectileLaunch

eternal oxide
#

That depends on HOW you are spawning the fireball

shell dove
#

When i launch snowball shooter2 get player who launched it, but when fireball hit player i want to assign shooter2 to fireballhits

#

look at code

eternal oxide
#

You have still not shown or told HOW you launch the fireball

shell dove
#

in datapack using motion

#

so it doesnt have shooter

eternal oxide
#

yeah, datapacks

shell dove
#

just tell me how can i reference it please

eternal oxide
#

As far as I know there is no interface between spigot and datapacks

shell dove
#

no i mean how to reference it
@EventHandler
public void onProjectileLaunch(ProjectileLaunchEvent event){
Projectile snowball = event.getEntity();
ProjectileSource shooter2 = snowball.getShooter();
}

@EventHandler
public void onProjectileHit(ProjectileHitEvent event) {
    if(event.getEntityType() != EntityType.FIREBALL) return;
    if(!(event.getEntity().getShooter() instanceof Player)) return;
    if(!(event.getHitEntity() instanceof Player)) return;
    // remember this action
    fireballHits.put((Player)event.getHitEntity(), (Player)event.getEntity().setShooter(shooter2));
}

from onProjectileLaunch to onProjectileHIt

eternal oxide
#

IF your fireball triggers a projectile launch event then you can do it.

#

You are creating your fireball through a datapack, so the only way to interact with it is if it triggers a spigot event

shell dove
#

It triggers it when it hit a player

eternal oxide
#

I'd assume it would trigger a projectile launch event

#

SPAWN not hit

#

it has to be created as an entity

#

So test what event fires when teh fireball spawns

#

I'd assume a projectile launch, but it could just be an entity spawn

shell dove
#

Just tell me how to reference it form one method into another

eternal oxide
#

You haven't given enough information to give you an answer

#

I told you where to look

#

check those two events to see where your fireball is created

#

By the time your fireball hits the snowball will no longer exist.

#

You have to get your fireball when it spawns and transfer the data

shell dove
#

I have shooter of snowball i just need to asign it to fireball when it hits a player

eternal oxide
#

Can't be done like that

shell dove
#

You can see my code

#

I just need to reference it no need for other questions, like someone said thats involved into java not spigot necessery

eternal oxide
#

It can't be done like that, and if you will not listen I can't help you.

shell dove
#

What do you want from me

eternal oxide
#

You have to transfer the shooter data from the snowball to the fireball when it spawns. That is the only time they will be in the exact same place for you to know what snowball triggered which fireball.

#

You have no other way to connect them, and by the time the fireball hits there will be no snowball to read the data from

#

You need to see which event triggers when your fireball spawns

shell dove
#

I just use summon fireball

eternal oxide
#

You need to see which SPIGOT event triggers when the fireball spawns

#

either ProjectileLaunchEvent or EntitySpawnEvent

#

one of those will trigger when your fireball spawns

#

sysout the projectile to see what triggers

#

you should see a snowball first, then a fireball

#

let me know if you do

hybrid spoke
#

what would be a good exception if somebody uses something they are not supposed to use?

#

thinking of Unsupported

#

but idrk

shell dove
#

i see first snowball then fireball so its probably entityspawn event

eternal oxide
#

probably?

#

add some debug code to projectile launch event to see

shell dove
#

idk how i dont code plugins

eternal oxide
#

ok, well the thing you want can be done, but not without java knowledge. Its not a really difficult thing but its a little complex.

quaint mantle
shell dove
#

ElgarL can you maybe finish code for me?

quaint mantle
#

There is for how to use the api itself but not how to actually get it

silver shuttle
#

How do you essentially reload the config ?

#

just calling plugin#getConfig() again on my FileConfiguration?

ivory sleet
#

probably FileConfiguration#load(InputStream) if I am right

silver shuttle
#

yours doesnt exist but i found this instead

quaint mantle
#

thats the default config.yml

silver shuttle
#

yeah sorry I didnt specify, I meant the default config

quaint mantle
silver shuttle
#

I dont change anything so I am fine with reload

#

the config file is left unchanged by the plugin

#

but if a human changed something in it and decides to reload the plugin i need it

regal lake
#

Is there a way to get all mobs which has a target to a play without tracking it myself or go through mobs in a radius of the player ?

quaint mantle
#

?jd

silver shuttle
#

he means if theres a way without looping through all mobs

quaint mantle
#

no that would be a horrible code flaw and cause memory issues

regal lake
#

Yea i already found that, but for that method i have to get all mobs in a radius of the player and then check the target which could be inperformant i guess.
So i asked if there is maybe a other way for that.

silver shuttle
#

like Player.getTargettedBy() which should return a list of mob uuid's but that doesnt exist

quaint mantle
#

no that would be a horrible code flaw and cause memory issues

#

loop

silver shuttle
#

😂

regal lake
#

Oh okay if there is no other way, i have to use getNearbyEntities​ and have to read/learn how the Predicate works, thanks.

#

Oh okay, looks quite easy

quaint mantle
#
mob -> (mob instanceof Mob) && ((Mob) mob).getTarget().equals(player)
eternal oxide
#

that could explode if there is no target

#
player.getWorld().getNearbyEntities(player.getLocation(), 5, 5, 5, mob -> (mob instanceof Mob) && ((Mob) mob).getTarget().equals(player));```
#

mine could too. test for null 😛

ivory sleet
#

lambda 😄

eternal oxide
#

true

eternal oxide
#

yep

#

Hid my ineptitude 🙂

ivory sleet
torn oyster
#

how would i turn
UUID,WINS,LOSSES,WINSTREAK
into
?,?,?,?
most efficiently

chrome beacon
#

SQL?

torn oyster
#

well yes

#

but i want to change it

#

to that

ivory sleet
#

I mean

torn oyster
#
                StringBuilder questionMarks = new StringBuilder();
                List<String> columns = Arrays.stream(SqlSetup.columns.split(",")).toList();
                for (String s : columns) {
                    questionMarks.append('?');
                    if (!columns.get(columns.size() - 1).equals(s)) {
                        questionMarks.append(",");
                    }
                }```
that's how im doing it rn
but i think its really inefficient and/or there is a better way
silver shuttle
#

Config:

date-format: "yyyy MM dd HH:mm:ss z"

Code:

public static SimpleDateFormat dateformatter;
dateformatter = new SimpleDateFormat(config.getString("date-format"));
dateformatter.setTimeZone(timeZone);
String date = dateformatter.format(unix * 1000L);

With this code, the format of the displayed date should change, but it doesn't, displaying yyyy-MM-dd HH:mm:ss z
What do I need to change?

torn oyster
#

idek if it works

quaint mantle
torn oyster
#

String questionMarks = columns.replace("([a-Z]+)", "?");

#

lmfao

#

its prob so wrong

quaint mantle
#

replaceAll

#

and A-Z

torn oyster
#

String questionMarks = columns.replaceAll("([A-Z]+)", "?");

#

right?

quaint mantle
#

mhm

torn oyster
#

aight ty

#
                for(int i = 1; i < questionMarks.split(",").length; ++i) {
                    insert.setInt(i + 1, 0);
                }```
#

now

#

if i had 4 question marks

#

would it set the 2nd, 3rd and 4th to 0

#

or is that not how that will work

quaint mantle
#

i think your loop is messed up

#

that will start at 2

#

then set 3

#

to 0

torn oyster
#

oh

#

wait will it set the 3rd, 4th and 5th?

quaint mantle
#

yeah but why

torn oyster
#

i want the 2nd 3rd 4th

quaint mantle
#

this should be hardcoded

#

not looped

torn oyster
#

because sometimes there is more than 4

#

if there is 5

#

i want the 2nd, 3rd, 4th and 5th to be 0

#

etc.

quaint mantle
torn oyster
vague cypress
#

How do you properly make a command that has multiple arguments(ex. /game start, /game end)? I tried using a case switch and it's telling me the command is incomplete when I use an argument.

Using Minecraft 1.16.5

#

                case 1:
                    if (args[0].equalsIgnoreCase("start")) {
                        plugin.tag.tagged(plugin.tag.pickFirstIt());

                    return true;
                    }
                    if (args[0].equalsIgnoreCase("end")) {
                        plugin.tag.end();

                        return true;
                    }
                default:
                    player.sendMessage(ChatColor.ITALIC + "" + ChatColor.RED + "Incorrect!" + ChatColor.WHITE + " Try /tag <start/end>");
            }

            return true;```
quaint mantle
#

come back

#

then remember how java works

quaint mantle
vague cypress
#

I changed it to

                        plugin.tag.tagged(plugin.tag.pickFirstIt());

                    }
                    else if (args[0].equalsIgnoreCase("end")) {
                        plugin.tag.end();

                    } else {
                        player.sendMessage(ChatColor.ITALIC + "" + ChatColor.RED + "Incorrect!" + ChatColor.WHITE + " Try /tag <start/end>");

                    }

        }
        sender.sendMessage(ChatColor.WHITE + "You can" + ChatColor.ITALIC + "" + ChatColor.RED + " NOT" + ChatColor.WHITE + " use that command!");```

And it's still telling me Unknown or Incomplete command
silver shuttle
#
list:
  example:
    description: "This is an example"
    '0': "example sub 0"
    '1': "example sub 1"
    '2': "example sub 2"
  example2:
    description: "This is an example 2"
    '0': "example2 sub 0"
    '1': "example2 sub 1"
    '2': "example2 sub 2"

How would I get a list of all options under "list"?

vague cypress
#

I think so, here's what I have:
this.getCommand("tag").setExecutor(new TagCommand(this));

silver shuttle
#

thanks

vague cypress
#

Anyways, is there anything I might be able to try to fix this?

silver shuttle
#

Config:

date-format: "yyyy MM dd HH:mm:ss z"

Code:

public static SimpleDateFormat dateformatter;
dateformatter = new SimpleDateFormat(config.getString("date-format"));
dateformatter.setTimeZone(timeZone);
String date = dateformatter.format(unix * 1000L);

With this code, the format of the displayed date should change, but it doesn't, displaying yyyy-MM-dd HH:mm:ss z
What do I need to change?

forest shuttle
#

Hi. Can I ask for help here?
On july my account was hijacked and a malicious plugin was uploaded and my account banned.
Recently an admin unbanned me and restored my resource deleting the malicious plugin but then the resource was deleted again (probably a different admin did it).
The reason for deletion was "can't be decompiled at all" but the link to download the resource points to my GitHub page where the releases are and the code for the resource is hosted.
To be clear: The resource isn't obfuscated and I'm not currently banned.
It is okay to ask for help here or should I go to IRC or forums?

ivory sleet
#

?support is probably best

undone axleBOT
forest shuttle
#

Thank you, I'll send an e-mail too then.

wary harness
#

how would I generate player data

#

for player which didn't play before from uuid

#

and get his name

#

?

torn oyster
#

how would i run
setState(MinigameState.PRE_GAME);
when Bukkit.getWorld("world_active");
becomes not null

ivory sleet
#

WorldInitEvent

#

use the reactive event system spigot provides already

torn oyster
#

uhm

#

this is weird

#

Could not call method 'public static org.bukkit.Location org.bukkit.Location.deserialize(java.util.Map)' of class org.bukkit.Location for deserialization
java.lang.IllegalArgumentException: unknown world

#

i know that means the world is null or something

#

but

#

the method is called 1 tick after the world is loaded

torn oyster
#

1 tick after worldinitevent

ivory sleet
#

the configurationserializable might not be registered

peak depot
#

guys any clue what to code

ivory sleet
#

or actually

#

try WorldLoadEvent

ivory sleet
peak depot
#

already did that

ivory sleet
#

but not just a simple user repo

#

create a bank system

#

add bungee support

peak depot
#

like thats the prob i allready did all of that stuff so i dont have any clue what to do i coded for a city build server so also with bungee

ivory sleet
#

add different database types support

peak depot
#

i could do that

#

but i only know maria xD

torn oyster
ivory sleet
#

make it platform compatible with maybe sponge and what not

#

and velocity and fabric and so on

#

lach try scheduling a task after the WorldLoadEvent then

peak depot
#

well just to proof my cooding skills im gona programm a new one

torn oyster
#

1 tick

peak depot
#

give me a name

ivory sleet
#

ConcluresBankCommission

peak depot
#

gimmi a list of what you want

#

ok wich mc version

#

@ivory sleet

ivory sleet
#

1.7-1.17.1

torn oyster
#

well

#

something

#

but

#

not what i want

#

it gave an error

ivory sleet
#

Alright let's see,

  • Bank system
  • Platform extendable
  • Platform independent API
  • Network support (across BungeeCord or Velocity etc), by this I mean live synchronization between servers
  • Database support for MongoDB, MySQL (Would be nice with Postgre and Maria), SQLite, H2, FlatFile (JSON, YAML and TOML)
  • Split storage for the different banks maybe?
  • Language configurable
  • Clean code architecture

Well, that and possibly anything else.

torn oyster
#

@ivory sleet ok wtf is this

#

it says unkown world

#

the world isnt even null

#

have i been scammed

ivory sleet
#

?

#

did u pay for that or what

torn oyster
#

no lol

#

but

#

the world aint null****

ivory sleet
#

yeah

torn oyster
#

and it says unknown world

ivory sleet
#

weird

#

how does the config look

#

or the yaml rather

torn oyster
#

well lets say

#

it worked before i moved the code around

#

but sure

#

?paste

undone axleBOT
torn oyster
ivory sleet
#

how do u get it

torn oyster
#

s is that thingy

ivory sleet
#

no

torn oyster
#
- ==: org.bukkit.Location
  world: world_active
  x: 14.5
  y: 73.0
  z: -28.5
  pitch: 0
  yaw: 90```
#

this

#

that is s

ivory sleet
#

more code

torn oyster
#
            if (plugin.getSpawnsConfig().getList("spawns") != null)
                plugin.getSpawnsConfig().getList("spawns").forEach(s -> spawns.put((Location) s, null));```
stone sinew
torn oyster
#

"unknown world"

#

the world aint null either

stone sinew
#

Are you getting locations before the world is loaded?

torn oyster
#

but idk

#

maybe?

#

im unsure

ivory sleet
#

well where does it fail?

#

the predicate or the code if its true?

torn oyster
#

predicate

stone sinew
torn oyster
#

im getting a list

#

of them

#
spawns:
- ==: org.bukkit.Location
  world: world_active
  x: 0.5
  y: 73.0
  z: 44.5
  pitch: 0
  yaw: -180
- ==: org.bukkit.Location
  world: world_active
  x: 15.5
  y: 73.0
  z: 29.5
  pitch: 0
  yaw: -270
- ==: org.bukkit.Location
  world: world_active
  x: -14.5
  y: 73.0
  z: 29.5
  pitch: 0
  yaw: -90```
#

like that

#

it saved like that

#

it works like that

quaint mantle
#

thats not a list

torn oyster
#

it worked like that

#

until i moved a piece of code around

eternal oxide
#

That is a list

ivory sleet
#

what if u use getMapList("spawns")

#

instead

torn oyster
ivory sleet
#

yeah I mean is the world present with such a name?

quaint mantle
torn oyster
ivory sleet
#

cuz ur code contradicts that very much

#

or the exception does

eternal oxide
#

is it a spigot world or a world from some other plugin?

torn oyster
#

i create the world

#
        WorldCreator wc = new WorldCreator("world_active");
        wc.generator(new VoidChunkGenerator());
        active = wc.createWorld();```
#

thats the code i use

eternal oxide
#

have you manually loaded the world at startup?

torn oyster
#

yes

#

thats the code that runs

#

on startup

eternal oxide
#

so if you sysout Bukkit.getWorld("world_active") in yoru loading code it outputs fine?

torn oyster
#

lets try

quaint mantle
#

hey

#

help please
how do I get experience from players?

hybrid spoke
#

player#getExp

quaint mantle
#

no

quaint mantle
#

help please
how do I get experience from players?
settext () does not work, because this is a school and the maximum number is 0-1

quaint mantle
#

no

hybrid spoke
#

yes.

quaint mantle
#

help please
how do I get experience from players?
settext () does not work, because this is a school and the maximum number is 0-1

set Total Experience ()
does not affect the experience, it is just a score that is shown after death

#

Whut

reef wind
undone axleBOT
reef wind
#

setTotalExperience() sets the xp earned by everything ever.

#

I won’t say more

#

Because you need to google

hybrid spoke
#

or just check what i sent.

#

you want to get the experience?

#

there you got it.

#

but "no".

quaint mantle
#

setTotalExp doesn't work

reef wind
#

omg

#

I just told you

hybrid spoke
#

he dont want to listen

reef wind
#

I bet you can find the answer with 1 google search

#

or check what cipher sent

#

why can’t people just read docs and use google

quaint mantle
#

int value = p.getTotalExperience();
Bukkit.broadcastMessage(String.valueOf(value));

reef wind
#

okay I won’t help you because you are not listening

#

I told you 2 times, cipher sent 2 links, and I have yuh advice.

quaint mantle
#

this shows how much experience, but if you change this number, everything breaks down and when you get a new level, it is not added

reef wind
#

how are you changing it?

quaint mantle
#

p.setTotalExperience(Math.max(0, p.getTotalExperience() - 13));

reef wind
#

I told you 2 times

#

that sets the max the player can each.

#

I know how, but I won’t say how because you need to google and read the docs.

quaint mantle
#

I couldn't find anything

reef wind
#

Lemme try

quaint mantle
#

please tell me how to do this

reef wind
#

the doc clearly states how to change the xp and the first google result was the answer.

quaint mantle
#

I have everything in Russian, maybe that's why I can't find it?

reef wind
#

read the doc that both cipher and now I sent you

quaint mantle
#

This is a percentage value. 0 is "no progress" and 1 is "next level".

hybrid spoke
quaint mantle
#

0-1

hybrid spoke
#

yeah

#

0-100/100

quaint mantle
#

p.giveExpLevels();

reef wind
#

what about it?

hybrid spoke
#

interact with us

#

dont just post anything in here

quaint mantle
#

thank you, I'll try it nowъ

reef wind
#

this guy is either high or 5

hybrid spoke
quaint mantle
#

this took the entire 41 levels

p.giveExpLevels(- 1395);

reef wind
#

god help humanity

quaint mantle
#

p.giveExpLevels(1395);

this gave me 14000 levels

reef wind
#

If you round it yes

quaint mantle
#

and how can you give out and take away not the level, but the experience?

reef wind
#

What?

#

you want to remove xp?

quaint mantle
#

Yes, experience

reef wind
#

use the docs still

fluid cypress
#

is it ok to use a Chunk object as a map key?

#

or it can change / memory leak?

native nexus
#

A chunk's coordinates are both Integers. Why store the whole chunk object?

fluid cypress
#

what should i use? is there a tuple object or something like that in java?

native nexus
#

There are a couple of ways to approach this.

vast sapphire
#

firework doesn't detonate? ```java
Firework f = (Firework) event.getEntity().getWorld().spawn(arrowLocation, Firework.class);
FireworkMeta fmeta = f.getFireworkMeta();
fmeta.addEffect(FireworkEffect.builder()
.flicker(true)
.trail(true)
.with(FireworkEffect.Type.BURST)
.withColor(Color.RED)
.withFade(Color.ORANGE).build());
fmeta.setPower(0);
f.setFireworkMeta(fmeta);
new BukkitRunnable() {
@Override
public void run() {

                    f.detonate();
                }
            }.runTaskLater(new SlimeFun(), 5L);
native nexus
#

I found a thread on spigot about your question 😛

#

I would personally go for the 3rd option.

rustic gale
#
the path name for my project on my local computer:13:21
java: cannot find symbol
  symbol:   method of(java.lang.String)
  location: interface java.nio.file.Path

I get that error message when I try building my project on IntelliJ

    Path path = Path.of("my path");

And when I remove this line of code, the error goes away. I havejava.nio.file.Path and java.nio.file.Files imported so what is causing this?

hybrid spoke
#

probably just doing something wrong

rustic gale
#

really?

hybrid spoke
#

normally a File represents your path

rustic gale
#

ohhh

hybrid spoke
#
File path = new File("my path");
rustic gale
#

i see

#

but what am i diong wrong about it

ivory sleet
#

Maybe you need to use Paths::get

#

iirc Java 8 doesn’t have the method Path::of

hybrid spoke
#

Path doesnt have a #of method

#

at least not in java 8

rustic gale
#

to use path.of

hybrid spoke
#

so either change your servers java version

#

or just use a File

ivory sleet
#

🥴

rustic gale
#

but i changed to nio cause

ivory sleet
#

It’s better in every way

rustic gale
#
    public void WriteFile() {
        try {
            FileWriter writer = new FileWriter("not gonna share path sry");
            writer.write("Test");
            writer.flush();
            writer.close();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }

I have this script that writes "test" into a txt file and it works fine but since a new object writer is being made each time the files don't "save". Because instead of what I want to happen, which is the file filling with multiple "test", what happens is, the file only has one "test" in it. So basically I just need writer to be initilized outside of the method. The problem is I have to initilize it in a try catch statement which I can't do outside of the java main method

#

and someone told me to try Nio

reef wind
#

“not gonna share path” yikes, why so paranoid.

rustic gale
#

dunno ¯_(ツ)_/¯

#

but its not important right

torn oyster
#

how do i do loot tables in 1.8.9?

ivory sleet
#

Sounds more like a design problem

torn oyster
#

sorry for using 1.8 lol

#

i have no choice

reef wind
torn oyster
#

i want to make a custom loot table

ivory sleet
#

also greaterlplays file writer flushes automatically

torn oyster
#

for skywars islands

#

and one for mid islands

ivory sleet
#

And use try with resources statement instead of manually closing it

rustic gale
#

wel actually no error it just didn't write

torn oyster
#

How do I do custom loot tables in 1.8.9? (sorry for using it lol i have no choice)
I'd like one for:

  • Spawn islands
  • Middle islands
#

there lol

#

fancy question

ivory sleet
#

Also you can choose to append vs override in the FileWriter when constructing

ivory sleet
#

Anyways I barely use it

torn oyster
#

no choice

narrow vessel
#

just update

#

its that easy

torn oyster
#

i can't do it

#

like

#

at all

narrow vessel
#

you can

#

if youre a developer for someone they also can do it

#

and if its for your own use then you can also do it

ivory sleet
#

Second param I believe

#

A boolean iirc

rustic gale
#

oh

#

alr

#

ty

reef wind
torn oyster
#

anyway

#

how

#

is there a way

#

or do i have to make my own loot tables system

quaint mantle
#

p.giveExp((int) - 1395);

#

you can only give out a level, but you can not take it away

tall dragon
torn oyster
#

damn

#

aight ig

#

how does 1.8 vanilla do it

young knoll
#

I believe they are hardcoded

torn oyster
#

oh

tall dragon
#

Idk what ur use case is but it shoulnt be too difficult to setup a lil system

torn oyster
#

hm

#

how should i get started

tall dragon
#

Well bassicaly its a list of items and you just pick random items from the list right

young knoll
#

A weighted random system is a good start

rustic gale
quaint mantle
#

ауе?

#

How would I go on about placing blocks at multiple locations at once?

native nexus
median anvil
#

Why wont this work: player.setItemInHand(null);

#

does nothing

quaint mantle
#

not many

median anvil
#

yet the line right underneath it : player.playSound(player.getLocation(), Sound.ENTITY_ITEM_BREAK, 1, 1); works fine

native nexus
median anvil
#

ill try it

native nexus
native nexus
#

Actually I remember you can't physically set items in the hand like that anymore.

median anvil
#

if (player.isSneaking()) { player.setItemInHand(new ItemStack(Material.AIR)); player.playSound(player.getLocation(),Sound.ENTITY_ITEM_BREAK, 1, 1); return; }

#

sorry for poor formatting....

#

how do you set items in hand then?

native nexus
#

setItemInHand is deprecated

median anvil
#

so is getItemInHand, but it still works...

native nexus
#

So you need to do player.getInventory().setItemInMainHand()

hasty prawn
#

player.getInventory().setItemInMainHand(ItemStack);

#

you ninja'd me :(

native nexus
#

Nande kore wa

quaint mantle
#

in the configuration

native nexus
#

Have you worked with ConfigurationSections before?

median anvil
#

player.getInventory().setItemInMainHand(ItemStack) didn't work

#

idk wtf is going on

median anvil
#

cause the line below it works, so idk why this one wouldnt

native nexus
native nexus
median anvil
#

yes

#

doesn't make sense...

hasty prawn
#

Does the sound play

median anvil
#

yes!

#

thats what doesnt make sense lol

#

you'd think if something was wrong with my code the sound wouldn't play either

hasty prawn
#

Try setting it to new ItemStack(Material.AIR) instead of null

median anvil
#

nope...

#

doesn't work

#

basically i want to cancel drop event and destroy the item.

#

and eveything works except the destroy item part

quaint mantle
# native nexus https://www.spigotmc.org/threads/configuration-section.373459/ This thread shoul...
for (String key : arenaConfiguration.getArenaConfig().getConfigurationSection(getSelected() + ".traitorTester.testerGlass").getKeys(false)) {
            ConfigurationSection glass = arenaConfiguration.getArenaConfig().getConfigurationSection(getSelected() + ".traitorTester.testerGlass." + key);
            Location loc = new Location(Bukkit.getWorld(glass.getString("World")), glass.getDouble("X"), glass.getDouble("Y"), glass.getDouble("Z"));
            loc.getBlock().setType(Material.GLASS);
        }```
Ended up trying this but did not work. Probably cuz I'm doing it wrong but not sure what I'm doing wrong
native nexus
#

Just getting a snack from the convenience store and then I’ll help yah

median anvil
#

how do i delete this think jesus

#

nothing is working

hasty prawn
#

Are you just trying to only allow them to drop it if they're crouching?

median anvil
#

yes

hasty prawn
#

Just don't cancel it if they're crouching

#

Problem solved

median anvil
#

but i dont want drop

#

sorry

#

i want remove

#

the idea is nobody else can have the item but them, however they can delete the item

#

so Q tells them they cant drop, but if they shift they can delete, thus removing it from their inventory

#

watch video

hasty prawn
#

Hm that is interesting

#

If you drop a stack of items too it just sets the amount to 1 Thonk

median anvil
#

are you testing?

hasty prawn
#

Yes

median anvil
#

well at least its not just me having this issue then

hasty prawn
#

If you delay the remove by 1 tick it works

#

I would just do that, kinda weird how that works.

median anvil
#

so i have to set up a scheduler?

#

jeez

hasty prawn
#

I mean it's just

Bukkit.getScheduler().runTaskLater(plugin, () -> {
  //remove here
}, 1);
median anvil
#

yeah, but is that not hard on the memory of the server

hasty prawn
#

Not really, how often are people going to be destroying items?

median anvil
#

idk, everyone on server will have items that can be destroyed

#

its a gamemode server with class based items that can only be destroyed not dropped

hasty prawn
#

You could do event.getItemDrop().remove() maybe?

#

And not cancel the event

median anvil
#

yeah, i was thinking of that. ill try it.

median anvil
hasty prawn
ionic reef
#

MySQL Question: What statement should I use to end up with a table like this (where you can have multiple of the same on the left hand side)

userID group
 1      | admin
 1      | moderator
 1      | test
median anvil
#

why would you get multiple user ids

crude charm
#

How accurate is the kotlin to Java converter?

ionic reef
#

a player can have multiple groups, so I need to be able to store them

native nexus
median anvil
#

can't you use users unique ids as key

#

and then you dont have to worry about it

ionic reef
#

heh

#

i would have the same issue either way?

median anvil
#

no player has the same id

ionic reef
#

the issue is when I don't know what statement to use to set it without the next group overriding the last one

ionic reef
median anvil
#

you could create a table with that id and set multiple groups to that id

quaint mantle
#

@native nexus you back already?

native nexus
#

Yes I sent you a message in pms

quaint mantle
#

oh

ionic reef
crude charm
#

How accurate is the kotlin to Java converter?

ionic reef
median anvil
#

yeah thats what i meant, but sql databases arent super efficient themselves imo

ionic reef
median anvil
#

non relational databases are easier

crude charm
ionic reef
#

rip

median anvil
#

user table and then independent user tables with transaction/cart or in your case groups

ionic reef
#

I think thats what i have

#

I have a playerdata table which hold's a userID, UUID

#

and then a 'friends' table

median anvil
#

@ionic reef look into mongodb if you dont like relational.

#

might be more of what you are wanting

#

certainly more powerful when it comes to that kind of stuff.

waxen plinth
#

You would definitely want them to both be foreign keys as well

#

But this should work

ionic reef
#

oh i have the table setup

#

its just putting the data in there

#

currently using what Im using it will just override the existing one

waxen plinth
#

INSERT INTO groups VALUES (?, ?)

ionic reef
#

oh

#

I was using INSERT IGNORE INTO

#

would that be screwing it?

waxen plinth
#

Okay that's a problem for many reasons

ionic reef
#

😭 ty tutorials

waxen plinth
#

It means your primary key is probably only the ID column

#

A primary key must be unique

#

Insert ignore means "insert, but if it already exists, don't do anything"

ionic reef
#

oh

#

that would um

#

that would be why

waxen plinth
#

You need to make both columns the primary key

#

It means that you can have multiple entries with the same id

#

But you can't have multiple entries with the same id and group

#

Which is what you want

ionic reef
#

so would I just do PRIMARY KEY (USER,GROUP)

waxen plinth
#

And you can keep using insert ignore, you just need to fix your primary key

waxen plinth
ionic reef
waxen plinth
#

Make sure they're also foreign keys

ionic reef
#

tried looking into it but didnt get a lot of info from google

waxen plinth
waxen plinth
#

This basically says

#

"I'm referring to this column from this other table here, if the row I'm referencing is updated, change it here too, and if it's deleted, delete this row too"

ionic reef
#

oh right

#

so would I put that when im defining the table?

#

assuming so

waxen plinth
#

And do the same for group

#

Yes

#

That's SQLite syntax though, it might be slightly different for MySQL

#

Look it up if it doesn't work

ionic reef
#

will do

#

tysm

waxen plinth
#

👍

#

Are you using prepared statements?

ionic reef
#

yeah

waxen plinth
#

Good

#

If you're interested I also have a SQL helper that makes it easier

#

It just avoids you having to catch SQLExceptions everywhere and makes the code for performing SQL queries a lot less repetitive

ionic reef
#

I think I'm decently ok at the rest of SQL, just this had be stumped haha

#

ty for the offer tho

waxen plinth
#

No it's on the java end

ionic reef
#

& as im still semi-new the repetitiveness helps me remember what to do at tleast

waxen plinth
#

Mmk, fair enough

ionic reef
#

ty tho

#

<3

late stone
#

is it possible to get the player to do a eating animatoin when its in certain conditions

lost matrix
silk mirage
#

SQL queries are too complex sometimes

quaint mantle
#

Hello

#

any one here?

lost matrix
#

?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.

quaint mantle
#

how do i can replace %player% to player.getName(); using placeholderAPI on my custom plugin?

#

bcz i want to add stats on holograms but i need to use placeholders

lost matrix
lost matrix
#

Registering them is a bit harder but still straight formard.

quaint mantle
#

okay sir thanks

sullen dome
lost matrix
sullen dome
#

oh i know

#

omg

#

eventually messed with the wrong ones lol

lost matrix
#

Did you modify the client so that pitch is no longer limited by 180°?

sullen dome
#

i changed the marked ones, but wanted to change the first ones

#

my stupiiiid head

sullen dome
#

and idk why and how

#

all i know is that yaw and pitch are switched

#

and yaw is limited to 90/-90 degrees WTF

#

i guess i definitely switched them ahaha

eternal oxide
sullen dome
eternal oxide
#

If you want to be able to flip you have to start working with matrices and quaternions.

sullen dome
#

no thats defnitely not what i wanted

#

i just wanted a perspective mod, and changed the wrong values

#

that should only happen in f5-mode

#

those were the ones i was supposed to change... my brain just got dead

#

now it works again, huh

#

uhmmm.... i'm not good at math, but... x is not pitch right? lol

native nexus
#

nope

sullen dome
#

then there we got the issue lol

lost matrix
#

YRot should be yaw % 360.0F
XRot should be pitch % 360.0F

native nexus
#

Yeah and this looks like it is for a mod?

sullen dome
#

basically

tacit drift
#

wait

sullen dome
#

way beyond xd

silk mirage
#

.

tacit drift
#

do other people also see your head like that?

sullen dome
#

nah

#

or

tacit drift
sullen dome
#

wait

#

i actually don't know

#

imagine xd

tacit drift
#

dm me a server to join and see

sullen dome
#

i'm in dev mode, so i'm currently not in onlinemode

tacit drift
#

😦

silk mirage
sullen dome
#

lemme change my servers offline mode rq, and hope you dont fuck my server

native nexus
#

You need to make sure you clamp the rotation btw

sullen dome
#

ah fuck it, i fixed it anyway

#

no server needed lol

#

this is just cursed

native nexus
#

who tf dis

sullen dome
#

it just still switches yaw and pitch, when in perspective mode

#

weird

#

oh my

native nexus
#

Oh

sullen dome
native nexus
#

huh

sullen dome
#

WHY

#

i just changed java pYaw = ModPerspective.INSTANCE.cameraPitch; pPitch = ModPerspective.INSTANCE.cameraYaw;
to

pYaw = ModPerspective.INSTANCE.cameraYaw;
pPitch = ModPerspective.INSTANCE.cameraPitch;```
sullen dome
#

wdym

native nexus
#

CLAMP

sullen dome
#

CuRsEd

reef wind
#

What are you even making?

lost matrix
#

There is no such event

silver shuttle
#

nvm

#

i am stupid

silver shuttle
lost matrix
#

Nope

silver shuttle
#

i spelled ChangeArmorEvent didnt i?

lost matrix
silver shuttle
#

oh ok

dire marsh
#

so there is an event

reef wind
silver shuttle
lost matrix
#

Not in spigot

dire marsh
#

:think_smart:

reef wind
#

read that wrong sorry

silver shuttle
#

this discord here is for spigot i meant

quaint mantle
reef wind
#

Yes but we also give support for paper

dire marsh
reef wind
#

that name breaks so much violation

dire marsh
#

just steal the code off it

#

¯_(ツ)_/¯

#

but really spigot should have this

vast ledge
silver shuttle
reef wind
silver shuttle
#

copied from the other class

vast ledge
#

i cant get this to work anybody know how to send a message when somebody joins the server

#

rb im using

#

public void onPlayerJoin(PlayerJoinEvent event) {
if(event.getPlayer().hasPermission("tabnamecolor.yellow")){
Player player = event.getPlayer();
event.getPlayer().setPlayerListName(ChatColor.DARK_RED + event.getPlayer().getName());
Bukkit.broadcastMessage(event.getPlayer().getName() + "Has Connected");
}
}

lost matrix
undone axleBOT
quaint mantle
#

event.setJoinMessage

silver shuttle
#

okay i have kind of an issue here, I want to detect if a player MANUALLY puts on a carved pumpkin on their head and then basically cancel that event
However, I have a plugin which can put a pumpkin on their head (I use a texture pack for a scope pumpkin overlay), and that should not be cancelled
How do I detect that?=

vast ledge
reef wind
lost matrix
silver shuttle
#

thanks a lot!

#

wait

vast ledge
lost matrix
vast ledge
#

i thought if i decalre player it might work

silver shuttle
vast ledge
#

public void onPlayerJoin(PlayerJoinEvent event) {
if(event.getPlayer().hasPermission("tabnamecolor.yellow")){
Player player = event.getPlayer();
event.getPlayer().setPlayerListName(ChatColor.DARK_RED + event.getPlayer().getName());
event.setJoinMessage(ChatColor.YELLOW + event.getPlayer().getName() + "Has Joined the Server!");
}
}

reef wind
#

@silver shuttle also please follow naming conventions

reef wind
lost matrix
# silver shuttle umm there is no ArmorEquip event?

If you want to use the PlayerArmorChangeEvent

  private final Set<UUID> bypassedPlayers = new HashSet<>();

  public void addArmorWithBypass(final Player player, final ItemStack itemStack, final EquipmentSlot equipmentSlot) {
    this.bypassedPlayers.add(player.getUniqueId());
    player.getEquipment().setItem(equipmentSlot, itemStack);
  }

  @EventHandler
  public void onEquip(final PlayerArmorChangeEvent event) {
    if (bypassedPlayers.remove(event.getPlayer().getUniqueId())) {
      return;
    }
    // Cancel your stuff here
  }
silver shuttle
#

well I can't find it

reef wind
#

where are you looking?

silver shuttle
#

in my IDE

silver shuttle
reef wind
#

are you using paper or spigot?

silver shuttle
#

paper

reef wind
#

I don’t know how you do it in IntelliJ but you can open the page for all methods and stuff (can’t remember what that page is called) but someone here prob knows.

silver shuttle
#

theres only these 2

lost matrix
#

You use the addArmorWithBypass method to put the players UUID in a Set. Then you listen to the PlayerArmorChangeEvent. If the player is in the Set then you do nothing.
If the player is not in the Set (That means he equipped something without the addArmorWithBypass method) then you can cancel the event.
This means no one can change armor unless its being done with the addArmorWithBypass method.

silver shuttle
#

ok thank you

lost matrix
silver shuttle
#

sorry, I am too new to Java to know such stuff

oblique cape
#

Is there a way to send a packet to the player with a totem effect with custom model data?
If you know, tell me how to do it.

silver shuttle
#

So I imported a jar plugin to my project and the IDE recognised it, but when i try to compile it says the package that I am trying to import does not exist (The com.shampaggon.crackshot.events)
I think I need to add something to pom.xml but I do not know what that would be, as I do not have that info

eternal oxide
#

you can not import jars then build with maven

silver shuttle
#

well it worked often times before

eternal oxide
#

Argue if you like

native nexus
#

erm

silver shuttle
ivory sleet
#

wth

eternal oxide
#

Not seen by maven

ivory sleet
#

You’re suppose to add that through maven then

#

Ant + maven never work out great

silver shuttle
#

wait how do I import crackshot now?

#

Crackshot's GitHub only says this

eternal oxide
#

It has no maven repo nor Github so you'd have to install it locally

silver shuttle
#

well that's what i did

#

the plugin is a dependency

#

Which is why I added the plugin as a library

#

but apparently thats wrong?

eternal oxide
#

If it has a github you can add it using... I forget the name

silver shuttle
#

theres no source code on its github

silver shuttle
eternal oxide
#

then you will have to install it to yoru local repo

silver shuttle
#

which I do by importing the jarfile into my libraries right?

eternal oxide
#

no, thats yoru IDE

silver shuttle
#

I don't even have maven installed outside of my ide

eternal oxide
#

if you open a cmd prompt, can you type mvn and get a response?

silver shuttle
#

no, that's what i said

eternal oxide
#

Yes you said it, but many don't have a clue

silver shuttle
#

Like - How do I just import the plugin into my project, the IDE is recognising the plugins methods but not compiling because then suddenly it can't find the package anymore

regal moat
#

how can i despawn a entityfallingblock?

#

i used .die() but it wont work

eternal oxide
#

You MIGHT be able to add it to maven as a local reference, but its not recommended

regal moat
#

i also used setRemoved(Entity.RemovalReason.b);

eternal oxide
#

remove it as a lib first

regal moat
#

but it still wont work

#

help