#help-development

1 messages · Page 1445 of 1

errant drift
#

remove patches for tnt cannons then boom

#

FACTIONS 1.16

dense kestrel
#

There isnt a good jar for 1.16 Factions

#

period XD

#

plus, none of the players would wanna swap anyways

ivory sleet
#

Faction is one the most unoriginal by now. It has stayed the same for almost a decade now with just minor insignificant feature additions.

dense kestrel
#

ummmm

#

its a lot different now XD

#

iv played it for 8years

#

its still changing

ivory sleet
#

It really isn’t they entire mode depends on tnt cannoning which if I’m correct hasn’t changed

#

It’s not like something else is used nowadays

dense kestrel
#

new cannoning concepts

glossy scroll
#

cannoning nonetheless?

ivory sleet
#

That’s not a significant change on its own

glossy scroll
#

Never found factions enjoyable

dense kestrel
#

completely different.

ivory sleet
#

Okay name some new cannon concepts

errant drift
#

!!!500 DOLLAR SERVER JAR!!!!

ivory sleet
#

Which isn’t just a tweak of something already existing

dense kestrel
#

U Fusions, Up Downs, Webbust nukes, Overstackers

ivory sleet
#

Wouldn’t say that’s super new

dense kestrel
#

i mean, they are all within the past year

ivory sleet
#

Anyways none of them aren’t something which pioneers factions turning it into something new imo

errant drift
#

it's just a different way of blowing things up which either way shit is still being blown up

ivory sleet
#

What if factions would add siege machines or something

dense kestrel
#

wdym

ivory sleet
#

that would be very interesting for instance

dense kestrel
ivory sleet
#

Why not

errant drift
#

That's pretty much what the creeper eggs are

ivory sleet
#

Creeper eggs are bombs literally

dense kestrel
#

because raids involve 6+hours of forcing a base while people patch and you try to counter cannon... how would a siege machine even work?

opal juniper
dense kestrel
#

change the 2 to like a 3 or a 4 to change where it is, i forget which one is for the middle of the screen

ivory sleet
dense kestrel
errant drift
#

Comp factions = pay to win

ivory sleet
#

No not any on fac servers because it has literally never been done if I’m correct

dense kestrel
#

:/

ivory sleet
#

Or maybe some poor attempt but that’s beside the point

tacit drift
#

minesuperior too

opal juniper
#

How bad is doing everything in one class anyways

vocal shuttle
#

archon is p2w lol

ivory glacier
#

Is it possible to get the hostname in AsyncPlayerPreLoginEvent?

rotund pond
#

?paste

queen dragonBOT
subtle kite
quaint mantle
#

enyone a dev

#

i need a dev

heady garden
#

@dense kestrel long time no see

violet depot
#

try {
java.lang.reflect.Field id = newEntity.getClass().getDeclaredField("a");
id.setAccessible(true);
id.set(newEntity, player.getEntityId());
}
catch (Exception e) {

       return true;
    }
   
    PacketPlayOutEntityDestroy oldPlayer = new PacketPlayOutEntityDestroy(new int[] { entity.getEntityId() });
   ((CraftEntity) entity).getHandle().playerConnection.sendPacket(oldPlayer); Error --> playerConnection cannot be resolved or is not a field
   ((CraftEntity) entity).getHandle().playerConnection.sendPacket(newEntity);
 
}
chrome beacon
heady garden
#

anyone know how I can store my banlist on mysql?

violet depot
heady garden
#

so all servers on bungeecord share the same ban list?

chrome beacon
dense kestrel
#

@heady garden hey?

#

ok just checked DMs

#

i know who ya are now XD

heady garden
#

cool haha

dense kestrel
#

one sec

#

ima look

chrome beacon
#

I'd recommend using Protocollib instead of working with NMS

#

It wil make your life easier especially if you don't know what you're doing

dense kestrel
#

is entity a player?

violet depot
quaint mantle
#

lmao i just bought the que skip on 2bt2

ivory sleet
#

Only CraftPlayer::getHandle (it’s an EntityPlayer or smtng) has the playerConnection field

quaint mantle
#

i get on in 10 min

chrome beacon
dense kestrel
ivory sleet
#

?

#

Yes player is an entity

tardy delta
#

how can i get the itemMeta of a block that's placed down?
(block that is right-clicked)

ivory sleet
#

But an entity may not be a player entity

dense kestrel
#

did you check that?

#

thats the only issue i see

violet depot
dense kestrel
#

ok

#

just make sure it is

#

and that should fix your issue

tardy delta
#

how can i get the itemMeta of a block that's placed down?
(block that is right-clicked)

dense kestrel
#

on BlockPlaceEvent

ivory sleet
#

if (entity instanceof CraftPlayer) {
((CraftPlayer) entity).getHandle().playerConnection.sendPacket(...);
}

tardy delta
#

uhh

ivory sleet
#

@violet depot now please compare

violet depot
dense kestrel
#

it needs to be a player

ivory sleet
#

If it’s not then it won’t have the field playerConnection thus it cannot receive packets

tardy delta
unkempt peak
tardy delta
#

no?

tardy delta
#

yea

dense kestrel
#

get the item in hand on BlockPlaceEvent

#

thats the block they are placing

#

(the block is still in their hand when the event is called and is only placed after your code runs)

livid tundra
#

does this execute a function every half second?```java
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

volatile boolean check_tick;

@Override
public void onEnable() {
    check_tick = true;
    //events go here
    while (check_tick) {
        //function to be executed();
        try {
            wait(500,0);//executes once every half second
        }
        catch (InterruptedException ignored) {
        }
    }
}

@Override
public void onDisable() {
    check_tick = false;
}

}

dense kestrel
#

NO

#

dont do that

ivory sleet
#

Why is that volatile

dense kestrel
#

use scheduler

livid tundra
livid tundra
ivory sleet
#

Probably because it thinks you’re working in a multithreading environment with that variable

livid tundra
#

well, there are some events

tardy delta
# dense kestrel get the item in hand on BlockPlaceEvent

Well in fact in want to store an UUID (converted to string )inside the persistant data container and i tried to make a container
PersistentDataContainer container = itemMeta.getPersistentDataContainer();
but i can't reach the itemMeta

dense kestrel
tardy delta
#

then i want to use something like this
if(container.has(key , PersistentDataType.STRING)) {

dense kestrel
livid tundra
#

untill the server goes offline?

dense kestrel
#

yea

livid tundra
#

shouldn't it be Bukkit.getScheduler().runTaskTimer(this,function here,10,0)?

tardy delta
#

do I really need to call the method .getPersistantDataContainer of an itemMeta object? (I cant easily get the itemmeta)

dense kestrel
livid tundra
#

no, shouldn't the 10 and 0 be reversed?

dense kestrel
#

the first number is the delay before the first run

#

the second number is how often it repeats

livid tundra
#

ok, thanks!

dense kestrel
#

also

livid tundra
#

the period time unit is ticks, right?

unkempt peak
#

Yes

dense kestrel
#
        new BukkitRunnable() {
            @Override
            public void run() {
                if () {
                   cancel(); 
                } else {
                    //code
                }
            }
        }.runTaskTimer(plugin, 0, 10);

you can do that too @livid tundra

unkempt peak
#

Any1 need help?

dense kestrel
#

np

unkempt peak
#

I always use BukkitRunnable

dense kestrel
#

i use BukkitRunnable if i need the task to be canceled at any point

#

otherwise i dont use it

unkempt peak
#

Yeah I always want to be able to cancel it

livid tundra
dense kestrel
#

fair enough, i mainly use scheduler for infinite loops though

dense kestrel
livid tundra
#

so it's ```java
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

import java.util.ArrayList;

public class Main extends JavaPlugin {

@Override
public void onEnable() {
    // Plugin startup logic
    OnTick ontick = new OnTick(getServer().getWorlds().get(0),list_of_player_blocks);
    //events
    new BukkitRunnable() {
        @Override
        public void run(){
            if(false){
                return ;
            }
            else {
                ontick.creepersExplode();
            }
        }
    }.runTaskTimer(this,0,10);
dense kestrel
#

yea

#

you dont have to use cancel();

#

i just put it as an example

livid tundra
#

is return ; a suitable subsitute?

unkempt peak
#

No

dense kestrel
#

umm

tardy delta
#

is there someway to get the ItemMeta of a block, a player rightclicked on?

unkempt peak
#

That will return back to the beginning of the loop

dense kestrel
#

do you know how to code @livid tundra ..?

livid tundra
cinder thistle
dense kestrel
#

ahh

unkempt peak
#

Also if(false) is useless

cinder thistle
#

Read them and follow them

unkempt peak
#

return; is dead code

livid tundra
cinder thistle
#

It should say it’s from the 90s, the standard doesn’t change much so it’s still mostly up to date

cinder thistle
#

I can’t think of anything that’s changed since then and I also can’t find more updated ones

dense kestrel
#

ima go to bed, talk to yall later

unkempt peak
cinder thistle
#

Is that so?

#

What you’re describing sounds like continue

unkempt peak
#

Not for runnables

#

Runnables have a cancel(); method

cinder thistle
#

Ah yes ofc

unkempt peak
#

Returning a runnable ends that iteration

tardy delta
#

can i convert an Itemstack to Block?

#

(ItemStack) event.getClickedBlock() inside eventHandler

chrome beacon
#

You mean block to itemstack?

#

If so just create a new ItemStack with the material (getMaterial) of the block

#

or you can break the block to get correct drops

royal hawk
#

Guys hello i need help i have eg this Map<String, Object> element:
{type=DIAMOND_SWORD, meta={displayName= Hello sword , lore=[Sword top , Nice sword . ], enchantments={Enchantment[16, DAMAGE_ALL]=5.0, Enchantment[34, DURABILITY]=3.0, Enchantment[70, MENDING]=1.0, Enchantment[71, VANISHING_CURSE]=1.0}, repairCost=15.0, hideFlag=0.0, unbreakable=false, unhandledTags={}}}

is serialized map object i convert him to json (lib Gson) later unserialize this object to itemstack.
after which all itemmeta data disappears

chrome beacon
#

Why are you serializing it with Gson?

royal hawk
#

Nono

#

I use default itemstack method.

chrome beacon
#

oh

sharp bough
#

hwo do people make inv listeners? i have always used if(event.getView.getTitle.equals("name of the inv"){ do stuff}
but i saw a few times this is not a secure way of doing it since if another plugin makes a gui named name of the inv then my plugin will fire

royal hawk
#

and converting to json for save to db

sharp bough
#

is there a direct way to link an inv to a listener?

#

im in 1.12

royal hawk
chrome beacon
#

Not sure

sharp bough
#

i already fixed it by making the listener in the same class as the gui creation

#

so i can do private Inventory inv;

minor garnet
#

does anyone know how I can get a top of a line from a yaml configuration, but checking if it contains specific substrings or if there are two

example:

sharp bough
#

and if(event.getinv != inv) return

#

thanks tho

urban trout
#

my other commands work but this one doesnt

chrome beacon
#

Make sure you added it to your plugin.yml

sharp bough
#

could someone tell me why this event is not running?

#

the gui buils but the event doesnt fire

glossy barn
#

register it in the main class

#

(the class extending javaplugin)

sharp bough
#

i already registered it in the main class

cold pawn
#

dose this seem to be about right?

sharp bough
#

public void eventRegister(){
getServer().getPluginManager().registerEvents(new CreateGeneralGUI(), this);
}

wraith rapids
#

no

#

Player is not an event

#

Player is a Player

chrome beacon
#

Also why are you comparing Enum value with null

cold pawn
#

ok good to know

wraith rapids
#

DamageCause.FIRE_TICK is an enum constant

#

it will never be null

chrome beacon
#

^^

#

And save getCause to a variable and compare that

wraith rapids
#

it will never be anything other than the enum constant described by DamageCause.FIRE_TICK

cold pawn
#

my ide says I need to insert a null checker

sharp bough
wraith rapids
#

you're misreading it

#

because that's not how you null check

cold pawn
wraith rapids
#

that is not a condition

chrome beacon
#

Yeah read the error

#

Not the "quick fix"

wraith rapids
#

if (something == DamageCause.FIRE_TICK)

#

is what you're looking for

#

in your case, you've substituted "something" with null

#

which is stupid

#

because FIRE_TICK will never be null

cold pawn
#

oh my bad

wraith rapids
#

and the result is always the same because you are comparing 2 constants

glossy scroll
#

getKeys(false).size?

quaint mantle
wraith rapids
#

structure your configuration so you don't need to hack at it

quaint mantle
#

the event ur trying to get also doesn't exist

quaint mantle
#

try public void playerDamage(EntityDamageEvent event)

#

then check if entity is a player

minor garnet
glossy scroll
#

?xy

queen dragonBOT
mystic tartan
#

is there any reason bukkit.getplayer(uuid) would ever fail if the player is online? I'm using a valid uuid of an online player, but it is still returning null. The server isn't on online mode so I can test two clients, could this affect it?

sage swift
#

yes

#

uuids in online vs offline mode are different

mystic tartan
#

however it is using the offline mode uuid

wraith rapids
#

just buy two accounts bro

sage swift
#

offline mode is yucky ¯_(ツ)_/¯

wraith rapids
#

offline mode is haram

#

and you're totally evil for using it

mystic tartan
#

well i'm not asking for ethical help

mystic tartan
wraith rapids
#

it should still work

#

as it doesn't do any requests to mojang or anything

#

seems rather strange for it not to work

sage swift
minor garnet
#

@glossy scroll this is coming out of my psychological guy

vestal dome
#

I have this code...

#

and my console is spammed with the setting score message.. but nothing else.

vestal dome
#

and I pass non-null scoreboard name & lines, yet, it still does not work

oblique ibex
#

Hey Guys,
Quick question, since one of the more recent versions of Spigot my EventListeners for custom events that I register no longer work.
I send an event from plugin A, plugin B listens to that event.
I send out the event but it never reaches the listener. If I revert back to a version of let's say the 10th of May it works.
Anyone else encountered this?

ivory sleet
#

not at all

vestal dome
#

what about me....

#

laughs

heady garden
#

How can I save my banlist to SQL instead of the .json

wraith rapids
#

supposedly spigot wants to enforce some classloading semantics heavier

#

but i don't know if they've got that underway yet

#

or if that's related

heady garden
#

So multiple servers can share the same banlist

wraith rapids
#

query the db in async prelogin and disallow if the player is in the list

vestal dome
#

pls

quaint mantle
#

guys dont trust icewaffles

#

he tried deoping me and stealing my sever

#

lmao kick this hoe out

quaint mantle
#

wdym

#

spoof is icewaffles ?

ivory glacier
#

In that file

#

I'm trying to change the UUID of an online player as they log in

eternal oxide
#

why?

vestal dome
#

ugh

oblique ibex
#

I would assume other plugins would have the same problem

ivory glacier
eternal oxide
#

Sorry, its too probable you are writing a trojan

ivory glacier
#

.-.

royal hawk
#

How deserialize this?

player.getItemInHand().getItemMeta().serialize()

ivory glacier
#

For instance overriding hasPermission

eternal oxide
#

Changing UUID is the easiest to impersonate someone and take over a server

ivory glacier
#

Fair

frosty torrent
#

Hey is there a way to make a unique id for any new object in a while loop?

vestal dome
urban trout
chrome beacon
#

Aight show the code where you register the command

quaint mantle
#

Ok so I have this thing here

ArenaConfig.get().getConfigurationSection(player.getWorld().getName()).set("playerLocation.location" + index, player.getLocation());```
and this thing to be able to use it 
```java
ArenaManager.setPlayerSpawn(player, ArenaConfig.get().getConfigurationSection(player.getWorld().getName()).getKeys(false). size());```
There are no errors at all but it only seems to do 2 locations only, nothing more. When there are 2 locations, it just changes the last one when the command is executed
left holly
#

How can I upload plugins to Spigot?

chrome beacon
urban trout
chrome beacon
left holly
#

I can't not see it

chrome beacon
#

You literally can't miss it

left holly
#

Can u send a screenshot?

urban trout
chrome beacon
#

Set all of the command sections to []

wraith rapids
#

to {}

chrome beacon
wraith rapids
#

[] is list

chrome beacon
#

Ye my bad

urban trout
#
  discord: {}
  vote: {}
  store: {}
  tip: {}```

?
chrome beacon
#

Yes

urban trout
#

okay

#

lemme try it

urban trout
heady garden
#

Way to change header an footer of tablist in 1.8 spigot?

chrome beacon
#

Packets and NMS

vestal dome
upper vale
#

How can I get a direction vector between 2 points

opal juniper
#

Location1.toVector().subtract(Location2.toVector())

#

Something like that?

eternal night
#

well, note that that would give you the directional vector pointing from location 2 to location 1

upper vale
#

I have yaw and pitch of 1 of the locations, but the other location is a block so no yaw or pitch there

young knoll
#

Doesn't matter

#

You only need x y z

karmic sapphire
#

Greetings everyone.

sage swift
#

Hello.

karmic sapphire
#

Do anyone know of sample api code which can store global information?

sage swift
#

What do you mean by that.

karmic sapphire
#

i want my main plugin to have a listarray of the setting for each plugin.

ivory sleet
#

Sounds creepy

karmic sapphire
#

lol thats what i do creepy

sage swift
#

Creepy peepee.

karmic sapphire
#

lets try putting it like this i got a core plugin and all my other plugins must use the same class with public variables being shared. not a instance of the class in my core

#

so if i change for example variable lockedbyplug with the plugin name the other plugins must pull that vairiable and also be able to modify that variable

#

so i want to share variables between plugins

dusty herald
#

no

ivory sleet
#

First and foremost java is a pass by value language, not pass by reference

karmic sapphire
#

ill figure something out thanks for the advice

quaint mantle
subtle kite
#

How would I make a gui with the same icons.

ivory sleet
#

Same icons?

subtle kite
#

like there all dirt. but they do different stuff

ivory sleet
#

Fill the inventory with dirt but then make slot based actions?

spice juniper
#

Does someone know how to use Bukkit#recipeIterator?

hexed saddle
#
[00:05:35 WARN]: [WiiPay] Plugin WiiPay v2.1 generated an exception while executing task 36381
java.lang.IllegalStateException: WiiPayEvent may only be triggered synchronously.

Code to call it:

  public void sendEvent() {
        this.wiiPay.getServer().getPluginManager().callEvent(new WiiPayEvent());
    }

This code is ran in a public synchronized void function.
What's the best way to allow this event from being called in a synchronized function?

#

Run it sync or?

sage swift
#

clearly its not sync

#

where do you call sendEvent()?

hexed saddle
#

in a sync function, a runner 🙂

sage swift
#

doesn't seem like it...

ivory sleet
#

synchronized keyword won’t make it just magically run on the server thread

sage swift
#

so then you're good

hexed saddle
quaint mantle
#

Does anyone know the name of the plugin that allows you to put a message on the middle screen in minecraft?

sage swift
ivory sleet
#

If you want something to run on the server thread then use the Bukkit scheduler

#

Bukkit.getScheduler().runTask(JavaPlugin.getProvidingPlugin(this.getClass()), () -> {
//call event
});

quaint mantle
sage swift
#

no

#

we dont do help here

oblique ibex
sage swift
quaint mantle
#

the indexes makes it go location1, location 2

sage swift
#

showing one line of code with no other information on how you use or increment the index will not help here

quaint mantle
#

well no shit

sage swift
#

?paste so show how you manage the index

queen dragonBOT
sage swift
#

then maybe you could show us more so we can help you find the source of the problem 🤯

deft geode
#

How can I make sure my built jar does not have a copy of the API?

sage swift
#

dont shade it

#

the onEnable

quaint mantle
#
Skylands:
  playerLocation:
    location0:
      ==: org.bukkit.Location
      world: Skylands
      x: -66.49826835228856
      y: 149.0
      z: 108.59045268232444
      pitch: 4.703241
      yaw: -90.78659
    location1:
      ==: org.bukkit.Location
      world: Skylands
      x: -44.53215050631547
      y: 149.0
      z: 108.53184486593061
      pitch: 1.1401986
      yaw: 94.06466
  spectatorLocation:
    ==: org.bukkit.Location
    world: Skylands
    x: -41.941705808364674
    y: 149.0
    z: 111.51632777006849
    pitch: 1.1401986
    yaw: 94.06466```
sage swift
#

maybe the location of the config.yml in relation to the rest of the project

ivory sleet
#

No it’s passed by value ALWAYS Garageport.
If pass by reference was the case then this would happen:
class {
int x = 1;
{
System.out.println(x); //1
increment(x);
System.out.println(x); //2

}
void increment(int i) {
i++;
}
}

#

@oblique ibex

sage swift
#

does the onEnable get called?

quaint mantle
#

ok

sage swift
#

are there any errors

#

that would have been a good start

oblique ibex
sage swift
#

it doesnt even get to saving the config because it has an error instantiating the command class

lost matrix
#

Whats commandHandler line 19 ?
Btw rename the class.

#

lunarMain.plugin is null

sage swift
#

because you havent saved it yet

#

oh

#

yeah that too

#

order matters

#

cant try to get the plugin before you set the plugin static variable

ivory sleet
lost matrix
ivory sleet
#

When we pass stuff through methods we pass instances, not the pointer/reference itself which is my point and my definition of pass by value

sage swift
#

is it not the reference to the memory address technically

#

lol

lost matrix
#

I dont agree with that statement as is. There is a lot to consider regarding heap, stack and primitives. In most cases java is "pass by reference"
You are not actually cloning a part of the heap when passing objects in java but rather their memory address. This might change with stack objects and primitives.

oblique ibex
lost matrix
oblique ibex
#

Yeah that's what I said

#

Or at least what I meant, I don't know maybe we're using different terminology or something.

ivory sleet
oblique ibex
#

Yes you're right, but worth mentioning the Object references an address location which does not change when passing. While primitive types allocate a new location. Duplicating the value.
Just worth mentioning I think. We're saying the same thing

ivory sleet
#

Ye

oblique ibex
#

I think I just always "wrongly" called that pass by reference. But I realize that causes more confusion as it is not technically correct.
Anyway improving myself everyday

ivory sleet
#

I mean probably depends on how we define pass by reference/value

#

Just this shows ambiguity

#

Well to some degree

oblique ibex
#

I think pass-by-reference will cause confusion among programmers who are used to languages which actually pass by reference

#

So I think what your saying is definitely more correct. I'll also start using it that way now.

ivory sleet
#

Haha if you think so sure do I mean that’s what I’ve been told and motivated with so that’s why I say it like that.

opal sluice
#

Hi, how I get the material data to spawn material particles from block crack particles effect ?

#

I did Material.BLOCK.getData()

#

But it says that we can't do that

quaint mantle
#

Anyone have any idea how I can start using IntelliJ with the spigot api. I can't seem to get it to work to where I can import what I need.

upper vale
#

play the block break particle?

opal sluice
#

I found it ^^

upper vale
#

👍

opal sluice
#

Material#createBlockData()

upper vale
quaint mantle
#

Mmm yea but I am trying to use kotlin not java. It seems like a pain to just swap it all to kotlin.

upper vale
#

ah im not sure then

quaint mantle
#

Yea, I tried following several tutorials that lead to the same result in the end. They all tell me to use spigot buildtools or whatever and use the spigot jar in my modules tab on intelliJ

#

Though I am not able to import anything they are able to import

#

If anyone can tell me how to start using the spigot api with IntelliJ I would greatly appreciate it.

upper vale
#

never had issues with it, if i wanted to develop on 1.8 i just changed the version in pom

quaint mantle
#

First time working with the Spigot API

#

I have used IDEs before just never tried spigot

upper vale
#

just change the dependency version and reimport

#

ez

quaint mantle
#

I use IntelliJ quite often just this method of importing something is new to me

upper vale
#

it still sets up the repo, build configurations, gitignore, plugin.yml, etc.

#

its a nice plugin to have

quaint mantle
#

I mean I didn't know you could convert to kotlin so I didn't know using the plugin was a viable option

#

I figured it out using maven.

upper vale
#

just saves time especially if you have a lot of projects

quaint mantle
#

I found a thread on the spigotmc site that explained how to do it with maven

young knoll
#

Does the development plugin require those fields

#

ew

dusty herald
#

ew

dusty herald
#

your.project.package.Main

ivory sleet
#

THE PLUGIN

young knoll
#

You only need main, name, and version

upper vale
#

yes

young knoll
#

Version is just an arbitrary string too, I'm surprised no one has released a plugin with version potato

upper vale
#

mc dev plugin auto generates that for you :c_:

dusty herald
#

what's mc dev plugin

upper vale
#

do use it

#

do

dusty herald
#

what is it

warm galleon
#

damn

dusty herald
#

they were KICKED

warm galleon
#

we were

#

we both got kicked

#

LLLL

dusty herald
#

Demeng wasn't?

warm galleon
#

he never rejoined

#

he is

dusty herald
#

if Demeng was kicked they would of had their messages removed

warm galleon
#

it should say his roles if he rejoined

upper vale
#

what

warm galleon
#

maybe he left

#

see how now he has a color in his name? from the role?

quaint mantle
#

Thanks Kyrok for helping me, it made it extremely a lot easier for me to understand how it all works :)

warm galleon
#

cause he rejoined

dusty herald
#

what

upper vale
#

i was never kicked

dusty herald
#

^

warm galleon
dusty herald
#

you were kicked, maybe your client didn't update..?

upper vale
#

discord cache being stupid

#

happened to me the other day lol

warm galleon
#

¯_(ツ)_/¯

dusty herald
#

🤷

upper vale
#

well the other day somebody had a role but they were kicked

#

lol

warm galleon
#

ok i have an essay due tmr and i havnt started so bye

#

actually fk the essay

quaint mantle
warm galleon
#

hes joined now

dusty herald
#

just do the essay

warm galleon
#

@upper vale you bought intellij ult????

#

y

young knoll
#

Student plan I am guessing

upper vale
#

i have student license

#

yes

quaint mantle
#

Imagine buying it and not using the student license

#

:^)

upper vale
#

and its a nice flex that no one cares about :kekk:

warm galleon
#

im not a student

#

im not in like college

dusty herald
#

then why are you doing an essay

warm galleon
#

im in middle school :3

quaint mantle
#

Still a school

warm galleon
#

you dont get a license

#

thingy

dusty herald
#

if you're in middle school you're still a student DogKek

quaint mantle
#

I was in middle school when I applied for the student plan from github

warm galleon
#

i dont get the license

#

reeeeeeeeeeeee

#

like you have some student id and numver you gotta give em

quaint mantle
#

Apply on github they give you a lot of stuff plus jetbrains products

#

You can use your student email

dusty herald
#

no? all they need is your student email

warm galleon
#

oh

#

wwwweeeeeeeeeeellllllllll

#

ok

quaint mantle
#

When I applied I had to supply my ID but they changed it now

warm galleon
#

bet

dusty herald
#

I would apply for mine but my graduation ceremony is the 20th

quaint mantle
#

kekw

warm galleon
#

but since im bad at coding i dont need anything like that

#

gimmie any text editor and im fine lol

quaint mantle
#

Still isn't bad to have

dusty herald
#

im a bad coder

warm galleon
#

all i do really is copy code from the sacred stack overflow

#

:3

quaint mantle
#

my guy. I suck at coding and I still applied :^)

warm galleon
#

what does it benifit me lol

quaint mantle
#

You get a lot of cool stuff

warm galleon
#

eh

#

also lets move to #general i dont wannt get kicked for wrong channel use :3

quaint mantle
#

It gives you offers to learn coding

ivory sleet
#

Applied to what

warm galleon
#

life

ivory sleet
#

Ah

#

I’m still waiting for god to accept my application

clever sequoia
#

hey guys

#

i have this condition:

quaint mantle
#

The "" condition, oh no!

paper viper
#

yes i have asmtha condition

#

(im joking)

clever sequoia
paper viper
#

hmmm thats sus

clever sequoia
#

but its not working

quaint mantle
clever sequoia
#

when i change to if(player.getname.equals("Developex")){

#

it works

#

but the uuid is correct

paper viper
#

try printing out both uuids

#

to make sure

clever sequoia
#

2 uuids?

dire marsh
#

you are comparing uuid object to string

paper viper
#

wow

#

i didnt catch that

#

xD

dire marsh
#

read your ide warning

paper viper
#

If uuid is UUID, you have to either compare it with another UUID or use toString and compare the strings

clever sequoia
#

ok

paper viper
#

you can't use UUID and String interchangeably

clever sequoia
#

wow thas correct

#

lol

#

im rusty at java

#

thx guys

sturdy elk
quaint mantle
#

Sorry for the ping

#

I saw that

paper viper
#

i replied to the wrong message

#

now yagdp is yelling at me

#

smh

quaint mantle
#

Estupido

paper viper
#

WTF

sturdy elk
paper viper
#

why did it delete my message

quaint mantle
sturdy elk
#

#general

paper viper
#

no tu

quaint mantle
paper viper
#

I bet you dont know the imperfect tense

#

or preterite tense

sturdy elk
#

agarrense a putazos en general

paper viper
#

No sigo

quaint mantle
#

help-development is the "nuevo" general

sturdy elk
quaint mantle
quaint mantle
#

Hello spigot! I coded nms fake player npc.
but, how can I remove npc from tab? I googled, not solved. connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, npc)); it removes npc's skin 😦

sage swift
#

Bukkit.shutdown()

quaint mantle
#

or nah?

#

bruh Shutdowns the server, stopping everything.

#

xD

wispy fossil
#

i mean, his method works does it not

sage swift
#

it removes the npc from tab 👍

quaint mantle
sage swift
#

yes but it removes the npc from tab

compact haven
#

@quaint mantle did u actually try that method

#

i mean the thing is literally in the name

#

Bukkit -> shutdown
shutdown bukkit

quaint mantle
#

ye

#

I did "Bukkit.shutdown();"

#

3 times

sage swift
#

so your problem is solved

quaint mantle
#

it shutdowns server

#

don't joke me please

weak mauve
#

can any1 help me with maven project?

warm galleon
weak mauve
#

pom.xml

warm galleon
#

okay..?

weak mauve
warm galleon
#

okay?

#

create new artifact and build it..?

weak mauve
#

can u guide it for me with IntelliJ

warm galleon
sullen dome
#

tf

warm galleon
#

tf

sullen dome
#

add that dependency into your pom.xml, and click that elephant on the top-right

weak mauve
#

ok

#

it work

warm galleon
#

oh

#

i thought you wanted to compile ap roject

#

welp no nitro = blind

#

so another reason to gift me :3

sullen dome
#

intellij looked so good before my drives yeeted away

#

and now...

#

now this

warm galleon
sullen dome
#

why is the class name lowercase, triggers me

sullen dome
warm galleon
sullen dome
#

and someone uploaded scam stuff

#

and google gives a shit

#

so i got a new one now

warm galleon
#

when i just start4ed using java i did that too since i was used to naming all methods and stuff lowercase and never had to use classes

sullen dome
#

need to change it in my profile tho

warm galleon
#

ok

sullen dome
#

dont remember where i do that lol

warm galleon
#

ayo if you gift me nitro any version ill teach you

#

@sullen dome

#

good deal

sullen dome
#

shuut

warm galleon
#

classic?

sullen dome
#

found it :)

#

aaand changed

warm galleon
#

shot

weak mauve
#

java: package net.minecraft.server.v1_8_R3 does not exist L

#

wth

summer scroll
#

ooh boy

#

get ready

young knoll
#

Are you depending on spigot or spigot-API

#

Also 1.8

weak mauve
#

org.bukkit

#

idk

#
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>craftbukkit</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
        </dependency>
weak mauve
#

oooh

summer scroll
#

just change the version

weak mauve
#

ok

young knoll
#

You’ll need to use spigot instead of spigot-API for NMs

#

Which requires you to run buildtools

weak mauve
#

yikes

#

still can't

sage swift
#

yes that explains it now we know how to solve your issue

dawn falcon
#

https://pastebin.com/CN5cUy46 I cant figure out how to get this command to work, i am new to spigot / bukkit plugin development. What the plugin is supposed to do is on command execution give a player a book that gives details about the server and delete any duplicate books that they might have of it from there inventory. All i know is that the error is happening past line 46. can someone please help?

weak mauve
#

can any1 would like to help me to complie that plugin

#

:L

weak mauve
#

if any1 want to help, DM me

sage swift
#

also welcome is spelled wrong

sage swift
weak mauve
#

ummm

#

its here

sage swift
#

you can do it yourself

#

we gave you the instructions

#

well, Coll did

weak mauve
#

F

sage swift
#

you can run it on mac

weak mauve
#

u know that I'm using very ancient version of IntelliJ breh

sage swift
#

and that does not make a difference

weak mauve
sage swift
#

if you want to compile the fucking plugin, you need to stop making excuses and run buildtools

weak mauve
#

ok

dawn falcon
#

Caused by: java.lang.NullPointerException
at me.halfbrau.playerwellcomemessage.AboutServerCommand.onCommand(AboutServerCommand.java:56) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.16.5.jar:3074-Spigot-9fb885e-b1064

young knoll
#

Something is null on line 56

sage swift
#

the item is null

#

cant getType on a null item

young knoll
#

This is a case where spigot has null instead of air

sage swift
#

check for null and then air

#

if (null || air) continue;

dawn falcon
#

thank you!

dawn falcon
#

Welp that didn't work. How many ways are there to check if a player has an specific item in the're inventory?

sage swift
#

you could loop through and use isSimilar

young knoll
#

isSimilar should work well here

sage swift
#

if (item.isSimilar(targetItem)) assuming neither is null

#

(or can targetItem be null? idk)

#

it's nullable

#

nice

dawn falcon
#

sounds good i will try it

sage swift
#

elite solution would look something like this

if (Stream.of(player.getInventory().getContents()).anyMatch(targetItem::isSimilar)) {
  //they have the item in their inventory
}```
summer scroll
young knoll
#

A mission or mission jar

#

Because missions just look like yml files

summer scroll
#

The mission jar.

young knoll
#

I imagine you can build it however you want

summer scroll
#

Like, do I need class that extends JavaPlugin or something like that?

#

I have no clue xd.

young knoll
#

Don’t think so

#

Check the example jars, like it says

summer scroll
#

alright, thanks.

outer sorrel
#

Ive never really used enums so where would a good place be to put the class with the enum inside?

#

inside the main class? create a new packet for enums?

sage swift
#

is there no PrepareGrindstoneEvent?

sage swift
#

usually enums have their own class, or if they're small enough, within the class they're used the most

outer sorrel
#

yea i was dumb, ive never used an enum lol

#

got it now

#

thanks

quaint mantle
#

Hello spigot! I coded nms fake player npc.
but, how can I remove npc from tab? I googled, not solved. connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, npc)); it removes npc's skin 😦 thanks you for share 😄

sullen marlin
#

Pretty sure things have to be in tab to have a skin

#

Only way around that is to have a full custom tab list

oblique ibex
#

Hey Guys,
Quick question, since one of the more recent versions of Spigot my EventListeners for custom events that I register no longer work.
I send an event from plugin A, plugin B listens to that event.
I send out the event but it never reaches the listener. If I revert back to a version of let's say the 10th of May it works.
Anyone else encountered this?

quaint mantle
drowsy helm
#

you are doing item.getString("Name");

#

but doing nothing with it

#

also itemM.setDisplayName(key);. Key can be null iirc

quaint mantle
#

ah looked over that one thanks 🙂

#

how can i disable the arrows to be at blocks?

eternal night
#

respectively remove the arrow then

quaint mantle
#

okay and is there a plugin for it already by any chance?

quaint mantle
#

ty

dense goblet
#

if I keep track of my own projectiles (which are just objects that move an assigned entity every tick and do their own collision checks), will I have to worry about the world unloading?

#

i.e. what happens if a world unloads and I try to move an entity in it (that I have saved as a reference)

sullen marlin
#

you're gonna leak the world is what

dense goblet
#

or if I try to call something like getNearbyEntities or getBlock in a world that got unloaded

dense goblet
sullen marlin
#

probably ok

#

as for what'll happen, who knows

dense goblet
#

so I guess calling those functions force-loads the world?

#

or at least stops it from unloading

sullen marlin
#

I honestly have no idea what it'll do

dense goblet
#

hm okay

#

might just listen for world unload and delete all projectiles if it happens

eternal night
#

you might wanna use ChunkUnloadEvent

#

not all chunks are loaded when the world is unloaded

dense goblet
#

does a chunk unloading mess up entity references?

eternal night
#

so removing entities at the world unload point does not guarantee a full removal

#

Yea

#

the entity reference won't point to the correct entity after a chunk was unloaded and loaded again

dense goblet
#

what about just checking if the entity exists and, if not, despawning the projectile?

#

or is there no way to know if a reference has been corrupted

quaint mantle
eternal night
#

I mean, your old reference still has the uuid of the entity

#

which you could use to re-fetch the entity

sullen marlin
#

there's isRemoved or something

#

isValid ?

#

I think thats it

eternal night
#

I think isValid ye

dense goblet
#

oo that may work

#

I update the projectile every tick so it should be fine

sullen marlin
eternal night
#

I mean, your issue is that if the entity is invalid (because chunk unload) you can't remove it anymore 😅 its already too late at that point

dense goblet
#

nah I only need to remove my projectile

#

which is not physical

#

I just remove it from a list in my projectile manager

#

and GC eventually kills it fully

cold field
#

Guys, quick question, i need to put a try catch inside a run method of a Consumer<?> anonymous class. The problem is that the run method is ran multiple times inside a loop, is this a problem?

sullen marlin
#

no?

#

are you having a problem

candid galleon
#

if you're asking in terms of performance it's not the best but it shouldn't be a major issue

#

if you're asking in terms of logic, it would depend on how you expect it to run

cold field
#

No it isn't actually a problem. I was wondering about the performance.

sullen marlin
#

handling exceptions is slow, but the existence of a try catch by itself isnt

cold field
#

ok, thanks.

quaint mantle
#

How to hide nms entityPlayer from tablist? but I don't want to useconnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVe_PLAYER, npc));

sullen marlin
#

you have to if you want a skin

#

and honestly just use citizens

#

or some other npc api

quaint mantle
#

hmm 😦

dense goblet
#

is boundingBox.rayTrace very expensive?

eternal night
#

don't think so. Should only contain a single square root and the rest is all straight up comparisons

dense goblet
#

okay sweet thanks

torn oyster
#

is projectilelaunchevent called before the item is thrown

eternal night
#

after

#

EntityShootBowEvent is called prior for bows

#

I think the paper fork provides PlayerLaunchProjectileEvent

candid galleon
#

ProjectileLaunchEvent is cancellable

#

so presumably it is called before

eternal night
#

it is called before the projectile is spawned

#

but the item is already consumed at that point

urban trout
#

hey how would i get a random coordinate on the ground?

candid galleon
#

use the Random class

urban trout
#

how would i get it on the ground?

candid galleon
#

how do you think?

#

have you tried anything?

urban trout
#

not yet

candid galleon
#

ok

#

please try stuff

#

and let us know when and where you get stuck

urban trout
#

okie dokie

#

ok i am stuck lmao

#

how would i make it run every 30 minutes?

wraith rapids
#

use the bukkit scheduler

wraith rapids
#

yes

urban trout
#

okay

#

thanks

urban trout
worn tundra
#

Try sout instead of broadcastmessage

#

oh wait

#

Your aren't running the task

ivory sleet
#

It won’t fire during the enable process also

worn tundra
#

Well he's scheduling it

#

a little confused too now

ivory sleet
#

Yea but he’s scheduling it to run the next tick

worn tundra
#

a timer

ivory sleet
#

runTaskTimer to be specific

#

Takes a delay and then an interval

worn tundra
#

Yeah

ivory sleet
#

Do you know what the delay is here?

worn tundra
#

It does, but then it'd run a second time after 5 secs

ivory sleet
#

Precisely yes

worn tundra
#

But he said it doesn't seem to do anything

#

@urban trout hi

urban trout
#

hELLO

ivory sleet
#

Anyways my point is that you’d just call BukkitRunnable#run if you wanna call ur task right in spot

urban trout
#

o

worn tundra
#

Also for finding a random spot you'd have to use a recursive function that would search for a suitable block to be placed on

urban trout
#

oo okay

quaint mantle
#

I'm making an NPC plugin. And I want to make various entity types. And I think we should use pathfindergoal to make NPC. If so, do I have to create one class for each entity? (extends EntityEntity)

worn tundra
#

Not really

urban trout
#

alrighty

#

ty

worn tundra
#

Depends on the use case

urban trout
#

o

worn tundra
#

Supply drops, right?

ivory sleet
worn tundra
#

Where do you want them to spawn?

urban trout
#

but not like in buildings or anything

worn tundra
#

If you want them to spawn between 2 locations ( inside an area ) you should use some math to get random x, z inside that area

urban trout
#

okay

worn tundra
#

otherwise you can use a random number to find the x, z in radius

#

like -1000 & 1000

#

so that the random number would be between those

urban trout
#

yeah

worn tundra
#

Then just #getHighestBlockAt

urban trout
#

okay

#

thanks

worn tundra
#

and check if it's a suitable block and other things (are there claims or other regions like spawn at that location) etc.

urban trout
#

okay

#

hey so with the random thing, i decided i'm going to have set locations instead, how would i only put randomLocation once or like what should i do?

                      "275, 84, -181",
                      "185, 74, -247"}; 
              Random r=new Random(); 
              int randomLocation=r.nextInt(arr.length);
              Bukkit.broadcastMessage("§cSUPPLY DROP AT: §7 " + (arr[randomLocation]));
              Location loc = new Location(player.getWorld(), randomLocation, randomLocation, randomLocation);```
ivory sleet
#

Oh I see what u tryna do

#

Why not use an array of locations

wraith rapids
#

ideally read a string list from the config and precompute it into a location list, and then pull a Location from a random index

lost matrix
#

You could also create a custom LocationList class and let it implement Serializable so you can just save/load it directly to/from the config.

#

But then user written configs will be more complicated.

candid galleon
#

then add a way to config ingame 😉

#

and/or support both methods

blissful folio
#

How can I change the skin of an EntityInsentient?

candid galleon
#

what do you mean exactly?

blissful folio
#

And how can I spawn it lol?

blissful folio
candid galleon
#

ah, it looks like EntityInsentient is NMS

blissful folio
#

Yeah it is, am I not meant to ask it here?

candid galleon
#

no you can

wraith rapids
#

an EntityInsentient doesn't have a skin

#

players have skins

blissful folio
#

I figured that much

lost matrix
#

EntityInsentient does not necessarily have a skin. Thats specific to a players profile.
And EntityPlayer nor EntitiyHuman are instance of EntityInsentient.

blissful folio
#

I see, so how would you recommend making an NPC from a player and making it move?

wraith rapids
#

basically you have to fuck with the protocol

#

and skins are cancer

#

pretty much no matter how you do it you'll end up with intermittnely flashing names in the playerlist

lost matrix
#

Setting the skin is quite easy. You simply get a Skin and its token then set the property in the GameProfile of the EntityPlayer you are about to spawn.

wraith rapids
#

generally though you probably want to preserve your sanity and use some npc library or api

dense goblet
#

for whatever reason player events dont get called for interacting with air?

blissful folio
candid galleon
#

yes

lost matrix
blissful folio
candid galleon
#

PacketPlayOutRelPosition

wraith rapids
#

implement proper ai goals for it

candid galleon
#

or something like that

blissful folio
#

Alright sounds good, thank you much!

#

One last thing actually

#

How can I set pathfinder goals to it?

lost matrix
wraith rapids
#

you can still set them though

#

if all else fails you can extend and implement it to have them

dense goblet
#

ohh air events are always cancelled

white mango
#

Hello every1

#

I want to do a Spigot plugin

#

Im newbie

#

How do i do:

lost matrix
white mango
#

hmm

#

i didnt type to the end

#

How do i do:
To damage player if he stands on grass

#

Itz all

lost matrix
#

PlayerMoveEvent -> check Block player is standing in (But this only applies when he is moving)
Scheduler -> check every N ticks if players are inside a grass Block.

white mango
#

ok thx

lost matrix
#

You could do that with an evenly distributed scheduler.

white mango
#

what is scheduler

dense goblet
#

is there a way to check every tick if the player is holding down RMB? The use event doesn't fire every tick

lost matrix
white mango
#

Ok

wraith rapids
#

the use event is fired when the interact packets are received

#

there is no good way of knowing whether the button is held down or not

wraith rapids
#

the client simply doesn't send that information

dense goblet
#

so there isn't a way of telling if I hold RMB for 1 tick vs for say 3 ticks?

wraith rapids
#

there is not, no

#

the client simply sends an interact packet every x milliseconds while the button is held down

#

there is no "button down" & "button up" information in the protocol

lost matrix
#

And the precision is based on x

dense goblet
#

so if I want a weapon that shoots 10 times per second it has to always do bursts pretty much right

lost matrix
#

So you can check every n ticks if the packet was sent again. If not then he released the button.

lost matrix
wraith rapids
#

you'd have to track interact events or packets and keep shooting until the time since the last one exceeds x milliseconds

#

which would end up in you shooting a couple more rounds even after the button is lifted

dense goblet
#

okay I guess thats manageable

#

how do I know how long to wait between checks?

wraith rapids
#

ideally you'd make it configurable as it might change in the future

dense goblet
#

assuming reasonable connection

wraith rapids
#

as for what the current interval is, dunno, half a second should probably be fine

dense goblet
#

okay so I did some testing

#

if the player isnt moving their head I get 4 ticks (on localhost)

#

sometimes goes down to 3 and sometimes up to 5

#

when moving the head its either 0 (I assume if we click multiple blocks in one tick) or 3-5

candid galleon
#

could you give the player a shield and check if they're blocking?

dense goblet
#

that would be kinda obtrusive no

candid galleon
#

true, i was thinking in theory though

#

could always use a resource pack

wraith rapids
#

if it's a gun or something you could just make your guns be shields and add a custom model to them via a resourcepack

#

though that might get weird if the player is holding a shield in both hands

dense goblet
#

if input packets are only being sent so infrequently then wouldnt shields have the same problem?

candid galleon
#

no because the server's notified when the player shield/unshields

wraith rapids
#

no because shields actually do have a "put up" and "put down" information going in the protocol for them

dense goblet
#

ah i see

wraith rapids
#

same with bows I think?

dense goblet
#

ig that would work but then youd always be slowed down when shooting

#

and have more defence

candid galleon
#

you could be super creative and give them speed/increase their walk speed while doing that

dense goblet
#

hm maybe shield speed/def are configurable?

candid galleon
#

don't think so

#

you'd have to manually toggle their speed

wraith rapids
#

use bows

#

that way you won't run into the protection issue

#

you'll still have to modify the player speed though

dense goblet
#

can you cancel a bow pull?

wraith rapids
#

you can cancel it being fired yes

#

although you will need arrows in your inventory to pull it

#

even with infinity

#

so i guess that's cancer too

dense goblet
#

yeah that causes issues

#

guess I'll stick with the burst solution

candid galleon
#

can't just reskin arrows as bullets?

dense goblet
#

check every 6 ticks and should be g

#

could but then what if your gun has a full mag but youve got no more bullets in the inv

lost matrix
wraith rapids
#

you could, uh

#

use potions

#

if you can cancel the sound that should be fine

#

not sure if it's clientside though

candid galleon
#

or snowballs?

wraith rapids
#

that's not continuous though i don't think

#

i'm not sure how fast it is

candid galleon
#

i would think the same as potions

lost matrix
#

I see the a problem in this implementation.

wraith rapids
#

i don't think they're thrown each tick

#

but they might be more rapidly thrown than regular interacts so ig that'd be slightly better

white mango
#

What i have now

wraith rapids
#

get the block under the player and get its type

white mango
#

what api method

wraith rapids
#

get the player's location

#

move it 1 block down

#

get the block at that location

#

get the type

dense goblet
lost matrix
candid galleon
#

realistically I doubt players will notice/care about tick precision

lost matrix
white mango
white mango
#

will server lag with that