#help-development

1 messages · Page 2187 of 1

humble tulip
#

how do i print out the nbt for an entity?

ornate patio
#

/data get entity entityId

eager knoll
ornate patio
#

can you show the imports pls

eager knoll
#

I want the gui to have a 1 slot wide border around the swords which will fill up the inside box, but my math doesn't work, any help?

humble tulip
humble tulip
#
inventory.setContents(new ItemStack[]{
                itemStack, itemStack, itemStack, itemStack, itemStack, itemStack, itemStack, itemStack, itemStack,
                itemStack, null, null, null, null, null, null, null, itemStack,
                itemStack, null, null, null, null, null, null, null, itemStack,
                itemStack, null, null, null, null, null, null, null, itemStack,
                itemStack, null, null, null, null, null, null, null, itemStack,
                null, itemStack, itemStack, itemStack, null, itemStack, itemStack, itemStack, null
        });
#

make itemStack glass or whatever

#

u will see 3 null spots at the bottom, u can replace with itemStack as well

eager knoll
#

I'm using a for loop to implement my items into the gui

humble tulip
#

it starts at 0 from the top left

tardy delta
#

just have a slot arrzy lol

#

array

humble tulip
#
List<Integer> slots = Arrays.asList(
                10, 11, 12, 13, 14, 15, 16,
                19, 20, 21, 22, 23, 24, 25,
                28, 29, 30, 31, 32, 33, 34,
                37, 38, 39, 40, 41, 42, 43);
#

like this

tardy delta
#

slots.forEach(s -> inv.setItem(slot, stack))

eager knoll
#

I'm also using a library to create my gui buttons

ornate patio
humble tulip
#

dont think so

#

seems to disappear on plugin disable

#

not even server stop

#

i can only use the command on players?

ornate patio
#

well

#

let me try using persistent data on a normal entity

#

and see if it works

humble tulip
#

it would

tender shard
#

persistent data is, as the name suggests, persistent

#

across server restarts, across plugin enable/disable, etc

ornate patio
#

ok yeah as expected it did work

#

why doesnt it work on nms entities though thats stupid

tender shard
#

?

#

PDC is a bukkit feature

#

on NMS entities you gotta use regular plain old NBT tags

humble tulip
#

/kill doesnt even kill my custom horses

ornate patio
ornate patio
#

and will the NBT data persist as well?

tender shard
humble tulip
#

it should if you use mc nbt

tender shard
ornate patio
#

whats that

tender shard
#

well

humble tulip
tender shard
#

the name kinda tells you what it is

#

it's an API to use NBT stuff

tender shard
#

because you don't have any bukkit entitiy

humble tulip
#

OHHH

ornate patio
#

can I create custom NBT tags with NBTAPI?

humble tulip
#

CraftEntity.getEntity() doesnt add it to list of entities in the world

tender shard
#

you have to do that yourself

#

but tbh it's not worth the trouble

ornate patio
tender shard
#

you shouldn't hack into bukkit to create bukkit objects of your NMS stuff

tender shard
#

will reply later, my date is here

#

brb in an hour or so

ornate patio
#

alright

ornate patio
echo basalt
#

WorldServer#addFreshEntity iirc

ornate patio
#

that's what I did though

#
entity = new SuperiorHorseEntity(spawnLocation.getWorld());

ServerLevel serverLevel = ((CraftWorld) spawnLocation.getWorld()).getHandle();
serverLevel.addFreshEntity(entity);
entity.setPos(spawnLocation.getX(), spawnLocation.getY(), spawnLocation.getZ());
...
CraftEntity craftEntity = CraftEntity.getEntity((CraftServer) Bukkit.getServer(), entity);
PersistentDataContainer persistentDataContainer = craftEntity.getPersistentDataContainer();
persistentDataContainer.set(new NamespacedKey(plugin, "hunger"), PersistentDataType.DOUBLE, 0.5);
humble tulip
#

@ornate patio i got it

#

it works now

echo basalt
#

ehhhhhhhhhhhhhhhhhhhhhhhhh

#

bukkit nbt tags for an nms entity

#

if you're going nms

#

do it all nms

#

if you're going bukkit

#

do it all bukkit

ornate patio
#

why though

echo basalt
#

bukkit is just a fancy nms wrapper after all

ornate patio
humble tulip
#
World bukkitWorld = Bukkit.getWorlds().get(0);
        CustomHorse customHorse = new CustomHorse(bukkitWorld.getSpawnLocation());
        Horse horse = ((CraftWorld) bukkitWorld).addEntity(customHorse, CreatureSpawnEvent.SpawnReason.CUSTOM);
        horse.getPersistentDataContainer().set(key, PersistentDataType.INTEGER, 5);
        System.out.println(horse.getPersistentDataContainer().get(key, PersistentDataType.INTEGER));
        System.out.println(horse.getEntityId());
#

dont addFreshEntity yourself

#

use addEntity when you cast to CraftWorld

ornate patio
#

sorry what

#

im confused

humble tulip
#

can you ?paste your code

#

or paste it here

#

the code u use to spawn the horse

ornate patio
#

dont mind the huge mess, I plan on fixing it up soon

#

I spawn a new horse in a command using new SuperiorHorse(player.getLocation());

opal sluice
#

Hello, does someone know if it's possible to apply a custom name to a projectile ? (So having the name floating above the projectile)

echo basalt
#

setCustomName

#

setCustomNamevisible

#

whatever

#

it worky

opal sluice
#

That's what I do, but it doesn't display

echo basalt
#

did you make it visible

opal sluice
#

yes

echo basalt
#

ehh

#

projectiles are weird sometimes

humble tulip
#

@ornate patio use bukkit Horse

echo basalt
#

that's an exotic dependency injection method

paper viper
#

private static SuperiorSteed plugin;

#

whats the point of passing it through constructor if its gonna be static

#

remove the static

humble tulip
ornate patio
#

im not

humble tulip
#

the call a setPlugin method

ornate patio
#

theres a static method to set it

humble tulip
#

u coult just have a static getter in ur main class lol

paper viper
#
    private static SuperiorSteed plugin;

    private SuperiorHorseEntity entity;
    
    // default values
    private double hunger = 1.0;
    private double trust = 0.5;
    private double friendliness = 0.3;
    private double comfortability = 0.2;
    private double waterBravery = 0.1;
    
    public static void setPlugin(SuperiorSteed javaPlugin) {
        plugin = javaPlugin;
    }
#

what

#

Oh

ornate patio
#

yeah

paper viper
#

well still ew

ornate patio
#

why ew lol

ivory sleet
#

^

humble tulip
ornate patio
ivory sleet
#

?di :3

undone axleBOT
paper viper
#

Ew cause di better

humble tulip
#

just have a getBukkitEntity method and return the bukkit horse

paper viper
#

If I say something then all the karens are going to go after me

echo basalt
#

why are arrow physics so damn wonky

humble tulip
#

cuz its a block game

echo basalt
#

if Iw ant to flip an arrow's direction it does a weird turn

#

why nms

ornate patio
#

@humble tulip lets goooo

#

thanks so much

#

i appreciate it

grave mason
#

Hi when i spawn the armorstand the item in the main hand will not show up

#

anyone a idea?

echo basalt
humble tulip
ornate patio
#

alright

echo basalt
humble tulip
echo basalt
#

no it's supposed to shoot backward

humble tulip
#

yaw is in radians

#

wait is it?

echo basalt
#

yaw is in angle

#

radians is for rotating vectors

humble tulip
#

nvm its in degrees

echo basalt
#

arrows have always done this weird shit where they start homing to wherever their yaw/pitch/direction is

#

not just arrows but all projectiles

#

I've had fireballs just randomly turn

ornate patio
#

holly

#

thanks

#

i was stuck on this for so long

echo basalt
#

apparently setting the direction on spawn fixes it

undone axleBOT
tender shard
#

I'm baaack bitches

#

where's the problem?

river oracle
#

no message sent?

tender shard
#

move the message above the if statement

river oracle
#

make sure its registered

tender shard
#

probably the "taxus" thing isn't equal to the boots in the inventory

river oracle
#

how would you know without a debug>

#

above the if

tender shard
#

also did you do ArmorEquipEvent.registerListener() ?

#

ok move the sendMessage thing above the if statement

#

if that prints a message whenever you equip armor, then you equals(taxus) thing is false

river oracle
#

I'm surprised there is no armor equip event in regular spigot

tender shard
#

yeah ik

river oracle
#

is it bundled with something?

tender shard
#

bundled?

#

wdym?

river oracle
tender shard
#

no it simply doesn't exist

torn shuttle
#

I did a huge upgrade of my pc and somehow the thing I'm happiest about is how quickly projects now open lol

tender shard
#

there's a ton of ways to equip armor... right clicking without inv open, using normal inventory to put it there, using a dispenser, ...

river oracle
#

ahh I guess

torn shuttle
#

I think that's 12 seconds to be done opening intellij including indexing

#

not bad considering it's indexing 1273 files

tender shard
#

what did you upgrade

torn shuttle
#

motherboard, storage and cpu

tender shard
#

oh upgrading motherboard is nasty, isn't it?

torn shuttle
#

brah

#

I wasn't going to get into it

#

you don't want me to get into it

tender shard
#

so it is nasty lol

torn shuttle
#

I had to RMA the first one

#

after 30+ hours of fighting against it

tender shard
#

all I ever did is add a new SSD or RAM or switch the graphics card

torn shuttle
#

this is the worst upgrade process I've ever had

tender shard
#

and install some RGB stuff for even more FPS lol

torn shuttle
#

bad mobo, wrong storage, all packages were late, packages went missing, I thought I fried the cpu at one point

tender shard
#

RIP

torn shuttle
#

I had to image and clone my drives 4 times

#

hell I'm still doing one last image now

#

because I'm about to merge partitions and I don't want to risk losing data

tender shard
#

yeah no backups = no mercy

torn shuttle
#

yeah I have backups for days now

#

alright brb just need to merge some stuff

tender shard
#

good luck lol

sterile token
#

LMAO java still trolling

torn shuttle
#

New storage :D

#

no more weekly running around trying to find space to clear

sterile token
humble tulip
humble tulip
torn shuttle
#

Ok now I'm doing the real sketchy part, fingers crossed

tender shard
humble tulip
#

@tender shard

#

spawn in custom nms entities and have them put into the bukkit entities list

torn shuttle
#

Yeah it's a wd m.2 nvme drive which is fast af boiiiii

subtle folio
#

unfortunately not, caused more headaches and i’ll revisit it tomorrow

sterile token
humble tulip
sterile token
#

Lmao today java is bullet proof

sterile token
tender shard
humble tulip
#

yep it does, no problems

tender shard
#

ok nice

sterile token
#

mf

#

Could java today be anti bullet

#

Lmao what a shity day

#

Trying to solve 1 issue since 1h

humble tulip
#

wdym?

sterile token
#

Im doing a claim plugin based on a block (protection block)

#

For some reason when the build flag is not enabled and the player is a member of claim, its telling him "you cannot build on this claim"., when it should receive another message

humble tulip
#

what's the error?

sterile token
#

So looking code carefully i seen that the "if () return;" is not stopping the eecution

humble tulip
#

no way that's actually the problem

tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

sterile token
#

LMAO

#

I will send code

#

Im really annoyed

humble tulip
#

There will be a console error

#

look for a stacktrace in the console

tender shard
#

?paste your latest.log

undone axleBOT
sterile token
#
  @EventHandler(priority = EventPriority.MONITOR)
  public void onBreak(BlockBreakEvent event) {
    Player player = event.getPlayer();
    Block block = event.getBlock();
    Claim claim = this.plugin.getClaims().getClaim(block.getLocation());
    if (claim == null) return;
    if (claim.getLocation().equals(block.getLocation()) && claim.getOwner().equals(player.getUniqueId())) {
      this.plugin.getClaims().delete(claim);
      player.sendMessage("§4Claim §f" + claim.getUuid() + " §4has been deleted");
      return;
   }
   if (claim.getFlags().contains(Flag.Build) && claim.getMembers().contains(player.getUniqueId())) {
     player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
     return;
   }
   if (claim.getLocation().equals(block.getLocation()) && !claim.getOwner().equals(player.getUniqueId())) {
     event.setCancelled(true);
     return;
   }
   **if (!(claim.getOwner().equals(player.getUniqueId()) || claim.getMembers().contains(player.getUniqueId()))) {
     player.sendMessage("§f[BlockBreak] §cYou cannot build on §f" + claim.getUuid() + " §c claim");
     event.setCancelled(true);
   }**
}
tender shard
#

@edgy peak

humble tulip
#

can we see line 11 of your main class?

sterile token
tender shard
humble tulip
#

i always go with cancel on lowest and log on highest

sterile token
tender shard
sterile token
#

Allright

tender shard
#

MONITOR is to MONITOR the event

sterile token
#

But in fact im annoyed

tender shard
#

you should not change anything on that priority

#

if you wanna change something, use HIGHEST

sterile token
#

But someone told it can interfere with others plugins

#

In fact dont worry

#

Let try to see why the heck is being executed the last condition

humble tulip
#

is the Build flag set?

sterile token
#

No

#

So im checking it negate

quaint mantle
#

anyone help pls?

sterile token
#

I dont want to apply the flag to the owner

humble tulip
#

why is building not enabled if the build flag is set?

sterile token
humble tulip
#

player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");

#

you print that when the flag is set

tender shard
#

in your pom.xml, change armorequipevent from version 1.0.0 to 1.0.1

sterile token
#

So if the player is the owner, dont tell anything == return
If player is claim member and flag is not enable == send message

humble tulip
#

uhhh

#

no ur not

sterile token
#

Im checking like:

if !(flag && mebers#contains(player)) send message

humble tulip
#

^^ ur not

sterile token
#

And still saying me as the player isbot a member claim

#

hmn

humble tulip
tender shard
#

in your pom.xml

#

the file where you added the dependency?

#

or did you just copy paste the code

#

ugh

#

yeah then

#

obviously it won't work

humble tulip
#

he didnt copy the files?

sterile token
tender shard
#

you need to have this file in your plugin

#

and it has to have the exact same file name

#

if you just copy pasted the code but didnt include this file, then it'll throw an error

humble tulip
tender shard
#

why aren't you using maven to handle libraries etc?

humble tulip
#

i wanna edit it

sterile token
tender shard
#

oh ok

#

one sec I'll send a tiny blog post

sterile token
#

I will send it with discord format, because i cannot open google now

humble tulip
#

ok np

sterile token
#
   @EventHandler(priority = EventPriority.HIGHEST)
    public void onBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        Block block = event.getBlock();
        Claim claim = this.plugin.getClaims().getClaim(block.getLocation());
        if (claim == null) return;
        if (claim.getLocation().equals(block.getLocation()) && claim.getOwner().equals(player.getUniqueId())) {
            this.plugin.getClaims().delete(claim);
            player.sendMessage("§4Claim §f" + claim.getUuid() + " §4has been deleted");
            return;
        }
        if (!claim.getFlags().contains(Flag.Build)) {
            player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
            return;
        }
        if (claim.getLocation().equals(block.getLocation()) && !claim.getOwner().equals(player.getUniqueId())) {
            event.setCancelled(true);
            return;
        }
        if (!(claim.getOwner().equals(player.getUniqueId()) || claim.getMembers().contains(player.getUniqueId()))) {
            player.sendMessage("§f[BlockBreak] §cYou cannot build on §f" + claim.getUuid() + " §c claim");
            event.setCancelled(true);
        }
    }
humble tulip
#

You're testing as a member and you see "§f[BlockBreak] §cBuild flag is not enabled" right?

sterile token
#

Also this is my claim object

sterile token
humble tulip
#

ok

sterile token
#

If i test being an owner its works perfect

#

And the member system was working perfect too before adding the flag check

tender shard
#

feel free to ping me if you got any questions about maven

humble tulip
#

flag check shouldnt matter though because it does reach the last if

#

print claim.getMemebers.contains

sterile token
humble tulip
#

see what it actually is

sterile token
#

I did a command for debug

humble tulip
#

what's the output?

sterile token
#

the output is my uuid (the member account)

humble tulip
#

right but does the members list actaully contain ur uuid?

sterile token
#

Yes it contain

#

I have already checked

humble tulip
#

pls print it out in the event i beg

sterile token
#

If the member list didnt contain my uuid, it wouldnt display it on the info command

#

Allright

#

At the end?

#

Or start

humble tulip
#

anywhere

#

at the start is fine

sterile token
#

Allright

#

orry for being noob

#

But im annoyed

humble tulip
#

nah i understand

#

sorry for asking u to print that even though the info command shows that ur a member

#

but it's the only explannation

sterile token
#

Yeah dont worry

#

I will do it

#

im copiling back

humble tulip
#

someone posted this on my resource discussion thread

#

i need a translation

sterile token
#

minion

humble tulip
#

ye

sterile token
#

It just translate the message (no matter the lang) into your own lang

#

minion, im creating the claim as an owner. Them i add the member

#

And connect with the member account

humble tulip
#

yep..

sterile token
#

Allright

#

Just created the claim

humble tulip
#

right

sterile token
#

After adding a member

humble tulip
#

good

sterile token
#

Now i iwill check the output of the event when im using the meber acc

#

Shit

humble tulip
#

lmfao

sterile token
#

Now i can break with member account

#

but it send me the message

humble tulip
#

what does the debug statement say tho?

sterile token
humble tulip
#

oh u didnt set the flag

#

and u dont cancel if build flag is not set

sterile token
#

[382d5d50-0d6e-3714-9aaa-0f5c5abcb450]

#

That

humble tulip
#

set the build flag

#

it'll work

sterile token
#

the uuid is the same

#

but if the flag is not set, i shouldnt be able to break if im a member

humble tulip
#

well u didnt cancel the event

sterile token
#

oh im an idiot

humble tulip
#

ur logic is flawed

sterile token
#

LMAO

#

Sorry for losting your time

humble tulip
#

cuz owners wont be able to build if the flag isnt set

sterile token
#

What sorry?

torn shuttle
#

ok I was already ready to get started doing recovery because I thought I smoked my storage there, nah I'm gucci

sterile token
#

My goal is:

  • Claim owner do everything, no matter if flag is set
  • Members break if flag is set
humble tulip
#

build flag is checked before owner is checked

sterile token
#

So that its wrong?

humble tulip
#

for this i reccommend using nested ifs

#

yes

#

if owner

#

if member

#

else

sterile token
#

i dont like using else

humble tulip
#

well return

#

and dont use else

#

its the same thing

sterile token
#

I know

#

So wait

#

Where should i modify?

humble tulip
#

rewrite it basically

sterile token
#

What specific?

#

Sorry but im not understanding

humble tulip
#

these

#

or everything actually

tender shard
#

sure

#

you need to get verified to send pics

humble tulip
#

Verano this

#

its easier to follow

#

even though it has multiple ifs

sterile token
#

Allright

#

I will try that

tender shard
#

do you even have a pom.xml file?

#

hm hard to tell what's wrong without any screenshot

#

try View -> Tool Windows -> Maven

#

alternatively, right click your pom.xml. One of the bottom most option should be "Add as Maven project"

#

np

sterile token
#

Minion

humble tulip
#

yes?

sterile token
#

What do you think no?

echo basalt
#

you can reuse some variables here and there

#

like the player's uuid or the claim owner

sterile token
humble tulip
#

owners cant break blocks now

sterile token
humble tulip
#

those if statements are hard to read

sterile token
#

I wastesting the code and oner cannot break

humble tulip
#

which is why i suggested the above

sterile token
humble tulip
#

cuz you just wrote it

tender shard
#

you insert the <dependency> and <repository> part into your pom.xml as described in the ArmorEquipEvent's Readme file

#

maven will then download it automatically etc

humble tulip
#

it's also not organised so if u wanna make a change, it's hard to know exactly where to put it. like the flag check being too early before

tender shard
#

and click the "maven reload" button after you changed the pom.xml

sterile token
#

I have add an if (owner.equals(uuid)) return;

#

So them the owner can put blocks

humble tulip
#

that works

sterile token
#

Or its suppooused

#

I will test it know

humble tulip
#

still reccommend my suggestion

sterile token
#

Its better

#

What are you doing?

#

minions thanks i will try the code

tender shard
#

I'm 1 hour afk, some dude is coming over

sterile token
#

Minion: do you remember i dicuss cussedmore than 1h cuz of my menu library?

tender shard
#

someone pls help Yev with the pom.xml stuff lol

humble tulip
sterile token
#

Allright

#

see you soon

humble tulip
#

cant rem how long

sterile token
#

Yeah i finally fix it with the help of redempt

#

I dicussed over 1h with many people and didnt fix the lib

#

With redempt in less than 20m i fix it

humble tulip
#

haha

sterile token
#

minion

humble tulip
#

ye?

sterile token
#

Up to know the owner, can create claim, delete it and place blocks

#

now its turn to check the flag

humble tulip
#

yeah

sterile token
#

I wanna shot myself

humble tulip
#

please just organise your code like i showed u

#

and u wont have to deal with this

sterile token
#

it hurt my eyes

humble tulip
#

you'll get used to it

#

these bugs will hurt your brain

torn shuttle
#

now that's what I call gaming

sterile token
#

really

humble tulip
#

ur not using else

sterile token
#

Its really ugly to develop like that

humble tulip
#

just nesting your statements

#

who gives a shit if it's ugly

#

atleast you can understand what's going on and follow the logic in ur head

sterile token
#

I understand the log

#

But for some reason its not okay

humble tulip
#

if you did you wouldn't get those bugs

#

send ur code again

sterile token
#

ok

#

1 sec

#

fucked intellij does not anwers

#

i dont know why its eating 16gb of ram

humble tulip
#

i only have 16gb

sterile token
humble tulip
#

send ur code

sterile token
#

sorry

#

i didnt copy

#
@EventHandler(priority = EventPriority.HIGHEST)
    public void onBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        Block block = event.getBlock();
        Claim claim = this.plugin.getClaims().getClaim(block.getLocation());
        if (claim == null) return;
        if (claim.getLocation().equals(block.getLocation()) && claim.getOwner().equals(player.getUniqueId())) {
            this.plugin.getClaims().delete(claim);
            player.sendMessage("§4Claim §f" + claim.getUuid() + " §4has been deleted");
            return;
        }
        if (claim.getLocation().equals(block.getLocation()) && !claim.getOwner().equals(player.getUniqueId())) {
            event.setCancelled(true);
            return;
        }
        if (claim.getOwner().equals(player.getUniqueId())) return;
        if (!claim.getFlags().contains(Flag.Build) && claim.getMembers().contains(player.getUniqueId())) {
            event.setCancelled(true);
            player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
            return;
        }
        event.setCancelled(true);
        player.sendMessage("§f[BlockBreak] §cYou cannot build on §f" + claim.getUuid() + " §c claim");
    }```
#

Ah

#

Discord crashed for some reason

#

Are u there?

humble tulip
#
    @EventHandler(priority = EventPriority.HIGHEST)
    public void onBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        Block block = event.getBlock();
        Claim claim = this.plugin.getClaims().getClaim(block.getLocation());
        if (claim == null) return;
        if (claim.getOwner().equals(player.getUniqueId())) {
            //if source delete
            if (claim.getLocation().equals(block.getLocation())) {
                this.plugin.getClaims().delete(claim);
                player.sendMessage("§4Claim §f" + claim.getUuid() + " §4has been deleted");
                return;
            }
            //allow everything else
            return;
        }
        if (claim.getMembers().contains(player.getUniqueId())) {
            //if source block cancel
            if (claim.getLocation().equals(block.getLocation())) {
                event.setCancelled(true);
                return;
            }
            //if not build cancel
            if(!claim.getFlags().contains(Flag.Build)) {
                event.setCancelled(true);
                player.sendMessage("§f[BlockBreak] §cBuild flag is not enabled");
                return;
            }
            //else allow
            return;
        }        
        //not member or owner
        event.setCancelled(true);
        player.sendMessage("§f[BlockBreak] §cYou cannot build on §f" + claim.getUuid() + " §c claim");
    }
sterile token
#

a

#

oh

#

please nested if !!

#

I wanna cry

#

Sorry

humble tulip
#

isn't it easier to follow?

sterile token
#

But yeah i ill test it

humble tulip
#

sometimes nested ifs are bad

#

sometimes they're good

sterile token
#

Mye

humble tulip
#

ok conclure

sterile token
#

i think today i have exported more than 1000

#

The same jar

#

Imagine

#

Im exausted

#

If i fix this i will go to smoke something to get unstressed

#

Im starting the server for time 500th

#

or something similar

humble tulip
#

just keep it running and use plugman

sterile token
#

i have configured a local workflo

#

Which once the plugin is compiled its automatically is put inside plugins folder and the server is restarted

humble tulip
#

i hope u use paper then

#

cuz spigot takes so long to startup

sterile token
#

no i use spigot

humble tulip
#

world loading is slow af with spigot

sterile token
#

I dont use it because most plugin dont ork on bukkit

humble tulip
#

not bukkit, paper

sterile token
#

Because in my personal i always try plugins design for spigot into paper

#

And most of time get issue

#

minion

humble tulip
#

yes?

sterile token
#

The isue is no the code

#

:rag:

#

😡

#

IM FUCKED ANNOYED

humble tulip
#

what was output?

#

it's probably the code, i nested the ifstatements u gave

sterile token
#

the output is the same: "you cannot built on claim..."

humble tulip
#

are you a member?

sterile token
#

It doesnt show the output message from the flag

sterile token
#

And i copy-paste your code

#

😡

#

Im too much annoyed LMAO

#

At this time you are annoyed like me

#

Hahaha

humble tulip
#

can i see /claim info

#

wtf

sterile token
#

yes

#

HMNN

#

Too much

#

They are the same

#

He ait

#

Could be cause because method /ps add <player> uses an OfflinePlayer object?

#

Maybe is that

humble tulip
#

the uuids are not the same

sterile token
#

I have just realized

#

I dont know why

humble tulip
#

add when they;re online

sterile token
#

Yeah i will refactor the command

humble tulip
#

oflline server mc names are case sensitive

sterile token
#

and test again

humble tulip
#

so use the correct case

#

and try again

#

u dont need to rebuild

sterile token
#

the name is correct

humble tulip
#

did u use a capital C?

sterile token
#

Yeah

#

i did. /ps add Cipher

humble tulip
#

1234?

sterile token
#

isnt 12345?

humble tulip
#

no 🤦‍♂️

sterile token
#

LMAOOO

#

Im fucked stupid

#

I always did: /ps add Cipher12345

humble tulip
#

it works now doesnt it

#

yeah you're dumb

sterile token
#

Yes

humble tulip
#

braindead

sterile token
#

Because the code was correct

#

So it was either the offline player or something else

humble tulip
#

sometimes it was sometimes, it wasnt

sterile token
#

Sorry for losting you more than 1 h

#

I will test it

humble tulip
#

dw

#

im demotivated from working on my plugin

sterile token
#

Lol

#

Really?

#

hat type is it

humble tulip
#

paypal lifted my account restrictions but

#

i cant receive money

sterile token
#

Oh

humble tulip
#

so i cant release my prem plugin

#

so i stopped working on it

sterile token
#

Lol really extrange

#

Me being 15y i use paypal

humble tulip
#

me being 21 and cant

sterile token
#

yeah

#

LMAO

#

Im fucked idiot

#

I never realized i was writing wrong the name

#

It worked

#

thanks

tender shard
#

im baaaack bitches

#

wassup

#

I hope everyone here had a nice day so far

humble tulip
#

i need some help mfnaleks

#

how do i build a plugin that is also a java program with maven

tender shard
#

do you have a pom.xml for your project?

humble tulip
#

i'll send it 1 sec

tender shard
humble tulip
#

i mean with a Main class with a main(String... args) method

#

?paste

undone axleBOT
humble tulip
tender shard
#

you mean that it automatically runs this main method when you double click the .jar?

humble tulip
#

yep

tender shard
#

oh ok

#

no problem one sec

#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <finalName>${project.name}-${project.version}</finalName>
                    <archive>
                        <manifest>
                            <mainClass>com.jeff_media.standalonepluginscreen.StandalonePluginScreen</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
humble tulip
#

<mainClass>

#

i see

tender shard
#

exactly

#

ignore the <finalName> thing

#

only important thing is the <archive> stuff

humble tulip
#

difference between maven-jar-plugin and compiler plugin?

sterile token
#

mfalex with that you can build executable jars?

sterile token
tender shard
#

the jar plugin is basically like winrar

#

it takes the compiled files and "zips" it into a .jar file

#

you need both

#

?paste

undone axleBOT
humble tulip
#

i never had the jar plugin setup before

tender shard
humble tulip
#

im guessing it's deafult

tender shard
#

just for example, here's one of my plugin's pom.xml

tender shard
humble tulip
#

gotcha

#

ty it works

tender shard
#

:3

#

maven is so awesome

humble tulip
#

am i allowed to upload plugins that can run a java tool to setup the plugin?

#

like my own program

dusk flicker
#

i mean thats sketch as shit

humble tulip
#

so there's the plugin and then there's also a Main class that runs a regular java program which is used to setup the plugin

dusk flicker
#

why would you need to do that

humble tulip
#

to make it easier to configure

#

like with a gui

dusk flicker
#

thats just gonna be annoying

#

what are people going to do if they are not running a system with a ui?

humble tulip
#

true..

sterile token
#

What if you are using a hosting?

#

Hosting doesnt provide you UI

tender shard
#

but I don't think it's very useful

#

99% of servers don't even have a desktop environment

#

I mean my plugins also have a tiny GUI that runs when you double click the file

humble tulip
#

i want to make it easy to configure but i cant be asked to use minecraft chest guis

sterile token
#

sorry for asking again, but i still cannot figure how works the configuraction section code

tender shard
humble tulip
#

ah ok

dusk flicker
#

dont bother making a gui thing then

#

make them use a config file

sterile token
dusk flicker
#

only real men use config files for everything. no ingame or external assistance

sterile token
#

Config section are literally a map right?

humble tulip
#

yes

dusk flicker
#

config sections are weird as shit

#

never been able to successfully do em

sterile token
#

Me too hahaha

humble tulip
#

wdym?

#

configurationsection?

sterile token
#

Because im doing a lib for parsing json and yaml files, for vanilla java. And i want to recreate the configuration section

#

Because then i can use that library for parsing Bungeecord and spigot yaml files

humble tulip
#

it's a Map<String,Object> basically

tender shard
sterile token
humble tulip
#

well it's nowhere near done

sterile token
#

Is it public?

#

My hurts its running fast now that you said you have a plugin message api

#

Does it require an online player your api?

humble tulip
#

yeah

sterile token
#

Oh shit

#

I was emotionated

humble tulip
#

why cant bungee talk to servers with no players?

sterile token
#

I was trying to do one undependable from users

humble tulip
#

i mean.. they're literally connected

dusk flicker
sterile token
dusk flicker
#

They cannot talk with servers with no players when using PDCs

dusk flicker
#

?pdc

dusk flicker
#

oh fuck im stupid

#

?pmc

humble tulip
#

i know what pdc is

dusk flicker
#

PMCs

#

LOL

humble tulip
#

oh

#

LOL

#

why is plugin messaging the defualt way to send info then?

sterile token
#

Bungee and Spigot can talk theirself just using the fucked server conection, instead of player connection so why do you they use player connection? HMN

dusk flicker
#

its weird ¯_(ツ)_/¯

#

PMCs require a player on each end for some reason, never really looked into it but Ive never touched em for that reason

#

I always run redis pub/sub

sterile token
#

I know

dusk flicker
#

I guess it really is as the spigot/bungee servers dont actually talk to each other

#

they just communicate via player connections

humble tulip
#

cant bungee fake a player connection to talk to servers though

sterile token
humble tulip
#

and since spigot is needed to connect to bungee, spigot can intercept the fake connection

dusk flicker
#

but that getServer is a bungee one

#

?jd

sterile token
#

Minion

humble tulip
#

ye?

sterile token
#

I try to fake a connection

dusk flicker
sterile token
humble tulip
#

does it send the data tho?

sterile token
#

It send 2 packets only

#

Handshake and login

#

Maybei forget other packets

humble tulip
#

can't bungee just put fake players in every server

#

and use that to communicate

sterile token
#

To fake a player you have to fake a connection

#

That what i think

humble tulip
#

now i wanna try something

#

fuck i need to sleepp

sterile token
#

Let try something

#

Im wondering to do such an api

#

Like that

#

For working with PMCs without player

#

Do you wanna to do it them together?

sterile token
humble tulip
#

i'm gonna test something and i'll tell you

sterile token
#

Allright thanks

#

I have some code if you want it

humble tulip
#

let me see how you created ur connection

sterile token
#

Yeah

#

1 sec

#

See dm

echo basalt
sterile token
#

I never figured ho

#

Imlussion

#

Is there a ay to fake a bungee player?

#

Without faking a real connection?

sturdy heron
#

Hello, I ran into a problem with player.getDisplayName(). Whenever I use it to check the display name, or aka the prefixes and suffixes currently applied, it only updates them when the player chats. Is there a way of getting a more accurate display name?

ornate patio
#

what is the age measured in?

earnest forum
#

probably ticks

ornate patio
#

ticks since spawned in?

earnest forum
#

yeah

#

try it and see

hardy swan
#

${project.version} doesn't work when plugin.yml not included in resource config?

#

;-;

ornate patio
#

what does temper on a horse mean?

ivory flume
#

how is it used

#

is it a field? what type?

ornate patio
#

its an NBT tag

#

nevermind i doesnt matter

#

anyways

#

is it possible to convert a Horse's color and style into an integer that minecraft uses?

#

right now I'm resorting to doing this to identify every single color and style variant number

#

and its not fun

#

nvm i think i found the formula they use

humble tulip
tranquil viper
#

Is this a safe cast?

sterile token
tranquil viper
#

thanks

worldly ingot
#

*currently, yes it's safe

#

Player is the only HumanEntity, but that's not to say that won't change in the future

tranquil viper
#

Ah it's all good, I didn't want to risk if the player died or something. Realized I only needed it's uuid anyways so there wasn't much point in casting

worldly ingot
#

you may be able to use a HumanEntity

#

Yeah there you go

tranquil viper
#

thanks!

ornate patio
#

is it possible to set the age that a baby horse will grow up to an adult

ornate patio
#

no like

#

is it possible to set an amount of ticks

#

that when the horse's age hits that amount of ticks, itll automatically become an adult

lethal coral
#
Vector velocity = forwardsVector.multiply(new Vector(Util.randomDoubleBetween(-0.05, 0.25), Util.randomDoubleBetween(-0.05, 0.05), Util.randomDoubleBetween(-0.05, 0.05)));

alright so I'm basically trying to make a shotgun spray and this is the current code I have for modifying the forwards vector
can someone like explain to me why this doesn't work as expected? (projectiles fly everywhere including behind me and way to the side)

#
    public static double randomDoubleBetween(double num1, double num2){
        return ThreadLocalRandom.current().nextDouble(num1, num2);
    }

that's the util methodby the way

lethal coral
ornate patio
#

I'm trying to access a private method of Horse from NMS

#

setArmorMethod = getClass().getSuperclass().getDeclaredMethod("setArmor", net.minecraft.world.item.ItemStack.class)

#

I'm getting a java.lang.NoSuchMethodException though

#

is this possible because I'm using Mojang Mapped?

#

if so, how would I get the obfuscated name of the method

summer scroll
ornate patio
#

yeah, thats what its doing behind the scenes

#

although the problem is that I'm using Java Reflection API to access a private method

#

but this private method's name is being changed behind the scenes

ornate patio
#

yooo what the hell

summer scroll
ornate patio
#

how did I not see this before

summer scroll
#

I just found this site too, it's pretty cool.

earnest forum
#

thats amazing

#

thanks

ornate patio
#

anyways it worked too

hardy swan
#

The behavior I was referring to is that you need to actually configure the resources in pom for ${project.version} to work/converted in your resources.

#

Or for any pom variables for that matter.

hardy swan
quaint mantle
#

how do I convert an src to a jar

minor otter
#

how could I stop client predictions regarding tripwire?

golden kelp
#

like your code?

quaint mantle
wet breach
#

?learnjava

undone axleBOT
earnest forum
#

watch literally any episode 1 of any youtuber's spigot tutorials

#

they show you how to build plugins

golden kelp
dusty herald
#

grandle

prime kraken
#

Hello team, hope you are all good, I have a problem, I'm trying to use custom config file, I have this error in the log when i'm trying to execute the command : ```Caused by: java.lang.NullPointerException

at fr.valdara.valdara.romain.Braquage.SetOrRemoveBlock.onCommand(SetOrRemoveBlock.java:85) ~[?:?]

at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.16.5.jar:2991-Spigot-018b9a0-f3f3094]

... 19 more``` but in the specified line, Intellij return me 0 error, what should I do ? specified line :  ```getConfig().set("players." + p.getUniqueId().toString() + ".diamondBlockLocation", p.getTargetBlock(null, 100).getLocation());
wet breach
golden kelp
#

oh

glass mauve
prime kraken
glass mauve
#

which targeted block? the one that the players looks at?

prime kraken
#

Yes

glass mauve
#

then you pass the wrong stuff to the method

#

you pass "null" for maxDistance

prime kraken
#

I will try to remove that so, very strange bcs that return me no error when i just to p.getTarget block without the config.set

#

Same error, I do something wrong

glass mauve
#

show your code and full error pls

prime kraken
#

Yep

#

?paste

undone axleBOT
prime kraken
#

i just have a data.getConfig instead of juste getConfig

#

Probably think i was in another class i don't know why i put that, but thanks for your help instead !

glass mauve
#

👍

#

Im still confused why you are using p.getTargetBlock(null, 100)

prime kraken
glass mauve
#

no, but why null, 100 for int maxDistance, FluidMode mode

prime kraken
#

now i Use p.getTargetExactBlock(int maxDistance)

glass mauve
#

👍

sharp flare
#

how does one get all the blocks that can be mined from the nether by means of tag

earnest forum
#

who pinged me?

dreamy arrow
#

need help. my buildtools isn't setting up. there is a compilation error or some sort

earnest forum
#

someone ghost pinging me

earnest forum
dreamy arrow
#

did man wait let me post the log

#

check the very end

#

that's where the error is logged

#

u need to declare config inside onPlayerJoin

#

u declared config on onEnable() method then tried to access it from onPlayerJoin method. that wont work

chrome beacon
#

No

#

You just need to learn some Java

#

?learnjava

undone axleBOT
chrome beacon
#

You are expected to learn Java before starting Spigot

#

Start by following a few of the guides above

thorny dawn
#

You can't jump straight into the API without having at least a basic knowledge of how it works.

#

what is wrong with my di? (kotlin)

chrome beacon
#

?main

thorny dawn
chrome beacon
#

As for your issue I can't help I'm too bad at kotlin 🙃

chrome beacon
thorny dawn
chrome beacon
#

Yes

earnest forum
thorny dawn
# chrome beacon Yes

First screenshot: (class CountdownInit)

public class CountDownInit implements Runnable {
  Main plugin = null;

Second screenshot: (class CountdownInit)

public (static?) void CountdownInit(Main plugin) {
  this.plugin = plugin
  }

Third screenshot: (class Main)

public class Main extends JavaPlugin() {
  CountdownInit countdownInit = null

Fourth screenshot: (class Main)

public Main Main() {
    countdownInit = CountdownInit()
#

i put static in "?" as i dont know how its used

chrome beacon
#

Yeah that's not even valid Java

thorny dawn
#

yeah idk lol im not really good at it

chrome beacon
#

The only issue I can see is that you're not passing the main instance in your CountdownInit method

thorny dawn
#

how would i do that?

chrome beacon
#

But I think that's actually your constructor no?

#

CountdownInit(this)

thorny dawn
earnest forum
#

get rid of the void

#

for CountdownInit

#

and the static

chrome beacon
#

Ah yeah you defined it as a method instead of the constructor

#

Do what Intellij suggests

thorny dawn
#

still getting a nullpointerexception

chrome beacon
#

Could you show your code now

twilit pulsar
thorny dawn
#

countdowninit class

chrome beacon
#

Alright you need to remove the CountdownInit function and move the code in to the constructor

#

I can't really help with that but a quick google search should be able to tell you how

chrome beacon
#

CountdownInit constructor

thorny dawn
chrome beacon
#

di

thorny dawn
#

ok

short raptor
#

/give @p item_frame{EntityTag:{Invisible:1b}} how can I set this EntityTag on my itemstack, like how this command does it?

golden tulip
#

Can I make a bungecord module to make /gamemode for example?

chrome beacon
chrome beacon
golden tulip
#

How?

chrome beacon
dreamy arrow
#

u r required to learn at least the basic concepts of java before starting spigot-api. the api itself is based on java. how r u supposed to work on something if u don't know to manipulate the language itself at basic level

dreamy arrow
earnest forum
#

not required

#

its just common sense

dreamy arrow
earnest forum
#

no common sense to learn it

#

its not a requirement

#

i didnt learn it and i struggled

#

i did have some experience with like c++ and other stuff

#

which kind of helped

dreamy arrow
#

i struggled too when i started cuz i didn't know stuff about java except for variables and methods and a bit about classes. at the end I hit a big wall because my way of writing code became very inefficient. In areas where i would could have used java's builtin features I made my own cuz I didn't even knew these stuff existed. I had to go back learn java and come back to spigot.

earnest forum
#

yeah

#

i watched coded red

#

he taught the api well but java terribly

#

i had bad habits

dreamy arrow
#

i did python before it so i knew concepts of variable ands functions and stuff

#

but not much. i used to watch source code

#

:V well i would just copy his code and modify it. sometimes it worked sometimes it didn't

#

lmao

earnest forum
#

ahaha same

#

the source code didnt explain stuff well

#

for me

humble tulip
#

Oop was really hard to grasp

earnest forum
#

he just sort of vomited out code at you

dreamy arrow
#

ye

#

xd

humble tulip
#

When first learning

dreamy arrow
#

ye oop became a big help on big projects

humble tulip
#

Imaging having a shit ton of maps

#

😂😂

dreamy arrow
#

lmao. drain that memory

earnest forum
#

i watched this one guy who instead of making a class for Island

dreamy arrow
#

no cap

earnest forum
#

for skyblock server

#

he made a list of UUIDS that were the owner of the island

humble tulip
#

Lmao

earnest forum
#

basically just didnt even know what OOP was

dreamy arrow
#

breh wot

#

yep

#

:V now i have to install buildtools on linux to see if it installs. its not working for my windows 10 pc. but it worked fine on windows 7

#

kinda weird

earnest forum
#

have you updated java

dreamy arrow
#

Ye I am using the updated version of Java 8. Cuz I am installing spigot 1.8.8

mighty pier
#

i have a yamlconfiguration like this: uuid: kills: 6 deaths: 9 how do i get the top 10 players that have the most kills

humble tulip
#

U gotta iterate my guy

dreamy arrow
#

Well I guess u gotta scan through all

#

Hehe

humble tulip
#

Or use sqlite or something

mighty pier
dreamy arrow
earnest forum
#

turn it into a hashmap

#

get all of the entries

#

turn them into a hashmap

#

iterate through them

mighty pier
#

k

humble tulip
#

It's already a hashmap internally

#

Just go thru all and store the buggest vallue

mighty pier
#

bu7g

humble tulip
#

If u see a bigger value set that as the biggest

mighty pier
#

i want to get the top 10

humble tulip
#

Honestly.. Just use some form of sql storage

mighty pier
#

too lazy

dreamy arrow
#

:v wdym

humble tulip
#

Sotring on the main thread can be laggy

dreamy arrow
#

Don't u know how to use sql@mighty pier

mighty pier
#

i do

#

but

#

pain

humble tulip
#

Easiest would actually be to throw it in a treemap and sort

#

Do u know hiw to use sqlite?

mighty pier
#

no

humble tulip
#

No pain

#

It's sql but with a file

#

No server

mighty pier
#

i will try to use that

humble tulip
#

Yml isn't meant for data

mighty pier
#

its not

dreamy arrow
#

Ye. It's meant for basic configuration. I remember I used to store server player data on these xd

#

the server became so laggy when players joined. Ticks would go down

chrome beacon
#

That's more your fault than yaml

#

The one I linked says it has a commit for 1.17

#

Yeah port that

dreamy arrow
prime sandal
#

Hello, I need to know if is it possible to edit de max durability of an Iteam in 1.8.8 ?
I've try this code using reflection but cannot give the nms item to the player ..

chrome beacon
#

Keep track of durability yourself with events

prime sandal
chrome beacon
#

You're only going to cause issues

prime sandal
tender shard
#

PlayerItemDamageEvent

sharp flare
#

is there a way to get the list of mobs that spawn in the nether

prime sandal
prime sandal
tender shard
sharp flare
#

aight ill just put the mobs in a json file

sharp flare
#

but thanks though

tender shard