#help-development

1 messages · Page 1617 of 1

left swift
#

hmm, do you know why I have such a problem? with this cannot access

lost matrix
quaint mantle
lost matrix
quaint mantle
#

I want to detect when the server send a resourcepack and cancel it if the player already has the pack

lost matrix
#

Cant you just use ProtocolLib for that?

grim ice
#

Heyo, anyone knows the event for the block breaking process

quaint mantle
#

afaik ProtocolLib is a spigot plugin @lost matrix

grim ice
#

like before the block is broken

lost matrix
#

?jd

grim ice
#

Thanks

grim ice
grim ice
#

and not even close to it

#

o

#

Okay l o l

left swift
lost matrix
vivid temple
#

can you detect when a player jumps on a farmland?

lost matrix
left swift
lost matrix
grim ice
#

Anyone has an idea of how do I change mining speed of a block without haste?

lost matrix
grim ice
#

oh god

#

i need packets?

lost matrix
#

I think spigot now even has a method for that

grim ice
#

why is such a simple method this hard

#

frick spigot

quaint mantle
#

I had to also freeze the block mining to get it to work with oraxen

#

but that's cool because you can even make bedrock breakable that way

#

It should work I think

lost matrix
#

Ofc you need to intercept the actual damaging of the block by the player or else the damage will just be overwritten

quaint mantle
#

You must give slow digging effect too

#

because the mining is client side

left swift
# lost matrix Copy it and send it in here

this is it? (sorry if I gave it wrong, but this is the first time I encountered it)

[ERROR] /D:/Spigot/xDeveloper/src/main/java/pl/tuso/xdeveloper/NMSNametag.java:[3,43] cannot access net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata
  bad class file: C:\Users\Piotr\.m2\repository\org\spigotmc\spigot\1.17.1-R0.1-SNAPSHOT\spigot-1.17.1-R0.1-SNAPSHOT.jar(net/minecraft/network/protocol/game/PacketPlayOutEntityMetadata.class)
    class file has wrong version 60.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.```
quaint mantle
#

You don't receive block break packets when you break a block

#

you can try it

grim ice
#

uhhh idk

lost matrix
vivid temple
# lost matrix PlayerInteractEvent -> Action.PHYSICAL

this didnt work tho

@EventHandler
    public void onPlayerInteract(PlayerInteractEvent e){

        Player player = e.getPlayer();

        if (e.getAction().equals(Action.PHYSICAL)) {
            if (e.useInteractedBlock().equals(Material.FARMLAND)){
                player.sendMessage("farmland");
            }
        }
    }
left swift
lost matrix
#

-.-

#

Do you use maven?

left swift
#

yes

lost matrix
#

Configure your maven compiler plugin and make sure you have an updated jdk installed

#

  <properties>
    ...
    <java.version>16</java.version>
  </properties>

  <build>
    <plugins>
      ...
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
grim ice
#

i found this in forums do you think it will be useful?

 private void interceptPackets() {
        protocolManager.addPacketListener(new PacketAdapter(instance, ListenerPriority.NORMAL, PacketType.Play.Client.BLOCK_DIG) {
            @Override
            public void onPacketReceiving(PacketEvent event) {
                PacketContainer packet = event.getPacket();
                EnumWrappers.PlayerDigType digType = packet.getPlayerDigTypes().getValues().get(0);

                if(digType == EnumWrappers.PlayerDigType.START_DESTROY_BLOCK){
                    //Start task, call begin event,
                } else if(digType == EnumWrappers.PlayerDigType.ABORT_DESTROY_BLOCK){
                    //Cancel task, save block break state.
                } else if(digType == EnumWrappers.PlayerDigType.STOP_DESTROY_BLOCK){
                    //Cancel task, Remove block break state from map, call end event.
                }

                System.out.println("DigType: " + digType.name());
            }
        });
    }```
lost matrix
quaint mantle
#

@grim ice what are you trying to do? 🙂

grim ice
#

im trying to change a block breaking speed

#

not change to be specific

#

but add

left swift
grim ice
#

because the block is not breakable

tardy delta
#

does someone know what does this mean for a horse

lost matrix
#

How hard it is to tame

noble axle
#

Taming depends on the horse's "temper". Horses begin with a temper of 0 out of 100. When a player first mounts the horse, a random taming threshold 0–99 is chosen. The horse becomes tame if the temper exceeds this threshold. Otherwise, the player is bucked off and the temper is increased by 5, to be compared against the threshold the next time the player mounts the horse.

quaint mantle
#

is it possible to make entity.sheep.death just one sound variant instead of the more available sound variants

lost matrix
#

The client decides what variant is chosen

quaint mantle
#

so it cant be set to only one variant

#

with a plugin

lost matrix
#

I dont think so

noble axle
#

No, only if a resource pack is used

grim ice
#

DID getItemInUse just vanish>>>

#

i swear it existed

noble axle
#

JavaDocs

lost matrix
#

?jd

grim ice
#

I found it in the java docs

#

but I can't actually use it lol

lost matrix
noble axle
#

are you using the same version?

grim ice
#

a player is a human entity

grim ice
#

im using jdk 1.8

#

Spigot 1.16.5

noble axle
#

that makes sense, because it's not here

#

if you want to use it, use the 1.17.1 api

#

or use a different method

grim ice
#

Yeah

#

it wont work if player is not in an event

#

otherwise itll return null

noble axle
#

it actually doesn't need to be during an event. you could check at any time really. I don't see why that'd be practical though, just depends

grim ice
#

You cant use an item without triggering an event

#

lol

noble axle
#

I'm saying, you can still use the method outside of an event. It's literally a part of the interface

#

Saying otherwise is simply untrue

noble axle
#

But that's exactly why you can't with 1.16.5 api. The method isn't in that version

grim ice
#

Oka

smoky finch
#

I wrote this method (using the rotation methods https://www.spigotmc.org/threads/166854/)
It's supposed to spawn a semicircle in front of the player where the player is looking. It works perfectly fine, I'm just having a hard time trying to rotate the circle while it's facing the player.
So currently this is player's POV if the code runs (lines are representing the particles)

------------

I want it to look like

\
 \
  \
   \
public static void half(Player player) {
    double radius = 3, secRadius = 4;
    double every = Math.PI / 30;
    Location loc = player.getLocation();

    for (double rad = 0; rad <= Math.PI; rad += every) {
        double x = radius * Math.cos(rad);
        double y = secRadius * Math.sin(rad);

        double rotateX = Math.toRadians(loc.getPitch() + 90);
        double rotateY = Math.toRadians(-loc.getYaw());

        Vector rotate = new Vector(x, y, 0);
        rotateAroundX(rotate, rotateX);
        rotateAroundY(rotate, rotateY);
        Location finalLoc = loc.clone().add(rotate);
        player.spawnParticle(Particle.FLAME, finalLoc, 1, 0, 0, 0, 0);
    }
}
left swift
#

can EntityItem startRiding player? (CraftPlayer)

item.startRiding(((CraftPlayer) p).getHandle());
PacketPlayOutMount itemMount = new PacketPlayOutMount(item);```because it doesn't work
hybrid spoke
left swift
#

xD old project, I already got what I wanted, but I am checking different solutions

quaint mantle
#

How can I make when interacting with an entity it rotate and look at me?

grim ice
#

um

#

if i used public static ItemStack to access the itemstack from a different class is that static abuse

stone sinew
grim ice
#

public static ItemStack getBedrockPick(){
ItemStack item = new ItemStack(Material.STONE);
return item;
}

#

its longer than that but thats an example

stone sinew
grim ice
#

@stone sinew

quaint mantle
#

does anyone have an idea how i could possibly make a buy sign that gives you a rank and some permissions with it
example
[Buy]
"rank name"
"rank prefix"
{cost of rank}

pulsar schooner
#

Maybe use a player interact event, check if it's a sign, then get sign text and parse into what you need?

vivid zodiac
#

Hello, i've a problem, i create arrow, but i can't collect the shooter with #getShooter
world.spawnArrow(player.getEyeLocation(), player.getEyeLocation().getDirection(), 3, 0);
so how can i collect shooter or add shooter to my arrow ? thx you c: (sry for my superb enslish)

pulsar schooner
#

If you spawn the arrow with the player, then is that player not the shooter?

eternal oxide
#

No, you have to use the returned Arrow Entity and setShooter on it

#

You are spawning it, not shooting it so no shooter unless you set it

vivid zodiac
#
@EventHandler
    public void onProjectileLaunch(final ProjectileLaunchEvent event) {
        final Projectile proj = event.getEntity();
        final ProjectileSource entity = proj.getShooter();
        
        
        if(entity instanceof Player) {
            if(Commands.Red.getPlayers().contains(entity))
                proj.setCustomName("red");
            if(Commands.Blue.getPlayers().contains(entity))
                proj.setCustomName("blue");
            Bukkit.broadcastMessage("t'es un joueur");
        } else {
            Bukkit.broadcastMessage("t'es pas un joueur");
        }
    }

i use it for know if shooter was player, but don't work with my arrow spawned but with bow that work !

eternal oxide
#

I just told you why

chrome beacon
#

^

vivid zodiac
#

how can i make this so ?

quaint mantle
#

How can I make when interacting with an entity it rotate and look at me?

opal juniper
#

Wdym by interacting?

regal dew
#

PlayerInteractAtEntityEvent

#

then teleport the entity to the opposite yaw & rotation of the player’s eye location

quaint mantle
#

@eternal oxide thank you for what you are doing!

#

every time I go to this channel I see you helping people

vivid zodiac
#

world.spawnArrow(player.getEyeLocation(), player.getEyeLocation().getDirection(), 3, 0).setShooter(player);

#

but don't work too 😦

#

Who can help me ? :c

#

that didn't work with my spawned arrow, but with ussless bow that work

@EventHandler
    public void onProjectileLaunch(final ProjectileLaunchEvent event) {
        final Projectile proj = event.getEntity();
        final ProjectileSource entity = proj.getShooter();
        
        if(entity instanceof Player) {
            if(Commands.Red.getPlayers().contains(entity))
                proj.setCustomName("red");
            if(Commands.Blue.getPlayers().contains(entity))
                proj.setCustomName("blue");
            Bukkit.broadcastMessage("u are a player");
        } else {
            Bukkit.broadcastMessage("u are not a player");
        }
    }
vivid zodiac
#

no one ? 😦

hidden delta
#

Can you paste

#

?paste

undone axleBOT
chrome beacon
#

You need to call it yourself

vivid zodiac
#

when i show arrow with bow i have broadcast (u are a player)
but with my spawned arrow (u are not) so this event was called, but idk why that didn't work

vivid zodiac
quaint mantle
#

Hey guys! Somehow this returns null: ```java
public static Inventory perkinv() {
Inventory inv = Bukkit.createInventory(null, 6*9, "§c§lPerks");

    ItemStack ph = new ItemStack(Material.BLACK_STAINED_GLASS_PANE);
    ItemMeta ph_meta = ph.getItemMeta();
    ph_meta.setDisplayName("§8");
    ph.setItemMeta(ph_meta);

    inv.setItem(0, ph);
    inv.setItem(1, ph);
    inv.setItem(2, ph);
    inv.setItem(3, ph);
    inv.setItem(4, ph);
    inv.setItem(5, ph);
    inv.setItem(6, ph);
    inv.setItem(7, ph);
    inv.setItem(8, ph);
    inv.setItem(9, ph);
    inv.setItem(10, ph);

    return inv;
}```
#

1.17.1 btw

chrome beacon
#

You sure

hasty prawn
#

Send the error

quaint mantle
#

I think I got the error

#

wait

hasty prawn
#

You should probably just use Player#launchProjectile if you're making the player shoot something

quaint mantle
#

It is working

hidden delta
#

@vivid zodiac you need to lunch projectile not spawn arrow

#

there method called player#lunchProjectile

vivid zodiac
#

Okay thx i let's try it ! 😄

austere cove
#

u can't detect if a player opens their own inventory in modern mc versions right?

eternal oxide
#

no

austere cove
vivid zodiac
quaint mantle
#

hey i have a little issue with maven stuff

#

im so sorry

#

i keep googling just to get like, wikihow-type tutorials ._.

#

idk what im doing wrong im so sorry

#

i feel bad because this is probably a super easy fix

eternal oxide
#

You have yet to tell us what your problem is

quaint mantle
#

missing artifact, net.dv8tion:JDA:4.3.0_304

#

hi im typing it

eternal oxide
#

What IDE?

quaint mantle
#

eclipse

eternal oxide
#

Project menu -> clear

#

then restart IDE

#

*clean

quaint mantle
#

that wont mess anything up?

eternal oxide
#

it just clears any compiled cache

quaint mantle
#

okay

#

wheres the project menu T-T

eternal oxide
#

Maven repository says the newest version of JDA is 2.3.0_247

quaint mantle
#

weird

#

do i put .jar at the end of the version

eternal oxide
#

ok, in their own repo. Have you added their repo?

quaint mantle
#

repo? yeah

#

that's correct yes?

#

i assume it is, theres no errors there

eternal oxide
#

one sec, theres a clear tick box you need to do...

quaint mantle
#

owo?

eternal oxide
#

have to open my IDE to find it

quaint mantle
#

ah

#

i might just remove the dependcy/repo for JDA and add itw ith the "add dependency"

eternal oxide
#

Right click your project in the Project Explorer, window. Select Maven -> Update Project... tick the box - force update of snapshots/releases

quaint mantle
#

still getting a missing artifact error

eternal oxide
#

did it update dependncies? you shoudl see an update bar bottom right

quaint mantle
#

no bar

#

not that i could see

eternal oxide
#

did you tick the box to force update?

quaint mantle
#

yep

eternal oxide
#

No clue then. That should work

quaint mantle
#

im just gonna add it with the "Add dependecyn"

#

do i need to add the JDA jar somewhere??

eternal oxide
#

no, thats what maven is for

quaint mantle
#

thats what i thought

#

oh it worked now

#

i had the wrong version

#

¯_(ツ)_/¯

#

alright, it now works, now im just not sure why the classes arent loadind

wispy plume
#

Hello, so my bungeecord's player count grows infinitely
Basically getOnlinePlayers().size() never drops, but rises when a player that haven't joined in a session joins
And if they leave, they're not removed from the list
How can I fix that?

#

Also, when I try to kick the player, it says "successfully kicked", but I can do that forever

#

Elements just won't remove from the collection

#

I haven't touched any plugins for like few days, and it never happened till now

wary harness
#

can some body tell me is it possible to grab thread from AsyncPlayerPreLoginEvent and merged with my other thread

proud basin
#

How are you using getOnlinePlayers? Can you show some code.

crimson scarab
#

is it possible to create an explosive which knockback entites

quaint mantle
#

soooo

#

the JDA works but like

#

idk why the bot doesnt enable???

#

says the classs doesnt exist?

#

but i shaded in right im 99% sure

#

if the people in gg/jda were any help

eternal oxide
#

not shaded

quaint mantle
#

okay

#

they explained it really badly

quaint mantle
eternal oxide
#

give it a compile scope

proud basin
#

The people in that cord are just annoying

quaint mantle
quaint mantle
#

oh it doesnt

eternal oxide
#

check in pom

quaint mantle
#

thats in the dependency, <scope>compile</scope>?

eternal oxide
#

yes

quaint mantle
#

so i dont need the maven-shade-plugin ?

eternal oxide
#

shade is automatic if you don;t specify the shade plugin

quaint mantle
#

LOL okay

#

@crimson scarab you can also use World#createExplosion

#

for an actual explosion

#

still having the issue

#

the only downside to this is that it may hurt entities

#

i'll export one more time lol

eternal oxide
#

open your jar and see if its in there

proud basin
quaint mantle
quaint mantle
eternal oxide
#

no, winzip/7zip

#

whatever compression util

quaint mantle
#

ah okay

#

which folder would that be in

eternal oxide
#

You don;t need to shade if you are using spigot 1.17]

quaint mantle
#

interesting

eternal oxide
#

use teh libraries entry in plugin.yml

quaint mantle
#

?paste

undone axleBOT
quaint mantle
quaint mantle
#

becauseee

#

i'll get some invalid import errors

hasty prawn
hasty prawn
#

I should learn how that works it sounds cool

quaint mantle
proud basin
quaint mantle
#

its in maven dependencies

#

so like idk what it means class not found

quaint mantle
vagrant galleon
#

Hello, I making a minigame, so I need a countdown for death(5 sec). I try scheduleSyncRepeatingTask, but when many players it's confused and broke. So how can I make a countdown(every second send title)?

quaint mantle
#

an explosion isnt an entity

eternal oxide
quaint mantle
eternal oxide
hasty prawn
quaint mantle
#

bin and com are the same, just my packages

eternal oxide
#

Why are you exporting and not building with maven?

quaint mantle
#

oh is that a thing

proud basin
#

I swear an explosion counts as entity

hasty prawn
#

It doesn't, but you might be able to set the Explosion source to a TNTPrimed entity & use that to detect if the explosion was yours.

quaint mantle
#

:(

quaint mantle
#

either way

proud basin
#

I’m not at my pc smh

quaint mantle
#

its still no way to know if its your plugin

eternal oxide
quaint mantle
#

maven build

eternal oxide
#

you will then have a target folder

#

your jar will be in there

quaint mantle
eternal oxide
#

Goals should be clean pacakage

quaint mantle
#

build success:

#

?

eternal oxide
#

then look in your target folder

quaint mantle
#

same error

#

and i still dont see JDA.. im now completely confused

#

i get this error when i first build

eternal oxide
#

did you get the jar from your target folder?

quaint mantle
#

i got the jar from eclipse-workspace, i dont see a target folder

eternal oxide
#

then find it.

#

there is a target folder in Nectar

quaint mantle
#

there is not

eternal oxide
#

if it built, then there is

quaint mantle
#

i was looking in the wrong folder

#

there's no jar in target

eternal oxide
#

if it said build success there will be a jar

quaint mantle
#

"build failure"

eternal oxide
#

read teh log and see why it failed

quaint mantle
#

100 errors

crimson scarab
#

does anybody know how to teleport 10 blocks forward where somebody is facin

quaint mantle
eternal oxide
#

player.getlocation().add(player.getLocation().getDirection().multiply(10))

quaint mantle
#

oh shit i forgot to do that

#

i still have spigot.jar in there somewhere

echo basalt
#

player.setVelocity

#

don't add to player.getLocation

eternal oxide
#

no tleport

#

You teleport, do NOT set velocity

echo basalt
#

Depends on what you want

#

I just came here and saw that single line of code

quaint mantle
#

scpoe provided

eternal oxide
#

get the location, add the multiplied vector, and teleport the player to that location

echo basalt
#

yeye if that's what you want, sure

quaint mantle
#

and i can delete "Referenced libraries" now?

eternal oxide
#

all depends should be from maven. No imports

quaint mantle
#

cool, im not sure why but for some reason Bukkit stringutils doesnt work with maven?

eternal oxide
#

yes it does

quaint mantle
eternal oxide
#

if you added the repo and the dependency

quaint mantle
#

yeah i added both

#

i can just make my own isBlank i guess

#

not too worried about that

eternal oxide
#

are you depend on spigot or spigot-api?

crimson scarab
#

hey my bad but multiplying directino doesn't seem to work

#

lemme try debug first though

quaint mantle
#

spigot-api

eternal oxide
#

don;t use teh bukkit libs, apache commons is packaed with spigot

quaint mantle
#

i just made my own isBlank boolean, so /shrug

eternal oxide
#

String.isEmpty()

#

String == ""

quaint mantle
#

oh 😳

prisma needle
#

Hey guys, is it possible to play the waking up animation to a player (who isn't actually waking up)?

#

as in the slight fade effect

eternal oxide
#

Possibly with packets

#

not with the API

prisma needle
#

Aha, and how would I go about using packets 😛

eternal oxide
#

You avoid them unless there is no alternative, otherwise usually ProtocolLib

quaint mantle
#

plugin.yml goes int othe project folder, yes?

#

that's how i've always done it

eternal oxide
#

in resources folder

quaint mantle
#

theres no resources folder, unless you mean src

crimson scarab
#

nvm fixed it

eternal oxide
#

not srvc

#

in your project folder at teh same level as src, add a folder called resources

#

I think

quaint mantle
#

i'll try it haha

#

yeah that didnt work

eternal oxide
#

right click teh folder and set use a source folder

#

under build path I think

#

else its in the wrong place. It may need to go under src/main

#

I use a custom build path setup so mine is different

quaint mantle
#

weird haha, i've always just had it in the project folder

eternal oxide
#

maven has a default place to look

quaint mantle
#

jar does not contain plugin.yml

eternal oxide
#

then your resources folder is in the wrong place

#

move it

quaint mantle
#

its in the same place as src

eternal oxide
#

probabl yneeds to go under src/main/resources

quaint mantle
#

ahhhhh

#

maybe if someone else could confirm where the plugin.yml goes

#

because i've seen tutorials where they havei ti n the project folder

eternal oxide
#

yeah, thats not maven

#

it 100% sits in your resources folder

#

you just need to right place for your folder

quaint mantle
eternal oxide
#

I use custom paths so I've no idea where the default location of resources is

quaint mantle
#

ah

#

i cant move resources anywhere

#

so thats really weird

eternal oxide
#

because its added to your build pat

#

remove it and you can

quaint mantle
#

is it really in my build path yikes

chrome beacon
#

Why can't you go lower?

quaint mantle
#

so it should go into my main class package?

chrome beacon
#

What won't let you

#

What stops

quaint mantle
#

what stops at 1.12

quaint mantle
#

what is that

chrome beacon
#

That's a plugin for Intellij

#

You will have to create a project without it

prisma needle
#

How can I check if if an entity with a certain scoreboard tag exists?

#

in a certain world

crimson scarab
#

how to teleport on top of a block

quaint mantle
#

idk what im doing wrong, "Invalid plugin.yml" and "Jar does not contain plugin.yml", im seriously confused and idk what to do

#

ok how does that help me

#

or provide any assistance/advice

chrome beacon
# prisma needle How can I check if if an entity with a certain scoreboard tag exists?

Since you're used to commands in datapacks and such I think you want something like this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#selectEntities(org.bukkit.command.CommandSender,java.lang.String)
It will query entities like the selectors do in a command. CommandSender being the sender, you can probably use the console and string being selector.

I'm not sure if this is any faster or slower for that matter than looping entities and checking

quaint mantle
#

are you done thinking its been two whole minutes

#

onEnable

#

because thats

#

thats hwen the plugin enables

#

actually pretty sure when it loads

vivid zodiac
chrome beacon
#

You can't

quaint mantle
#

ok you're not helping me im sorry, everything in plugin.yml is correct

crimson scarab
#

anybody know to to check if a location is beneatth the ground

chrome beacon
crimson scarab
#

ah no its like i've got a sword that teleports 10 blocks wherever your facing

#

so i need to make sure it won't send the user into teh ground

chrome beacon
#

Oh like in a block

limber dust
quaint mantle
chrome beacon
limber dust
#

Just looking at your setup on the surface it looks like the location you've specified for your plugin.yml is a invalid path

limber dust
#

Since the dir you've put it in is a sub dir of the main path which it does not belong

crimson scarab
#

ah you know what i could do

#

i could spawn an armour stand

crimson scarab
#

and check line of sight

quaint mantle
#

i saw an <includes>plugin.yml</includes> somewhere... do i add that somewhere

chrome beacon
#

Then use the result of that to teleport

crimson scarab
#

that could work

#

what does it return

eternal oxide
# quaint mantle ahh

put the resources folder where it was, next to your src folder, then add to your pom ```xml
<build>
<defaultGoal>clean package</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<resources>
<!-- Include all resources -->
<resource>
<directory>resources</directory>
<filtering>true</filtering>
<includes>
<include>.yml</include>
<include>
.txt</include>
<include>.json</include>
<include>
.properties</include>
</includes>
</resource>
</resources>

</build>```
#

thats what I use

chrome beacon
quaint mantle
#

same JDA ERROR

eternal oxide
#

now look in the jar adn see if it includes jda

quaint mantle
#

it doesnt

chrome beacon
#

Did you add the shade plugin?

quaint mantle
eternal oxide
#

shade is default in eclipse with the correct scope

quaint mantle
#

yeah i have scope compile..

eternal oxide
#

if you totaly remove teh scope line it shoudl be forced to shade

quaint mantle
#

should i move it above everything

chrome beacon
#

Since that doesn't work add the shade plugin

eternal oxide
#

no, just delete teh scope line from it

quaint mantle
#

ok

eternal oxide
#

if that doesn;t work, we'll add shade plugin

chrome beacon
#

It won't

eternal oxide
#

this is Eclipse, it doesn;t require teh shade plugin to be defined

chrome beacon
#

Eclipse shouldn't mess with how Maven works

quaint mantle
#

no jar

eternal oxide
#

it includes certain plugins by default

#

no jar = no build, read yo8r logs

quaint mantle
#

no JDA jar

#

build successful

undone axleBOT
eternal oxide
#

?paste the log so we can see if it attempted to shade

quaint mantle
#

oh ok

chrome beacon
#

Now let's add the shade plugin

eternal oxide
#

yep

quaint mantle
#

yes

chrome beacon
#

It won't shade without it. Idk where you got that from ElgarL

quaint mantle
#

"dont be a pussy"

quaint mantle
#

so ima just google

proud basin
#

Yall are still trying to fix this

quaint mantle
#

yes

proud basin
#

its been like 2 hours

eternal oxide
#

add under plugins a new <plugin>

#
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>```
#

version will probably be old

#

and xml <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions>

quaint mantle
eternal oxide
#

no, plugins

#

you do have a plugins section?

quaint mantle
#

ÿe§

#

ok i was typing "ye" but that looks cooler

eternal oxide
#

ok, then add it using the maven menue

#

right click pom, maven - add plugin

#

type in teh box shade

quaint mantle
#

wait

#

wait

#

it worked

#

ok

#

thats good

chrome beacon
#

Yeah it works

#

Now fix your token

quaint mantle
#

fuck that took way too long

#

im so sorry guys

#

lmfao

tepid parrot
#

this is probably a really dumb question, but how do i use the specialsource.jar in for a 1.17 plugin in eclipse? i haven't messed with nms before so i haven't had any reason to use it 😅 could anyone help me out? thanks!!!!

tepid parrot
#

no - should i be using that instead?

chrome beacon
#

Not instead with

#

I recommend looking up some tutorials for it. It's highly recommended for dealing with things such as specialsource

proud basin
#

Or you can use gradle

#

the choice is yours

chrome beacon
#

Yeah but maven can be easier at times

proud basin
#

🤷‍♂️

tepid parrot
#

ok! that helps a lot. thank you!!! :D

indigo iron
#

how do you check if a player is op'ed

next crater
#

what does the "logger" means in spigot?

#

is it the player that logged in?

quaint mantle
#

any JDA nerds here? any idea why jda.getGuildById(long) is null

#

the long is a guild id

#

the text channel is also null

hybrid spoke
hybrid spoke
indigo iron
next crater
#

hmmmm

#

ok thx

quaint mantle
quaint mantle
#

either way the channel is null aswell

#

im not sure why

#

i guess it also returns "Possibly-null"

#

any idea how to make it not null???

pulsar schooner
#

Have you tried other channels

quaint mantle
#

yeah

#

all null :p

#

bot has admin perms

pulsar schooner
#

Hm

#

Are you sure the bot has the right token and auth stuff?

quaint mantle
#

if it wasnt hte right token it'd give me an error about the token

#

it's all right

pulsar schooner
#

True

quaint mantle
#

jda is also set

hybrid spoke
granite beacon
#

Is there a way to wipe out a whole chunk in one go?
aside from making a schematic of a chunk and using world edit to paste it
I'm currently using

public static void clearChunkOldWay(World world, Location loc1, Location loc2){
        IBlockData air = fromMaterial(Material.AIR);
        int topBlockX = (Math.max(loc1.getBlockX(), loc2.getBlockX()));
        int bottomBlockX = (Math.min(loc1.getBlockX(), loc2.getBlockX()));
        int topBlockY = (Math.max(loc1.getBlockY(), loc2.getBlockY()));
        int bottomBlockY = (Math.min(loc1.getBlockY(), loc2.getBlockY()));
        int topBlockZ = (Math.max(loc1.getBlockZ(), loc2.getBlockZ()));
        int bottomBlockZ = (Math.min(loc1.getBlockZ(), loc2.getBlockZ()));

        for(int x = bottomBlockX; x <= topBlockX; x++) {
            for(int z = bottomBlockZ; z <= topBlockZ; z++) {
                for(int y = bottomBlockY; y <= topBlockY; y++) {
                    if (!loc1.getWorld().getBlockAt(x, y, z).getType().equals(Material.AIR)) {
                        setBlock(world, loc1.getWorld().getBlockAt(x, y, z).getLocation(), air);
                    }
                }
            }
        }
    }
hybrid spoke
quaint mantle
#

nope

hybrid spoke
#

so you've done something wrong

quaint mantle
#

yeah

#

i wonder what im doing wrong tho lol

pulsar schooner
#

Are you running it on its own or in a plugin

hybrid spoke
#

i really don't want to play guess it

#

just send in your code

quaint mantle
#

ok

hybrid spoke
#

?paste

undone axleBOT
pulsar schooner
quaint mantle
pulsar schooner
#

Maybe try restarting the whole bot?

hybrid spoke
hybrid spoke
#

wow

quaint mantle
#

the bot starts up though?

#

is there a suggestion to improve this?

hybrid spoke
#

listen for the readyevent

#

and put your guild check in there

#

to make sure that the bot is ready when getting the guilds

quaint mantle
#

okay ;o

#

im gona make some food rq but i'll read back at that after

paper viper
#

Or just in general

#

Don’t hard code values like that

pulsar schooner
#

I can't think of anything sry, is it causing a lot of lag or something?

granite beacon
#

that and also taking a long time

pulsar schooner
#

You could try putting it on a separate thread, tho that might break stuff

frank steeple
#

Rip. theres no method to remove whole chunk...

pulsar schooner
#

You could try finding the file for the chunk data and deleting it

granite beacon
#

hmm so then my only good option would be to use the FAWE API to paste a blank schematic?

frank steeple
pulsar schooner
granite beacon
#

That could lead to some issue though?

pulsar schooner
#

Not rly unless it's loaded

granite beacon
#

It would be loaded...

pulsar schooner
#

Trying to kill players?

granite beacon
#

No; they're flying above the chunk

pulsar schooner
#

And then you want to remove it? Kinda weird but ok

#

Ig fawe and your old method are the only ways then

granite beacon
#

Another question regarding FAWE/WE;
How come scheduling this on another thread other than main thru the scheduler causes it to do nothing?

public static void clearCubicArea(Location loc1, Location loc2){
        try (EditSession editSession = com.sk89q.worldedit.WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(loc1.getWorld()), -1)) {
            CuboidRegion targetRG = new CuboidRegion(new BukkitWorld(loc1.getWorld()), BlockVector3.at(loc1.getX() + 1, loc1.getY()-1, loc1.getZ() + 1), BlockVector3.at(loc2.getX(), loc2.getY(), loc2.getZ()));
            Mask mask = new ExistingBlockMask(editSession);
            editSession.setBlocks((Region) targetRG, BlockTypes.AIR.getDefaultState());
            editSession.flushQueue();
        }
    }
frank steeple
#

Sync or async thread? If async maybe it needs main thread, since blocks cant be placed async

granite beacon
#

Async

#

The weird thing is that pasting a schematic works though 🤔 on async

quaint mantle
#

should i do that intsead

frank steeple
#

Idk tbh im guessing at this point, maybe they are using something else for schematic

granite beacon
#

I guess what I'll do is make a schematic of a cleared chunk and just paste it at the corner of the chunk every time

frank steeple
#

Or make it set air instead of taking chunk schematic and keeping it in ram, that is if you can, dont remember much of fawe api

ancient oak
#

hey kennt jemand ein Plugin für ein Händler wo man Sachen verkaufen und kaufen kann ?

hybrid spoke
proud basin
#

@valid crag I think having the map is just messing everything up

#

or at least its confusing me

#

Because when I'm saving it I have to save every single one and not just the one they got a cooldown on

quaint mantle
#

@hybrid spoke i used the ReadyEvent, still nothin

crimson scarab
#

anybody know how to leap towards an entity

#

i assume set velocity

proud basin
#

Yes but is not possible to just save the one they have a cooldown on?

#

instead of all of them

#

but don't I need to do data.cooldownMap.get("cooldown") to get the cooldown?

#

unless I loop through it

#

what do you mea nthere is no cooldown?

#

mhm

#

but if I'm saving don't I need to do data.cooldownMap.get("cooldown")

#

ok

mystic sky
#

I want to remove scoreboard packets of BungeeCord, seems to work good but plugins of spigot doesn't handle good them (Any solution?)

mystic sky
#

Handles best more players.

crude charm
mystic sky
#

Increases really preformance.

slim bough
#

is there any way to get a player head and it not update to the new plays skin
if that makes sense
like if i change my head to a certain texture
is there a way to get that head and for it to never cahnge

#

i think tihs da right chanol

crimson scarab
#

how do i make the player leap in a direction they are facung

hard radish
#

how would i put a package inside a package? in eclipse

proud basin
#

right click the package and hit add package

digital plinth
#

pretty sure theres a codedred tutorial for it

#

spoonfeeding is looked down upon

fluid cypress
#

im too lazy to check, Block#isPassable() will return true with water?

eternal oxide
digital plinth
#

they are totally different

hard radish
eternal oxide
#

He was asking earlier how to make a player teleport 10 blocks forward

#

which is why I ask

proud basin
crimson scarab
#

got it working

#

anyway to make sure the players head is above a certain angle

#

i've tried checking pitch

eternal oxide
#

getLocation(), set pitch to -45, then getDirection().

quaint mantle
#

Hello i'm asking for how to keep the diamond_sword item in player inventory on death
my code:

for (ItemStack item : e.getDrops()) {
            if (item.getType().equals(Material.DIAMOND_SWORD)) {
                    e.getDrops().remove(item);

            }```
#

but that not working

#

can some one help please?

eternal oxide
#

compare a Material enum with ==

#

also use an iterator, you will throw an exception removing from a Collection you are looping over

stone sinew
#

^^^ or lambda e.getDrops().removeIf(item -> item.getType() == Material.DIAMOND_SWORD)

ivory sleet
#

Not the collect() part

#

But yeah removeIf(predicate) is also fine

stone sinew
#

Oh yeap my bad lol Was thinking setting the list

quaint mantle
#

i'll try , btw thx for helping me

#

not working xd

stone sinew
#

Show us your code

quaint mantle
#

okay

digital plinth
#

is to check and see if the dropped item is a diamond sword

#

and if it is

#

it removes it

#

not keep it

#

?

quaint mantle
#

    @EventHandler
    public void onD(PlayerDeathEvent e) {
        Player player = (Player) e.getEntity();
        Player killer = (Player) e.getEntity().getKiller();
        e.getDrops().removeIf(item -> item.getType() == Material.DIAMOND_SWORD);
        if (killer instanceof Player) {

            Main.getInstance().getAPI().addKills(killer, 1);
            Main.getInstance().getAPI().addDeath(player, 1);
        } 

    }```
#

i just want to keep diamond sword when player death @digital plinth

#

and remove other items

ivory sleet
#

!=

quaint mantle
#

well 1m

digital plinth
#

where is the item variable created

#

uhh

quaint mantle
#

no not working 😦

quaint mantle
# ivory sleet !=
e.getDrops().removeIf(item -> item.getType() != Material.DIAMOND_AXE);```
eternal oxide
#

are you able to affect the drops at all?

ivory sleet
#

Idk maybe it just provides a view

quaint mantle
#

i have tried the axe

eternal oxide
#

did you register the Listener?

ivory sleet
#

Remove the items through the players inventory maybe

quaint mantle
eternal oxide
#

Many don;t

ivory sleet
#

for (ItemStack stack : e.getEntity().getInventory().getStorageContents()) {
//Do what has to be done
}

#

Well you might want a fori loop

#

Uh my bad

quaint mantle
#

it's ok

ivory sleet
#

ItemStack contents = e.getEntity().getInventory().getStorageContents();
for (int a = 0; a < contents.size;a++) {
// to remove do this;
e.getEntity().getInventory().setItem(i,null);
}

#

Jesus I won’t spoonfeed again sorry

stone sinew
#

Debug.... also its e.getDrops() already removed the item from the inventory?

eternal oxide
#

test with getDrops().clear() to see if it can affect the drops.

quaint mantle
#

okay sir

#

back sorry i was doing some thing.

#

i'll try right now

quaint mantle
eternal oxide
#

then it seems getDrops is now only a clone. It no longer affects dropped items

quaint mantle
#

yes it is

eternal oxide
#

you will have to modify it in teh drop event

#

PlayerDropItemEvent, test if the player is dead

quaint mantle
#

i think PlayerDropItemEvent is for when player dropping item by clicking "Q"

eternal oxide
#

it should be for any time they drop

quaint mantle
#

what if i did keepinventory and clear all items except the sword?

eternal oxide
#

nope

#

teh JD says setting keep inventory will nto stop drops

#
setKeepInventory
public void setKeepInventory​(boolean keepInventory)
Sets if the Player keeps inventory on death.

This doesn't prevent the items from dropping. getDrops().clear() should be used stop the items from dropping.

Parameters:
    keepInventory - True to keep the inventory

quaint mantle
#

okay i'll try playerdropitemevent

eternal oxide
#

However getDrops() now seems to be a clone so I'm guessing they moved the functionality to the drop event

quaint mantle
#
    @EventHandler
    public void onDrop(PlayerDropItemEvent e) {
    Player p = e.getPlayer();
    if (p.isDead()) {
        e.setCancelled(true);
    }
    }```
#

i'll test

smoky finch
eternal oxide
#

What is yoru code currently doing that it should not?

smoky finch
#

The particles need to rotated while facing the player, let's say 45 degrees like I showed in the POV

vestal dome
#

is there an event that is called when an entity despawns?

eternal oxide
smoky finch
#

it is spawning the particles in the player's direction, but I don't know how to rotate them relative to the player's direction.
This is how you see the particles if that code runs.

--------------

It's a semicircle from another angle, but that's just the POV.

eternal oxide
#

I don;t understand a line of dashes

smoky finch
#

Those are representing the particles

eternal oxide
#

ok

eternal oxide
smoky finch
#

That's correct. I tried adding the degrees direction to the rotateX double, but that obviously doesn't work as it's a constant number. It's not relative to the player's direction.

eternal oxide
#

The only change I made was to use the Bukkit Vector class

#

it works fine for me

smoky finch
#

I'm also using vectors?

#

What did you change to make it rotate 45 degrees?

eternal oxide
#

yes, but your rotateAroundX and Y is not Bukkits

smoky finch
#

Oh that doesn't matter yeah, they're the same

eternal oxide
#

?paste

undone axleBOT
eternal oxide
#

it is always in front of the player

smoky finch
#

Alright, yes it does, but can you screenshot what you're seeing?

eternal oxide
#

You can join palmergames.com:1 to see for yourself

smoky finch
#

Sorry I'm not really in the situation to do that

#

Can't you just take a quick screenshot?

eternal oxide
quaint mantle
#

hey hey, any idea why my holograms & npcs arent deleting? (custom stuff, sucks but it gets the job done)

#

i have a boolean just to make life a little easier

#

returns true for NPCs and holograms

#
public boolean isNpc(Entity e){
        Bukkit.getServer().broadcastMessage("" + (e.isCustomNameVisible() && e.getCustomName() != null));
        return (e.isCustomNameVisible() && e.getCustomName() != null);
    }
#

and so obviously that works

#

(debug message for broadcast ignore that)

#

however, when i try to loop the entities of a world on the world load event,,,, nothing happens

#

i've also tried the ServerLoadEvent, where i actually spawn the NPCs and holograms

#

so idrk what's causing the issue..

smoky finch
#

Remember the dashes

#

So the two points of the circle should still face the player

eternal oxide
#

do you mean a straight line and not an arc?

smoky finch
#

No that's just from the player's POV :/
I didn't draw the semicircles bulge because that's supposed to be outward where the player is looking

#

Because you'll see a line if you change loc to player.getEyeLocation()

eternal oxide
#

Then I have no idea what you are trying to achieve. That red line means nothing to me.

#

up one side but not the other?

smoky finch
#

Ok let's just think about it like this

#

Rotate the circle in any direction in any degrees relative to the player's direction.
What I mean by "relative to the player's direction" is that when you look in different directions, the circle should look the same.

#

I really can't explain it any better than this

eternal oxide
#

I don;t understand. It does move with the player and renders depending on teh players direction

smoky finch
#

It does yes, it does indeed

#

But rotate it

#

Rotate it to any other angle

eternal oxide
#

so not relative to the ground, but slanted?

smoky finch
#

No, rotate it relatively.

eternal oxide
#

Yeah, I'm not understanding at all

smoky finch
#

bro

eternal oxide
#

the player is always perpendicular to the ground

smoky finch
#

Ignore the ground. Make the circle look like it's coming from up to down, instead of left and right

#

You should understand that, like please lol

eternal oxide
#

No, your description is terrible 😦

proud basin
#

So if I print data.cooldownMap in the current method it's in it becomes null but if I do it when a player joins it's not null so im wondering why is this happening. When the player joins im adding the player data into the map.

smoky finch
eternal oxide
#

Yes I'm English, with over 40 years of programming experience. Your description is simply terrible

#

YOu say relative to teh player. teh player is upright so you only have pitch and yaw of the head

#

you currently have a half circle relative to teh players direction.

#

do you mean you want to rotate teh Z axis?

smoky finch
#

Yes, I do, but it's currently in the player's yaw direction, make it look like it's in the pitch direction.

#

Which basically means, not right and left, but up and down

#

I could simply just switch the x, y myself, but that's not really what I want.

#

I can't change the code for every single angle that I want, can I

quaint mantle
#

why cant you just add to it every couple of ticks

#

wait

eternal oxide
#

So you want it to come from under his feet and curve up over his head?

smoky finch
#

yes exactly!!

quaint mantle
#

use some math stuff

smoky finch
#

finally

eternal oxide
#

You could have just said that 🙂

proud basin
#

Also the player isn't null

#

oh

#

fixed it

smoky finch
eternal oxide
#

Still looking

smoky finch
#

Alright, I really appreciate it ^^

hasty prawn
#

@smoky finch so you just want to tilt the semicircle up on the left side basically?

smoky finch
#

Exactly, I just want to rotate it in the yaw direction

hasty prawn
#

Well you have the start and end points. You can get a slope from that and apply that slope on each particle step, adding to the y coordinate.

#

The end point would just be how high you wanted it to tilt basically.

smoky finch
#

Surely there should be a simpler way using the rotation methods?

eternal oxide
#

ok got it

#

?paste

undone axleBOT
eternal oxide
#

underfoot to above head

quaint mantle
#

how would I store quest data via SQL?

vivid zodiac
#

Who know how can i lock slot armor ?

quaint mantle
eternal oxide
#

@smoky finch is that what you wanted ^?

young knoll
#

Stick curse of binding on it :p

vivid zodiac
quaint mantle
#

set the event cancelled = true

#

so event.setCancelled(true);

vivid zodiac
#

its like a return ?

quaint mantle
#

what?

vivid zodiac
#

i don't know what do you mean by Cancelled event

quaint mantle
#

?paste send your code here

undone axleBOT
proud basin
#

@valid crag I got everything setup to my liking and got it working 🥳

vivid zodiac
#

I just have code to add armor, but no to lock slots

quaint mantle
#

so create a InventoryClickEvent

smoky finch
#

Wait did you just add the degrees to the yaw???

#

That's all it took?

eternal oxide
#

and rotate on Z

smoky finch
#

oh

#

Oh I see, I tried adding the number directly to the yaw before and it was giving weird results. So I just had to rotate the Z instead

#

I still don't get the logic behind rotating Z instead of X but I'm gonna figure it out

#

Thanks a lot again. Sorry if my explanation was too confusing

eternal oxide
#

fixed naming in edit

quaint mantle
vivid zodiac
#

Oh okayy, thx you

quaint mantle
#

does anyone know how to save quest data via sql?

vivid zodiac
#

that didnt work xd

proud basin
quaint mantle
#

like breaking blocks and killing mobs

#

but some quests have multiple tasks

lost matrix
quaint mantle
#

they're just simple
quests:
quest1:
tasks:
- "mine:5:DIAMOND_ORE"
- "kill:5:SHEEP"
rewards:
- "give %player% diamond 1"

#

just simple like that

lost matrix
#

Oh if you have simple String serialisation like that then its quite easy.

quaint mantle
#

yes but I also need to save progress

lost matrix
#

If the progress is always deterministic and quantifiable then you can just modify your current model like this for example:

quests:
  quest1:
    tasks:
      - "mine:2/5:DIAMOND_ORE"
      - "kill:1/5:SHEEP"
    rewards:
      - "give %player% diamond 1"
vivid zodiac
#

but ty 😄

quaint mantle
lost matrix
#

As you have lists you probably need to be a bit tricky. Unless you want to properly construct relational data. Then you would need multiple tables

#

It could be as simple as:
| quest_name | owner | tasks | rewards |

quaint mantle
#

well I dont need to save all that

#

the quests will be set via a config file

#

I just need to save task data via sql

lost matrix
#

So the quests are static and you only want to save the progress?

quaint mantle
#

yes

#

sorry for not explaining it better earlier

young knoll
#

I feel like quests may fit better with Nosql

quaint mantle
#

the client requested mysql

#

so im kinda stuck with it

lost matrix
# quaint mantle yes

Ah. Then you need a way to identify a single task by assigning it a unique identifier.

tasks:
  killPigTask: "kill:5:PIG"
  mineDiaTask: "mine:5:DIAMOND_ORE"
quests:
  coolQuest:
    tasks:
      - killPigTask
      - mineDiaTask
    rewards:
      - "give %player% diamond 1"

This way you can save player specific progress with
| quest_id | user_id | progress |

quaint mantle
lost matrix
#

"killPigTask:2#mineDiaTask:1" for this example.

#

But this also depends on your data model...

quaint mantle
#

so could i elimate the seperate tasks and do the column to be "kill:1/5:PIG#mine:5:DIAMOND_ORE"?

#

because there is like 70 quests and I dont want the client to have to go back and forth in the config if i dont have to yk

lost matrix
#

This is also possible:
| quest_id | task_id | user_id | progress |

| coolQuest |killPigTask| some_id | 3 |
| coolQuest |mineDiaTask| some_id | 1 |

quaint mantle
#

oooh i like that better

#

okay tysm

hard radish
#

sent in dms

proud basin
#

np

quaint mantle
#

Im doing a for loop through a List<String> how do i get the index of it in the for loop?

proud basin
#

.size?

quaint mantle
#

the index of the item in the for loop?

proud basin
#

oh

eternal oxide
#

You can;t get the index from the entry itself

lost matrix
quaint mantle
#

yeah okay ty

lost matrix
#

And dont use i or e or p. Single letter variables are dirty trash regarding clean code.

quaint mantle
#

^

lost matrix
#

Its still a single letter...

#

The names should be meaningful ofc -.-

#

also they should be descriptive and self documenting

#

Ah i see

quaint mantle
#

anyone here familiar with hikari?

lost matrix
#

Its pretty straight forward

quaint mantle
#

it's not inputting it into the database and it's not giving any errors

lost matrix
#

Hikari is just providing a bunch of connections and shouldnt have an impact on your queries.
Show some code pls.

quaint mantle
#

wait i think i found it out

#

I'm using a %prefix% variable for table prefixes and i didnt set it...

#

yup

rugged topaz
#
    @EventHandler
    public void bounce(PlayerMoveEvent e) {
        //if player enters region (already got the code for this)
            Vector velocity = e.getFrom().toVector().subtract(e.getTo().toVector());
            e.getPlayer().setVelocity(velocity);
        }
    }

this causes the player to glitch terribly, does anyone know of a solution to bounce the player back?

young knoll
#

I mean setting their velocity is going to trigger the event again

#

And you basically end up setting their velocity to opposite directions over and over

lost matrix
proud basin
#

If there isn't value that is equal to what ever I put into for REPLACE INTO will a new value be made still?

proud basin
#

ah yes I think so

lost matrix
#

It can be used in this context: If exists -> update, else -> insert

young knoll
#

On duplicate key update is still mean

lost matrix
#

What do you mean by "mean"?

young knoll
#

It increments the primary key even if it replaces, which isn’t a big deal but still

#

It bothers me

young knoll
#

At least in MySQL it does

#

Don’t think it does in SQLite

lost matrix
rugged topaz
#

no, just checking distanceSquared of a certain location to tell if they're in proximity or not

lost matrix
#

Maybe just maintain a transient Set<UUID> inside your region where you track what user entered already. This way you can also get every user within a region really quick.

lost matrix
#

Do you have multiple "regions"?

rugged topaz
#

yea ig

lost matrix
#

Whatever you use: You need a toggle system and a filter in your event.
Maybe even create custom events:
UserEntersRegionEvent
UserExitsRegionEvent
And listen to them.

rugged topaz
#

is there any sort of alternative solution like to put the knockback velo into cooldown after doing it once, so that it verifies the player has been fully knocked back?

lost matrix
#

But thats a bit hacky

#

But it should work

#

playerData is null

proud basin
#

was about to test that

lost matrix
#

If this is the last stack

proud basin
#

ugh god damn it my map is empty

young knoll
#

Empty is fine

#

Null is not

proud basin
#

IM SO STUPID

#

I have SELECT * FROM kitCooldown WHERE UUID = ? when there is no data for that user

#

oh wait

#

no im not

rugged topaz
# lost matrix Thats also possible. Just a Map<UUID, Long> to check the last timestamp he was k...
public class BounceListener implements Listener {
    Map<UUID, Long> lastKnocked = new HashMap<>();

    @EventHandler
    public void bounce(PlayerMoveEvent e) {
        if (lastKnocked.containsKey(e.getPlayer().getUniqueId())) {
            if (Instant.now().toEpochMilli() - lastKnocked.get(e.getPlayer().getUniqueId()) < 1000) {
                return;
            }
        }
        if (Core.region.equals("blacklisted")) {
            Vector direction = e.getPlayer().getLocation().getDirection();

            e.getPlayer().setVelocity(direction.setY(-0.5).multiply(-2));
            lastKnocked.put(e.getPlayer().getUniqueId(), Instant.now().toEpochMilli());
        }
    }
}

got this down, probably needs some optimizations but issue with the velo, unless the player is jumping it's just gonna knock them sorta back into the ground moving them probably 4/10th of a block fixed, but lmk if it needs any changes

lost matrix
rugged topaz
#

that's true

lost matrix
#

Get his velocity and invert it instead of his looking direction

azure dust
#

Looking for a plugin dev who's worked with prisons before. Willing to pay. Pm me

eternal oxide
#

?services

undone axleBOT
azure dust
rugged topaz
#
            Vector pVelo = e.getPlayer().getVelocity().multiply(-1);

            e.getPlayer().setVelocity(pVelo.setY(-0.45).multiply(-1.5));

doesn't propel me in the opposite direction, just launches me up

lost matrix
#

.setY(-0.45) ?

eternal oxide
#

you multiply by -1 then by -1.5, plus add Y

lost matrix
#

Vector pVelo = e.getPlayer().getVelocity().multiply(-2).add(0, 0.4, 0);
This should launch him back and up a bit.

#

e.getPlayer().setVelocity(pVelo);

proud basin
#

What did I do wrong sql INSERT INTO kitCooldown (UUID, Time, Cooldown) VALUES (?, ?, ?) ON DUPLICATED KEY UPDATE UUID = ?, Time = ?, Cooldown = ? ```
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DUPLICATED KEY UPDATE UUID = '631b2936-7672-474d-9b4f-3366504065f', Time = 1628' at line 1

rugged topaz
#

otherwise the ide gives an error

lost matrix
proud basin
#

oh man java.sql.SQLException: Parameter index out of range (6 > number of parameters, which is 5).

#

yes i know

lost matrix
#

Not enough placeholders ?

proud basin
#

no

#

too many

lost matrix
#

"6 is bigger than number of parameters, which is 5"
So to few placeholders

#

Wait

#

Might be too many

#

Eh im tired

proud basin
#

...

proud basin
#

are you kidding me > [04:31:43 WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DUPLICATED KEY UPDATE UUID = '6312936-7672-474d-9b4f-3366504065f0', Cooldown = '' at line 1

lean gull
#

pls

lost matrix
lost matrix
lean gull
#

i don't want final doe, i wanna add click and hover

lost matrix
lean gull
#

also ur code doesn't work

lost matrix
#

It does. You are probably still using the wrong package

lean gull
#

wdym wrong package

#

is there another meaning to package apart from folders for classes?

#

am i missing something here?

lost matrix
#

You imported java.awt.TextComponent

lean gull
#

uh huh

#

and?

#

doesn't let me import something else

lost matrix
#

And that is used for GUIs in plain Java. Desktop applications so to speak. It has nothing to do with spigot or minecraft.

lean gull
#

do i need bungee for this

lost matrix
#

No. The package you want is on the spigot classpath

quaint mantle
#

Copy pasting large/small region with custom Extension File
Hello! I want to copy-paste large/small region area with my custom extension file.
in google, they saying just use worldedit and they don't giving solution. (without worldedit)

quaint mantle
quaint mantle
#

uhh thanks you but i dont want use worldeidt

lost matrix
#

Ah i see. Then its quite complicated depending if you want to support the full NBT spectrum.

quaint mantle
#

It's time for a giant adventure.

crimson scarab
#

hey all

#

i've made a custom set of armor

#

and i'm just wondering how to implement a full set bonus

#

giving people in rain or water potion effects

lean gull
#

i'd check for armor equip / unequip

#

then set variables for when they have it, and then give them stuff when they have everything

lost matrix
crimson scarab
#

alright

lean gull
#

btw i still need help

proud basin
crimson scarab
#

whats your issue buenny

lean gull
#

trying to do hoverable and clickable messages

proud basin
#

oh im actually annoyed

#

I put DUPLICATED instead of DUPLICATE

solid glade
#

New to Spigot, how do I execute a command from the plugin? Like, I want to shift, and have it execute a command, but not entirely sure how to do the execute a command part

lost matrix
solid glade
#

Ooh

#

Thanks a bunch!

crimson scarab
#

got an issue here two identical item stacks are not equal

hybrid spoke
crimson scarab
#

this is the item stack

#
    public ItemStack NeptuneBoots() {
        ItemStack NB = new ItemStack(Material.LEATHER_BOOTS);
        LeatherArmorMeta meta = (LeatherArmorMeta) NB.getItemMeta();
        assert meta != null;
        meta.setColor(Color.fromRGB(0, 87, 123));
        meta.setUnbreakable(true);
        meta.setDisplayName(ChatColor.LIGHT_PURPLE + "Neptune's Boots");
        meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
        meta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 4, false);
        meta.addEnchant(Enchantment.THORNS, 3, false);
        meta.addEnchant(Enchantment.PROTECTION_FALL, 4, false);
        meta.addAttributeModifier(Attribute.GENERIC_ARMOR, new AttributeModifier("generic.armor", 6.25, AttributeModifier.Operation.ADD_NUMBER));
        ArrayList<String> lore = new ArrayList<>();
        lore.add("");
        lore.add(ChatColor.GOLD + "Full Set Bonus: Oceanborn");
        lore.add(ChatColor.GRAY + "While in water or during rain,");
        lore.add(ChatColor.GRAY + "increase attack damage along with");
        lore.add(ChatColor.GRAY + "movement speed by 50%.");
        lore.add("");
        lore.add(ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "MYTHIC BOOTS");
        meta.setLore(lore);
        NB.setItemMeta(meta);
        return NB;
    }
#
@EventHandler
    public void onArmourEquip(InventoryClickEvent event) {
        Armours armours = new Armours();
        Player player = (Player) event.getWhoClicked();
        System.out.println(player.getInventory().getHelmet().equals(armours.NeptuneCrown()));
        if (player.getInventory().getHelmet().getItemMeta().equals(armours.NeptuneCrown().getItemMeta()) && player.getInventory().getChestplate().equals(armours.NeptuneChestplate()) && player.getInventory().getLeggings().equals(armours.NeptuneLeggings()) && player.getInventory().getBoots().equals(armours.NeptuneBoots())) {
            BukkitTask applyEffect = new BukkitRunnable() {

                @Override
                public void run() {
                    if (player.getInventory().getHelmet().equals(armours.NeptuneCrown()) && player.getInventory().getChestplate().equals(armours.NeptuneChestplate()) && player.getInventory().getLeggings().equals(armours.NeptuneLeggings()) && player.getInventory().getBoots().equals(armours.NeptuneBoots())) {
                        player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 5, 3));
                        player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 5, 2));
                    } else {
                        cancel();
                    }
                }

            }.runTaskTimer(plugin, 0L, 100L);
        }
    }
}
crimson scarab
#

scam?

chrome beacon
#

Yes

#

@vagrant stratus ^^

#

Oh it's in every channel

crimson scarab
#

seems like a self bot

#

are they all sent on the same minute

chrome beacon
#

That's probably an account stolen from that scam

#

Do NOT click that link

solid glade
#

Is it possible to have player.PerformCommand not send a message to the player?

crystal pike
#

I'm getting this, while trying to package my plugin Source option 5 is no longer supported. Use 7 or later.

solid glade
#

I realized that was a lil vague