#help-development

1 messages · Page 1703 of 1

carmine nacelle
#

im not even gonna try to read that lol my brain hurts 😂

#

yes send the code

quaint mantle
sharp kelp
#

The inv in this method is the inventory which is a final type variable and is public

@Override
    public Inventory getInventory() {
        return inv;
    }
``` I need to use p.openInventory(ResourecpackSelection.getInventory()) to open this in the event class but it gives error and says make the public Inventory to public static Inventory
quaint mantle
#

i think im gonna post it on spigot too lol

sharp kelp
#

@carmine nacelle

languid geode
#

Hey guys working on spigot ATM and need a opinion. If BlockDispenseArmorEvent's itemstack is changed would you guys want it to be called again with the new itemstack or would you rather that it only call the event again if the dispense behavior is different from that of the original item

quaint mantle
carmine nacelle
#

@quaint mantle try it, guarantee it works.

sharp kelp
carmine nacelle
#

I dont even want to help you anymore @sharp kelp .

#

are you like 11? holy shit

sharp kelp
#

ok ok I was jk... kay imma wait...

#

I am 14

quaint mantle
#

@sharp kelp ya know stop being a little annoying will help you alot

sharp kelp
#

Imma wait.. okay

quaint mantle
quartz pike
#

?learnjava

undone axleBOT
carmine nacelle
#

Ok so now you have 3 classes.

  1. Main class
  2. Inventory class
  3. event class
    right...?
#

To avoid having multiple instances of the inventory class, you would want to reference it from where it's already being created the first time.

#

so you'd have the constructor in the event class, same as the inventory class, passing the main into it.

#

@sharp kelp

#

@quaint mantle try it yet?

quaint mantle
carmine nacelle
#

ok

languid geode
carmine nacelle
quaint mantle
# carmine nacelle ok

yeah nothing really work out, exept i just realized something

java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getString(String)" is null
at com.risingcore.events.onDeathRespawn.onRespawn(onDeathRespawn.java:64) ~[?:?]
[?:?]```
quaint mantle
#

maybe the loop dont work

#

that

carmine nacelle
#

What's on line 64?

quaint mantle
#
            if (locationsData.getCustomConfig().getString(locationName + ".world").equals(p.getWorld().getName())) {```
languid geode
#

But im stuck on a design decision would it be better to call the event again if the dispense behavior is different (Think item vs armor) or to call the event every time the itemstack if different from the one that called the event

quaint mantle
#

yeah because the locationName dont work

#

so it is null

#

and that's make me think the loop dont work with the locationName

carmine nacelle
#

Why doesn't it work?

quaint mantle
carmine nacelle
carmine nacelle
languid geode
#

Spigot API changes

quaint mantle
carmine nacelle
#

well you havent sent me them

#

so idk whats giving

#

oh

#

thats not what I mean

#

print them at the start of the for

#
        for (String locationName : locationsData.getCustomConfig().getKeys(false)) {
// Print locationName here
            if (locationsData.getCustomConfig().getString(locationName + ".world").equals(p.getWorld().getName())) {
                sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation(locationName)), locationName);
            }
        }
sharp kelp
#
public static Inventory inv;
    private setup main;
    public static Boolean trigger;

    public ResourcepackSelection(setup main) {
        inv = Bukkit.createInventory(this, 9, "Downloading Resourcepack...");
        load();
        this.main = main;
    }
    
    @SuppressWarnings("unused")
    private void load() {
        
        ItemStack item;        
        List<String> lore = new ArrayList<>();
        // lore.add("§7Example Lore");
        new BukkitRunnable() {
            int slot = 0;
            @Override
            public void run() {                
                if (slot<8){
                    ItemStack item = createItem("", Material.BLACK_STAINED_GLASS_PANE);
                    inv.setItem(slot, item);
                    slot++;
                } else {
                    trigger = true;
                    this.cancel();
                }
                
            }
        }.runTaskTimer(main,0,10);
    }
    
    private ItemStack createItem(String name, Material m) {
        ItemStack item = new ItemStack(m, 1);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(name);
        item.setItemMeta(meta);
        return item;
    }

    @Override
    public Inventory getInventory() {
        return inv;
    }

So I made multiple edits
First I changed private final Inventory inv; to public static Inventory inv;
Then Instead of how the tutorial did by making a small method with return value of inv I directly used the variable inv in the event
Will this work?

vernal pier
#

If i want to do something every tick to all players is it better to use Bukkit.getOnlinePlayers() or should i have a collection and just add player when they join

quaint mantle
#

replace done

carmine nacelle
carmine nacelle
carmine nacelle
quaint mantle
#

vivian is busy, like very busy lol

carmine nacelle
#

correct

#

@sharp kelp Still not the best way to do it though.

quaint mantle
#

nothing even work at the start :madman:

[INFO] .... Firminus issued server command: /kill
[INFO] .... Firminus fell out of the world
[INFO] .... [Firminus: Killed Firminus]
[INFO] .... Firminus issued server command: /gamerule doImmediateRespawn false
[INFO] .... [Firminus: Gamerule doImmediateRespawn is now set to: false]
[INFO] .... Firminus issued server command: /kill
[INFO] .... Firminus fell out of the world
[INFO] .... [Firminus: Killed Firminus]
[INFO] .... Firminus issued server command: /gamerule doImmediateRespawn true
[INFO] .... [Firminus: Gamerule doImmediateRespawn is now set to: true]
[INFO] .... Firminus lost connection: Disconnected
[INFO] .... Firminus left the game```
sharp kelp
#

Yes But i will first check

#

if any method works then I will use it if it does

carmine nacelle
quaint mantle
#

nothing happens

carmine nacelle
#

yeah almost like that config structure doesn't work

quaint mantle
#

than just some others events i already set

carmine nacelle
#

like ive been trying to say

quaint mantle
carmine nacelle
#

so... do this

#
holos:
  Test:
    location: world, -337.9180889181425, 72.0, -446.26819453769014
    owner: e42b60b0-c35a-462f-a2b4-b1a9980f399e
    lines:
    - '&cTest 1'
    - '&cTest 2'
    - '&cTest 3'
    - '&cTest 4'

#

this is how I have my config setup.

#

except it would be locations instead of "Test"

quaint mantle
#

yea

carmine nacelle
#

so it would be

locations:
  Location1:
    blahblah
  Location2:
    blahblah
  Location3:
    blahblah
quaint mantle
#

i have no idea why adding another line of "locations" means everything work LOL

#

but

#

let me test it

carmine nacelle
#

ok so

#

the "another line of "locations""

#

is a configurationsection

#

its a starting point for the loop to start at and loop through the things inside it.

#

just try it

#

if im wrong then u can make fun of me lol

quaint mantle
#

lol

#

ok

carmine nacelle
#

but im not, so just try it if u want my help

quaint mantle
#

im gonna suicide if adding another line work :v

carmine nacelle
#

should I get the hotline # for you then?

carmine nacelle
#

well you cant just change the config, you have to change the saving/loading code too.

carmine nacelle
#

so is it working then?

quaint mantle
carmine nacelle
#

show your config.

#

then the save and load code

quaint mantle
#

hahaha i lied to you

carmine nacelle
#

?

quaint mantle
#

i mean the config it didnt change

#

even tho i changed in the save load code

carmine nacelle
#

show the code

#

and config

quaint mantle
#
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args) {
        if (sender instanceof Player p) {
            if (!sender.hasPermission("risingcore.spawnsystem")) {
                return true;
            }
            if (args.length == 1) {
                String locationName = args[0];
                if (locationsData.getCustomConfig().contains("locations" + locationName)) {
                }
                locationsData.getCustomConfig().set("locations" + locationName, p.getLocation());
                locationsData.saveCustomConfig();
                return true;
            }
            return true;
        }
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("messages.console-execute")));
        return true;
    }
carmine nacelle
#

ewww

#

format it

quaint mantle
#

yeah this looks better

#

i remove all the title

carmine nacelle
#

ah

#

ok

#

show your config now

quaint mantle
#

nothing change __(:/)__/

carmine nacelle
#

how did nothing change

#

did you delete the file?

quaint mantle
#

let's export it again

quaint mantle
carmine nacelle
#

re-export and delete the config again

#

ah fuck

#

ok

#

you need..

#
if (locationsData.getCustomConfig().contains("locations" + "." + locationName)) {
#

need the dot between so it goes to a new line and stuff for formatting

#

same for the setter

quaint mantle
#

ahh shiet here we go again

carmine nacelle
#

yup here we go again

quaint mantle
#

basic stuff

quaint mantle
carmine nacelle
#

send ur config again

#

ik it didnt change or whatever but idc

#

send it

#

it might already be formatted that way, i dont remember cause u refuse to send it

quaint mantle
#

.

#

nothing special than this than some coords change

carmine nacelle
#

ok you dont need the dot

#

its already formatted fine

#

but you should have

#

lied again, you do need the dot still

quaint mantle
#
  Firminus:
    ==: org.bukkit.Location
    world: world
    x: -4.9501626474914575
    y: 71.0
    z: -255.56610549926532
    pitch: 46.04815
    yaw: -80.76631
carmine nacelle
#

YES

#

THERE WE GO.

#

ok

quaint mantle
#

lol

carmine nacelle
#

now were getting somewhere.

quaint mantle
#

ur reaction are very l0l

carmine nacelle
#

ok send the respawn thing

quaint mantle
#
        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations.").getKeys(false)) {
            System.out.println(locationName);
        }```
carmine nacelle
#

its 7:30 am ive been up all night coding and dealing with children

quaint mantle
carmine nacelle
#

ok that should just print "Firminus"

#

i dont think thats a girl

quaint mantle
#

MAN

#

MAN

#

im gonna suicide after i send u this

carmine nacelle
#

800-273-8255

quaint mantle
quaint mantle
carmine nacelle
#

Yeah, wild huh

#

ok

quaint mantle
#

yeah spigot just suck

carmine nacelle
#

now add back the other code to teleport

quaint mantle
#

i dont know why it have the getKeys but it cant use in getconfig, need to be after the configurationsection

carmine nacelle
#

correct

#

thats where its supposed to be

quaint mantle
#
        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations.").getKeys(false)) {
            if (Objects.equals(locationsData.getCustomConfig().getString("locations." + locationName + ".world"), p.getWorld().getName())) {
                sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);
            }
        }
        String locationName = sorteddistance.values().toArray()[0].toString();
        e.setRespawnLocation(locationsData.getCustomConfig().getLocation("locations." + locationName));```
to ensure that it is what we are talking about, im gonna send it here
carmine nacelle
#

i might be wrong but in yml you can have...

setting1: test
setting2: test2
setting3: test3
setting4: test4

because they're all completely separate, whereas to have nested items such as locations, you need to have it in tree format.

#

get rid of your "object" crap

#

REEE

#
if (locationsData.getCustomConfig().getString(locationName + ".world").equals(p.getWorld().getName())) {
quaint mantle
#

REEE it dont matters man maybe it is better lol i can see it more clearly

carmine nacelle
#

this is your line 2 of for loop

quaint mantle
#

and it is the same .-.

carmine nacelle
#

all the Objects is doing is converting it to a format that its not getting the error on

#

so?

#

discord just crashed that was a neat party trick.

quaint mantle
carmine nacelle
#

whatever i guess

#

see if it works

quaint mantle
#

uhhh

#

uhhhh

sharp kelp
#

back

tacit drift
proud basin
#

LMAO

tacit drift
#

I always see people having something like that in the config

carmine nacelle
#

== means its a class

quaint mantle
tacit drift
#

ooh ok

carmine nacelle
#

wait...

#

@quaint mantle ur really gonna need the number in a second

#

ready?

quaint mantle
# carmine nacelle see if it works
        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations.").getKeys(false)) {
            if (Objects.equals(locationsData.getCustomConfig().getString("locations." + locationName + ".world"), p.getWorld().getName())) {
                sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);
            }
        }
        String locationName = sorteddistance.values().toArray()[0].toString();
        e.setRespawnLocation(locationsData.getCustomConfig().getLocation("locations." + locationName));```
this is the code that supposed to work right?
carmine nacelle
#

delete the for loop except sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);

#

you dont need the for loop

#

you can just do... config#getLocation

quaint mantle
#

what do you mean by it .-.

carmine nacelle
#

you can get location objects

#

from the config

#

directly

#

built in

sharp kelp
#

Yassevzriona

quaint mantle
#

every?

#

i think it only 1

carmine nacelle
#

only 1 what

quaint mantle
#

not every location objects

carmine nacelle
#

ok so you could do

#
getHoloConfig().getLocation("locations" + "." + locationName);
#

this, except with your config name ofc.

quaint mantle
#

yes man, which i mean locationName is what i need, that's why the for loop exist lol

solar sable
#

i have just found a way to create a plugin, and now i have the plugin all setup with the plugin.yml and the main java but now i don't really know how to add stuff to it, can someone maybe show me any examples on how to add cool stuff to it? since i just started, i think it would be great if it was simple like maybe adding my own command that does something cool?

carmine nacelle
#

man

#

you can call location.getName()

#

after getting the location

#

hold on

quaint mantle
carmine nacelle
#

brain.exe not responding

shadow night
solar sable
sharp kelp
#

Oki vivian Imma wait but use the threads to reply to m

carmine nacelle
#

What is "sorteddistance" anyway?

quaint mantle
carmine nacelle
#

does it teleport you to the nearest spawn?

quaint mantle
carmine nacelle
#

so is it to get the closest spawn to the player?

carmine nacelle
#

ive never used treemap...idk how its different from hashmap, but

ivory sleet
#

It uses a comparator to store stuff

carmine nacelle
#
        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations").getKeys(false)) {
// Print locationName here
            if (locationsData.getCustomConfig().getString(locationName + ".world").equals(p.getWorld().getName())) {
                sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation(locationName)), locationName);
            }
        }
#

this is your new for loop

ivory sleet
#

as opposed to hashing

carmine nacelle
#

try it

ivory sleet
#

Though if it’s a TreeMap you might as well just expose the type to be a SortedMap instead of just a Map

quaint mantle
#

yes i actually want to find a way to sort it. after 3d i found out why dont i just use it directly instead of using another hashmap to store then use the constructor of that hashmap to put into the treemap

carmine nacelle
#

@ivory sleetthank god, pls help ive been helping like 4 ppl at once 😭

languid geode
quaint mantle
ivory sleet
carmine nacelle
#

I do if I dont want ppl spam mentioning me 400 times

#

NOOOOOOOOOOOOOOO

undone pebble
#

haha

languid geode
#

@carmine nacelle @carmine nacelle @carmine nacelle xP

carmine nacelle
#

im gonna need that number

quaint mantle
#

@carmine nacelle @carmine nacelle @carmine nacelle xP

ivory sleet
#

Yes RPGAccount but your TreeMap is not substitutable with a HashMap in this case

languid geode
#

!java

ivory sleet
#

Thus breaking the substitution principle ¯_(ツ)_/¯

languid geode
#

derp whats the learn java cmd again

#

?java

quaint mantle
#

?learnjava

undone axleBOT
carmine nacelle
#

@quaint mantle try with the new For loop I sent above ^

languid geode
#

People really need to learn it anyway please i need feedback on what to do with spigot's garbage #890917455805968444

carmine nacelle
#

idc if it CAN throw a null, it WONT because you're gonna put null checks before it, right?

quaint mantle
#

btw you forgot this 😂
locationsData.getCustomConfig().getLocation("locations." + locationName) but anyways let me test it

carmine nacelle
#

f-

quaint mantle
#

lol

quaint mantle
# carmine nacelle f-

teo teo teo teo teo


java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0

at com.risingcore.events.onDeathRespawn.onRespawn(onDeathRespawn.java:68) ~[?:?]
#

the line 68 is just the get array, which if it dont work then uhhhhhhhhhhhhh

carmine nacelle
#

so what you're saying is

#

it's not properly getting through the code that i provided

#

which you werent happy with

#

and its now stuck on yours 😉

quaint mantle
#

nope man

carmine nacelle
#

damn it feels good to be a gangster

quaint mantle
#

im trying to find the code that i used to print the locationName

carmine nacelle
#

lol

quaint mantle
carmine nacelle
#

so its putting your distance from the location, then the location name into the map

#

did you try printing the values of the map?

#

at least now we have VALID things to put in the map.

quaint mantle
#

wait wait wait let me test out the old print the name of the location thing

#

OMG I JUST GODBRIDGE WITH LIKE 8cps (6 block nothing much but i once got 9

carmine nacelle
#

i just had a fucking stroke

quaint mantle
carmine nacelle
#

its not against the rules

quaint mantle
#

nope man its meme

carmine nacelle
#

and i think its warranted dealing u with guys lol

quaint mantle
#

i think if this work then i can say that this issue is solved

        for (String locationName : locationsData.getCustomConfig().getConfigurationSection("locations").getKeys(false)) {
            if (Objects.equals(locationsData.getCustomConfig().getString("locations." + locationName + ".world"), p.getWorld().getName())) {
                sorteddistance.put(p.getLocation().distanceSquared(locationsData.getCustomConfig().getLocation("locations." + locationName)), locationName);
            }
        }
        System.out.println(sorteddistance.values().toArray()[0].toString());```
carmine nacelle
#

you're so stubborn omfg

quaint mantle
#

😂

#

the mind of this man leaved him. poor guy who tried to deal with 4 kids

#

through nights. and coding at the same time

carmine nacelle
#

yes

quaint mantle
#

Todododo

#

how can I cancel OFF_HAND if HAND was used?

carmine nacelle
quaint mantle
#

no

#

boolean

#
package test;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;

public class Ls implements Listener {
    private static EquipmentSlot h;
    private static ItemStack main;
    private static ItemStack off;

    @EventHandler
    public void onPlayerInteract(PlayerInteractEvent e) {
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            Player p = e.getPlayer();
            main = p.getInventory().getItemInMainHand();
            off = p.getInventory().getItemInOffHand();
            h = e.getHand();

            if (h == EquipmentSlot.HAND) {
                if (main.getType() == Material.TNT) {
                    p.sendMessage("HAND");
                    main.setAmount(main.getAmount() - 1);
                    e.setCancelled(true);
                }
            }
            
            if (onOff()) {
                p.sendMessage("OFF_HAND");
                off.setAmount(off.getAmount() - 1);
                e.setCancelled(true);
            }
        }
    }

    public static boolean onOff() {
        if (h == EquipmentSlot.HAND && main.getType() == Material.TNT)
            return false;
        return true;
    }
#

not worked(

carmine nacelle
#

im confused, so you want it to make it only run 1 of the code blocks..?

#

that seems very..hacky

#

What exactly is the goal here

quaint mantle
#

PlayerInteractEvent

carmine nacelle
#

There's a method to check if it was the main or offhand

#

my intellij is updating so I cant check, but look for it

quaint mantle
#

when pressed in two hands, it writes OFF_HAND and HAND

carmine nacelle
#

Im aware.

quaint mantle
carmine nacelle
#

Use e.getHand()

#

and see which hand it is

#

and only run the code for one of them

quaint mantle
#

no

carmine nacelle
#

ok suit yourself

quaint mantle
#

I already use this, but if I take the object in 2 hands and click, it will write OFF_HAND and HAND, and I need it to write only HAND

carmine nacelle
#

Yes, you use code to see if it's ONLY one of those 2, and if its not, then do nothing.

#

that way it only runs once

quaint mantle
#

how?

carmine nacelle
#

by using e.getHand() that I sent above.

quaint mantle
#
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteract(PlayerInteractEvent e) {
    Player p = e.getPlayer();
    Action a = e.getAction();
    EquipmentSlot h = e.getHand();
    ItemStack mainhand = p.getInventory().getItemInMainHand();
    ItemStack offhand = p.getInventory().getItemInOffHand();
    if (a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK) {

        if (h == EquipmentSlot.HAND) {
            if (mainhand.getType() == Material.EXP_BOTTLE) {
                p.sendMessage("HAND");
                this.removeItemInMainHand(p);
                e.setCancelled(true);

            }
        }

        else if (h == EquipmentSlot.OFF_HAND) {
            if (offhand.getType() == Material.EXP_BOTTLE) {
                p.sendMessage("OFF_HAND");
                this.removeItemInOffHand(p);
                e.setCancelled(true);

            } else {
                return;
            }
        }
    }
}
#

?

quaint mantle
#

if you take the same items and click, it will write OFF_HAND and HAND. I need it to write only HAND once

carmine nacelle
#

Yes

#

kinda

quaint mantle
carmine nacelle
#

why do you need to run the code twice?

#

of course it's going to, it has code for both.

#

are they both doing the same thing?

quaint mantle
#

if I check whether the HAND is used? that event will be called 2 times and only for the left hand

carmine nacelle
#

I still dont understand what you are trying to accomplish.

#

Why not just get rid of OFF_HAND

#

and keep HAND

quaint mantle
carmine nacelle
#

yes... im aware..

#

it runs twice.

#

cool.

#
        else if (h == EquipmentSlot.OFF_HAND) {
            if (offhand.getType() == Material.EXP_BOTTLE) {
                p.sendMessage("OFF_HAND");
                this.removeItemInOffHand(p);
                e.setCancelled(true);

            } else {
                return;
            }
        }
#

delete this

quaint mantle
carmine nacelle
#

ok

#

have fun then lol

quaint mantle
carmine nacelle
#

ahh so there's finally what ive been asking for

young knoll
#

Just use event.getItem

#

Then you can check regardless of which hand it’s in

quaint mantle
quaint mantle
young knoll
#

If they hold it in both hands then they throw it with both hands

quaint mantle
#

@young knoll, Equipment enum? how?

eternal oxide
#

a what?

quaint mantle
#

hands

#

PlayerInteractEvent

eternal oxide
#

words

quaint mantle
#

used 2 times

eternal oxide
#

random

#

are you still on this if both hands clicked thing?

quaint mantle
#

I use 2 hands, if I cancel the left hand when the right hand is already used, I use the left hand 2 times

quaint mantle
eternal oxide
#

I did tell you a couple of days ago this is not a simple task

#

if you only want one hand to action when both click you have to delay the first event a fraction so you can wait to see if the other hand is used too

quaint mantle
#

how can this be done? can I have an example, please?

eternal oxide
#

is it always with a specific item?

quaint mantle
#

yes

eternal oxide
#

and always player interact event?

quaint mantle
#

yes

eternal oxide
#

what does the item do when used?

quaint mantle
#

spawnEntity PRIMED_TNT

#

@eternal oxide, are you here?

eternal oxide
#

Yes, thinking

slim kernel
#

Can anybody else help me there I dont know if he is going to help me...

solar sable
#

guys do i need to use hex color codes to add color to my plugin? for example plugin name?

carmine nacelle
#
if(packet.getEntityUseActions().readSafely(0) != EnumWrappers.EntityUseAction.ATTACK) {

I'm using this with ProtocolLib to try making sure that my code will only run when right clicking the entity, but it still runs even when left clicking. Any idea..?

sharp kelp
#

How to prevent closing of a custom gui inventory?
Also just for people who say use InventoryCloseEvent then I found that it does not have a e.setcancelled option while Protocol lib also does nothing
And I cant make it auto reopen my inventory because of some variables which make some items move in the gui

#

ahh nvm I think I found the way

proud basin
#

you can’t prevent a player from closing an inventory

quaint mantle
#

throw, blockplaceevent

eternal oxide
#

that won;t fix your both hands issue

quaint mantle
#

there is already a blockPlaceEvent here

#

throw

#

but most likely I will not be able to put dynamite in private, and I need it

eternal oxide
#

I have no idea what you are on about

#

You were asking about when clicking with both hands you only want right click to operate

#

That has nothing to do with block place nor projectile launch

#

ok, this works.

#

?paste

undone axleBOT
eternal oxide
#

you can place with either hand, but if you click both hands at the same time it will only take from the main hand.

carmine nacelle
vernal pier
#

is it safe to send packets async or do i need to put it in a runTask(

dire marsh
#

they are safe async

shadow night
#

hmm, why it doesn't prints anything?

eternal oxide
#

if it prints nothing you haven't registered the listener

shadow night
#

im sure i have

eternal oxide
#

sysout can not fail to print

shadow night
#

hmmm oh wait

#

how didn't i do it

worthy knoll
#

Hello! How could I set a world border for only one player ?

#

(google, i know) - but I didn't find anything useful for my case

#

my objective is that whenever someone joins the server, a worldborder is created for him, at a certain distance

chrome beacon
#

You would need to work with packets

worthy knoll
#

Already checked

#

but it crashed and I don't work with packets really often

#
WorldBorder wb = new WorldBorder();

        WorldBorder border = new WorldBorder();
        border.setCenter(player.getLocation().getX(), player.getLocation().getZ());
        border.setSize(getConfig().getInt("radius"));

        PacketPlayOutWorldBorder packet = new PacketPlayOutWorldBorder(border, PacketPlayOutWorldBorder.EnumWorldBorderAction.INITIALIZE);

        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
chrome beacon
#

Then you could just create a world per player

#

Hm wait can you unload them

worthy knoll
#

well, no, because they all must be in the same world...

chrome beacon
#

Aight packets then

worthy knoll
#

got npe on the send packet line

#

any ideas ?

rapid meteor
#

Guys how do I make a limited death rule?

worthy knoll
#

you mean you can die three times before being eliminated ?

#

and so, do you know how I could fix this ?

chrome beacon
#

Find what's null

worthy knoll
#

with the uuid and the value ,

worthy knoll
rapid meteor
#

Yeah but how do you code like code it?

#

is there a tutorial?

#

Can I do it with command blocks?

chrome beacon
#

player

worthy knoll
#

I think

#

idk for cb

rapid meteor
#

I did sir.

#

I haven't found anything.

rapid meteor
trail flume
#

Hi. It seems PotionMeta#setBasePotionData(PotionData) does not exist in 1.8, can anyone help me with this? I need to set the level and duration of the potion.

worthy knoll
#

oh

#

hmmm...

#

you can use a HasMap then ... do you do plugins ?

rapid meteor
#

Me sir?

worthy knoll
#

yea

#

[OUTDATED] See the new version here!
https://www.youtube.com/watch?v=3jZyXbGX_Hc

Using command blocks, I've made a new gamemode you can play in survival, similar to hardcore mode. In survivalist mode, you have a set amount of lives, and can increase them by eating Notch apples. Don't lose your last life though!

One Command Installation [1.11.2...

▶ Play video
#

This you think ?

#

might be helpful

rapid meteor
#

Not quite.

#

But I appreciate you trying to help.

worthy knoll
#

🙂

#

then, could you explain your concept a little more accurately ?

rapid meteor
#

Ok sure.

#

Ehm so I have a server and I want to have a death limit like when people die 3 times it will set the person to spectator.

worthy knoll
#

I see

clever bobcat
#

does someone know a plugin to drain water in 1.17.1 with out worldedit

worthy knoll
#

well, if you're up to coding, you could use a hashmap.

When a player joins, he is put into it, as well as the max number of lives (3).

When he dies, you access the values and modify the number of lives

worthy knoll
clever bobcat
#

and it just works on bukit

#

bukkit

eternal oxide
#

WorldEdit works on Spigot

clever bobcat
#

noo

#

how

worthy knoll
worthy knoll
#

it does

#

spigot = bukkit in some way

#

but also

#

spigot != bukkit

#

anyway

clever bobcat
worthy knoll
#

//wand

clever bobcat
#

i know

#

but i dident get anything

worthy knoll
#

well, creative mode?

rapid meteor
#

How do I make a death instance?

worthy knoll
#

permissions ?

eternal oxide
#

Bukkit is an API. It is contained in Spigot

worthy knoll
#

an event handler

#

join & death events

clever bobcat
quaint mantle
clever bobcat
worthy knoll
#

can I have your plugin list ?

quaint mantle
#

Check my events, it's kinda the same as you want but I use database

clever bobcat
clever bobcat
worthy knoll
#

or send me the list

#

are you sure you took the good mc version ?

clever bobcat
# worthy knoll ... do it then

bro are you jokeing, i dident test to go to the bukit side and download the world edit for 1.17.1 and add it to my server it works perfect now, thanks for the help, love you

worthy knoll
#

erm... sure... no problem

#

have a great day :))

rapid meteor
#

Guys how do I create a death instance?

hasty prawn
#

A what

worthy knoll
#

@rapid meteor did you get it working ?

#

what do you mean a death instance

clever bobcat
#

btw

#

I know that you can do a circle with world edit with the command cyl, but can you do walls with is so there is walls up do down in a ciicle

worthy knoll
#

hum...

clever bobcat
#

i want walls down

worthy knoll
#

well do //undo, then do it again by moving a few blocks down until you get it where you want

clever bobcat
#

no not like that i want the circle to have walls all the why down to the bottom of the sea

worthy knoll
#

oh

clever bobcat
#

so like outer walls

worthy knoll
#

//cyl <some arguments>

#

do //cyl alone and you'll see

clever bobcat
#

look

solar sable
#

does anyone know how to put colors in your plugin name/prefix?

worthy knoll
#

nope

clever bobcat
#

and now i want outer walls all the why down

worthy knoll
#

impossible

worthy knoll
clever bobcat
#

ohhhh

#

ty

#

no

#

not like that

#

i dont want it to be fiild

worthy knoll
#

?

#

oh

#

hum

#

//hcyl

clever bobcat
#

ohh

#

thats good

worthy knoll
#

no problem 🙂

trail flume
#

In 1.8 how do I set the duration of a potion?

worthy knoll
#

I don't know, look for the docs online

trail flume
#

I literally did

vernal pier
#

If in config yml someone puts a bad value example
chest rows: -1
How should I deal with that

rapid meteor
#

Guys anyone who knows how I can make a death instance?

#

?

old cloud
#

Set HP to 0 maybe

waxen plinth
#

"make a death instance"

worthy knoll
#

just tell us what for @rapid meteor

#

do you mean "'detecting death" ?

waxen plinth
#

I sure do love when people ask nonsense questions and then try to bump as if the reason nobody answered is because they didn't see it

hasty prawn
#

My best guess is that they want to spawn an entity that is perpetually in it's death animation

waxen plinth
rapid meteor
#

Thing?

waxen plinth
#

what

hasty prawn
waxen plinth
#

What the fuck are you talking about lmao

worthy knoll
#

???

#

Just in what purpose

waxen plinth
#

new Death();

worthy knoll
#

???

#

what for ???

hasty prawn
#

If you have a class called "Death", then you make an instance exactly like that.

rapid meteor
#

Alright in other words, how do I make a variable that does something whenever someone dies?

hasty prawn
#

That makes so much more sense KEKW

waxen plinth
#

An event listener

rapid meteor
#

Yes.

waxen plinth
#

You listen for PlayerDeathEvent

worthy knoll
#

that's what I told you sooner...

#

@fresh templetHandler
public void onPlayerDeath(PlayerDeathEvent e) {}

waxen plinth
#

If you don't know how to register a listener, go read docs :)

rapid meteor
#

import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;

public class JavaEvents implements Listener {
    
    @EventHandler
    public static void onPlayerDeath(PlayerDeathEvent event)
}```
worthy knoll
#

OH JESUS CHRIST

#

I... just have pinged someone

rapid meteor
#

Like how do I make the onPlayerDeath?

worthy knoll
#

well... sorry...

waxen plinth
worthy knoll
hasty prawn
#

?jd

worthy knoll
#

about Listeners

waxen plinth
#

There are literally hundreds of examples

worthy knoll
#

or yea docs

waxen plinth
#

If not thousands

rapid meteor
waxen plinth
#

I guarantee there is

worthy knoll
#

well, you don't need to copy exactly what you want

#

you can adapt

#

like a tutorial about join event, use the same technique for playerdeathevent

stiff topaz
#

How do I get the player from EntityPickupItemEvent

young knoll
#

Check and cast

old cloud
#

Do I have to cancel the task of BukkitScheduler#runTaskAsynchronously or does it "cancel" itself when "run()" was executed?

young knoll
#

It runs once and cancels

old cloud
#

Yea, so I dont have to do it manually?

young knoll
#

no

old cloud
#

I mean ye, it makes sense but I wanted to make sure

#

ok

rapid meteor
#

guys I need to assign a value to player.

#
Player player = event.???;
stiff topaz
#

event.getPlayer() typically

rapid meteor
#

Yeah but this is PlayerDeathEvent.

#

So I can't do that.

#

And I need something like the getPlayer function.

young knoll
#

event.getEntity

rapid meteor
stiff topaz
#

event.getEntity().getPlayer();

young knoll
#

What

#

No

tardy delta
#

wait a queue is LIFO right?

sharp kelp
#

in player dead event shouldnt there be 2 types of entities

#

one is the dead player and other is the killer entity or player

young knoll
#

No

#

You would want to use the damage vent for that

sharp kelp
#

well kay nvm

young knoll
tardy delta
#

ah forgot it

hasty prawn
#

Or LivingEntity#getKiller()

young knoll
#

Only works if it's a player

tardy delta
#

ow yea its the stack which is LIFO

hasty prawn
#

Well PlayerDeathEvent#getEntity() returns a Player so

old cloud
#

And can I run a sync TaskTimer containing API stuff, called by an async Task?

young knoll
#

Yes

old cloud
#

Cool, thanks

paper geyser
#

im begging you

#

embed

#

there

#

EMBED

#

im gonna cry

hasty prawn
#

You need to be linked for embeds I think

paper geyser
#

dang

old cloud
#

lol, It doesnt cost anything to ask, does it?

clever bobcat
#

does someone know a auto build plugin so it auto builds like a farm

hasty prawn
#

It doesn't, but you're constantly going to be asking for things you could test in a shorter amount of time

paper geyser
#

^

#

it's more convinient for yourself

hasty prawn
#

For everyone, really

old cloud
hasty prawn
paper geyser
paper geyser
old cloud
#

yea, thanks for the hint

paper geyser
#

npnp

quaint mantle
#

Hi someone can help me I was developing and so I use github and git to commit which I would like to remove so I don't know how to use it well with a command to try to synchronize my changes with those in the repository now he has sent me the files back to a quite a lot and it took me 2 months of work someone knows how to do it

quaint mantle
#

Getting the files that made me go back to basically everything I had before doing these commands

#

and as soon as I have everything I want to remove the use of git and totally remove github etc. I prefer not to use it and publish my plugin on spigot and get feedback from them

halcyon mica
#

So I am currently facing a issue where I am making a mob target the player through a custom goal

#

But when the player crouches past the edge of a block, it targets the air block they "stand" on instead

#

And thus the mob targets the air, and never actually attempts to target the player because midair is unreachable

tardy delta
#

if i use player.setDisplayname(some string) it doesnt changes the name for some reason

halcyon mica
#

Is there a way to detect when a player is crouching off of a block to float, and get that origin block instead?

eternal oxide
#

kind of

#

you can detect sneaking and air under teh player

#

you need to take the AIR block location under the player and work out which BlockFace is closest to the player. You can then getRelative to get the block the player is hanging off

trail flume
#

How can I detect a block being destroyed by an explosion and cancel it?

young knoll
#

EntityExplodeEvent or BlockExplodeEvent

trail flume
#

thanks

vernal pier
eternal oxide
#

You would then get the relative block twice

halcyon mica
#

You can probably just detect if the player is on top of a air block, and then determine which of the 8 adjencent blocks their hitbox is closest to

#

As the hitbox has to remain on the solid block

vernal pier
#

nvm mb just realised theres block face for north_east and stuff

quaint mantle
#

I was able to revive the files via git reset --hard but first I had to find the last commit via git reflog before committing the trouble I had done just now I don't know how to remove the repository I have and detach it from my project too

sour sand
#

does anyone know what the enderchest gui class is called i cant find it anywhere

opal juniper
#

its just a normal chest inv ?

sour sand
#

yea but i want to open the players ender chest

vague oracle
#

Player.openenderchest

sour sand
#

cool thanks for the help

opal juniper
#

Bukkit.createInventory

#

lol

#

eh i dont really know any

tardy delta
#

is there a way to make a constructor with no args that lets everything uninitialized?

onyx shale
ivory sleet
#

triumph gui, inventory framework, interfaces, canvas and my own

onyx shale
#

you are forced to assign them null

ivory sleet
#

I try avoiding frameworks yes I’m that nincompoopy

tardy delta
# ivory sleet Why tho

i'm using on of the class' methods but i dont want to initialize those fields if i never use them

old cloud
#

I'm iterating over a large number of blocks and trying to get their BlockState with getState. Since this takes a while, I want to do this async. Obviously it does API accesses for some blocks:

java.lang.IllegalStateException: Tile is null, asynchronous access?
```What can I do, or can I somehow find out which blocks are having this issue so I can run it sync?
ivory sleet
#

Just pass null then fourteen brush?

worthy knoll
ivory sleet
#

As you did

tardy delta
#

ah yea but then it does this things

item = new ItemStack(material == null ? Material.BARRIER : material);
        itemMeta = item.getItemMeta();
        lore = new ArrayList<>();
ivory sleet
old cloud
#

My entire iteration runs async

ivory sleet
ivory sleet
#

Bukkit isn’t thread safe, not in the terms of BlockState access it seems like

worthy knoll
#

anyone available (lol) to help me ?

ivory sleet
#

What does not work, be more specific

worthy knoll
#

well, ...

#

My objective is to create the visual effect of a world border

old cloud
ivory sleet
#

Ofc you can’t

#

Well

worthy knoll
#

and updating it

ivory sleet
#

Not in a single task

worthy knoll
#

wezll

ivory sleet
#

What you instead want to do is to distribute the iteration over several ticks

worthy knoll
#

right now, I just want to create a world border with a radius of 20 when a player enters the server

#

and it doesn't work

#

but if I send a message to the player just after it

#

it sends it

ivory sleet
#

You can do this by equally dividing the amount of blocks into x amount of groups and then iterate one group per tick.

worthy knoll
#

so

worthy knoll
ivory sleet
#

That wasn’t to you

worthy knoll
#

which I've spent 2 hours on

#

erm

#

well

#

indeed

#

'scuse me

ivory sleet
#

Let me read what you just wrote 😄

worthy knoll
#

if it is me then sure

#

if not hmmmm

tardy delta
ivory sleet
#

What no

tardy delta
#

😳

ivory sleet
#

If it’s a builder

#

Don’t use final there

#

The entire point of builders is that they should be mutable

trail flume
#

How do I set the fuse of TNT? This code doesn't work.

Entity tnt = e.getBlock().getWorld().spawnEntity(e.getBlock().getLocation(), EntityType.PRIMED_TNT);
                TNTPrimed tntPrimed = ((TNTPrimed) tnt);
                tntPrimed.setFuseTicks(52);
                tnt.setVelocity(new Vector(0, 0, 0));
old cloud
ivory sleet
#

Such that you can chain mutations to then finally create the actual object

tardy delta
#

yea but the lore or something should not change when the object has been created

#

it has a setLore method

#

etc

ivory sleet
#

Yes?

#

Just copy the list passed?

tardy delta
ivory sleet
#

No no no

onyx shale
#

always return the builder

ivory sleet
#

^

onyx shale
#

there should always be a return this

ivory sleet
#

This is a design pattern fourteen brush

tardy delta
#

oh

#

ah i understand

ivory sleet
#

Also

tardy delta
#

liek a stringbuilder

#

.append().append()...

ivory sleet
#

Use
this.lore = lore; rather than
this.lore.addAll(lore)

#

Or well if you don’t want to have a dirty list implementation passed, use something like
this.lore = ImmutableList.copyOf(lore)

heavy void
#

Someone knows the best way to communicate my plugin with my website?

Im doing a minecraft store software.

carmine nacelle
carmine nacelle
#

I could just like..make a random sign in the world then use the location of it but thats jank

quaint mantle
carmine nacelle
ivory sleet
quaint mantle
#

thats inconvenient as fuck for users and hard to maintain for developer

carmine nacelle
#

What's the "coolest" way then

quaint mantle
#

good ol chat

carmine nacelle
#

yawn

onyx shale
#

well also a sign limits you to like what? 18 charachters?

carmine nacelle
#

you could append the other lines but

old cloud
carmine nacelle
#

ive seen people use anvils too

onyx shale
quaint mantle
#

anvils are inconvenient too

heavy void
carmine nacelle
#

sadge

quaint mantle
#

yeah. i mean, i thought that anvil input will be super cool too

ivory sleet
onyx shale
#

theyr cool till you need to manage them

#

they become a pain in the ass

carmine nacelle
#

"manage" how?

ivory sleet
quaint mantle
#

i asked some players on my server and they said that they got annoyed by anvils all the time

#

especially on nick input

carmine nacelle
#

fine fine..

old cloud
trail flume
#

How do I set the fuse of TNT? This code doesn't work.

Entity tnt = e.getBlock().getWorld().spawnEntity(e.getBlock().getLocation(), EntityType.PRIMED_TNT);
TNTPrimed tntPrimed = ((TNTPrimed) tnt);
tntPrimed.setFuseTicks(52);
tnt.setVelocity(new Vector(0, 0, 0));
lost matrix
trail flume
#

The fuse is still the default, 80 ticks.

eternal oxide
#

also, why set the velocity vector to zero?

trail flume
#

So it doesn't move when spawned.

#

I don't want it to.

onyx shale
#

wouldnt seeting the ai to false achieve the same even with gravity?

lost matrix
trail flume
#

Okay.

carmine nacelle
#

So, I need a way of keeping track of if someone's editing a hologram in my system. I could make an ArrayList of uuids of people currently editing, I could make a hashmap, with UUID as the key and boolean as the value, I could make a UUID and store it in my Hologram object..what's best?

#

for efficiency/cleanliness

onyx shale
#

make a event system then use it to log?

carmine nacelle
#

I am.

#

Thats what im trying to figure out is how I should keep track of it.

#

maybe hashmap with UUID key, hologram value.

lost matrix
#

Map<Something, Boolean> makes no sense.
List scales bad if you want to call contains often.

carmine nacelle
#

So then that leaves me with hashmap<UUID, Hologram>, or just setting a boolean of if it's being edited in the object (only owner can edit, already keeping track of the owner's uuid)

#

HashMap is prob the best.

trail flume
lost matrix
lost matrix
#

What version are you on=

trail flume
#

The spawn method DOES exist

trail flume
lost matrix
#

Well... Use ancient software -> live with the bugs and outdated API

#

🤷

lost matrix
trail flume
#

I am making a multi-version server

carmine nacelle
lost matrix
carmine nacelle
#

Well, psuedo scenerio.

Right click the hologram, opens a gui with options to add lines, set name, etc
Then upon updating a setting inside the gui, I'd have to get the hologram that was being edited. So I could either put their currently editing Holo into a map with them and get it that way, or I'd have to loop through all holograms, then find the one that has their UUID AND the editing boolean to true

trail flume
carmine nacelle
#

I know multiple ways to do it I'm just trying to figure out the BEST yk

eternal oxide
#

Pretty much no one supports 1.8.

#

Here, anyway

ancient plank
#

solution: delete minecraft

onyx shale
#

same for paper,they dont allow 1.8 discussion anymore

carmine nacelle
#

1.8 is dead meme

hasty prawn
#

Using 1.8 is like using Microsoft Word 2013 and expecting Microsoft to fix all your issues with it

carmine nacelle
#

The only somewhat good reason to use 1.8 anymore is Factions

#

cause tnt behavior, combat..whatever

ancient plank
carmine nacelle
#

LOL

trail flume
#

The reason I use it is for combat

#

It's a combat server I'm making

ancient plank
#

solution: 1.16.5, and get an old combat mechanics plugin

carmine nacelle
#

OldCombatMechanics plugin

#

sniped

hasty prawn
#

why 1.16.5 KEKW

ancient plank
#

why not

hasty prawn
#

because 1.17.1 exists hypixel_sad

ancient plank
#

I still don't fully trust 1.17 tbh idk why

carmine nacelle
#

works perfect for me

eternal night
#

Just wait for 1.18 performance :>

onyx shale
#

with each server you need more and more resources tru..

carmine nacelle
#

especially with PurPur configs

ancient plank
#

checks discord server name

onyx shale
#

cant wait to have 4gb ram minimum to even start 1.18

ancient plank
#

people are 100% willing to help with 1.16.5, but maybe not 1.17 because of changes etc

hasty prawn
carmine nacelle
#

that answer it?

eternal night
#

Well, they are two snapshot in and have released a snapshot purly trying to improve performance

hasty prawn
#

really? PeepoHappy

#

I haven't paid attention to the snapshots

idle cove
#

How would a timer for 15 seconds then after that times is up do something?

eternal night
#

?scheduling

undone axleBOT
ancient plank
#

TIL scheduling command

carmine nacelle
#

Since we're on the topic..what would be the best way to keep track of something like..

if a player is offline for x amount of days, do y

idle cove
#

I made a copy of a players inventory (playerInvCopy) and then cleared their inventory

#

how would i put their inventory back in

#

without putting in every single item

carmine nacelle
#

get the copied inventory's contents and set their inventory contents to the same

#

( i think)

idle cove
#

no help

#

i mean like

#

what is the method

#

player.setInventory

#

isnt a thing

eternal oxide
carmine nacelle
#

no, but player.getInventory()#setArmorContents, setContents, setExtraContents, and setStorageContents are.

idle cove
#

oh

#

i see

#

thank you

carmine nacelle
#

Not sure what extra and storage are, but armor is armor and setContents is their normal inventory

idle cove
#

I have this code: https://pastebin.com/kr4NJhzT: though at the end of it the error i am getting is when i type 'this' and i think its because im not in my plugins main class and the parameter type is supposed to be Plugin, how can i fix this? I tried calling my main class but that didnt work either.

undone axleBOT
idle cove
#

i fixed that issue

#

but

#

other than the bracket i missed is it possible?

lost matrix
idle cove
#

because i have lots of items to edit

#

i dont want to do ItemMeta meta = item.getItemMeta

#

for every single one of them

#

I get an error in console saying that the meta is null

lost matrix
#

Write a builder class.

  public static final ItemStack HELMET = new ItemBuilder(Material.NETHERITE_HELMET)
      .name("§eCool Helmet")
      .lore("")
      .lore("§7This is a cool helmet")
      .enchant(Enchantment.PROTECTION_ENVIRONMENTAL, 5)
      .enchant(Enchantment.DURABILITY, 3)
      .build();
idle cove
#

so would @NotNull. fix it?

lost matrix
idle cove
#

Ok

#

Ill use what u did

#

thank you

idle cove
lost matrix
lost matrix
# idle cove ItemBuilder doesnt appear for me

Another way would be using an enum like this:

@AllArgsConstructor
public enum CustomItem {

  HELMET(Material.NETHERITE_HELMET, "§eCool Helmet", Arrays.asList("", "§7This is a cool helmet.")),
  CHEST_PLATE(Material.NETHERITE_CHESTPLATE, "§eCool Chestplate", Arrays.asList("", "§7This is a cool chest plate."));

  private final Material material;
  private final String name;
  private final List<String> lore;

  public ItemStack create() {
    final ItemStack itemStack = new ItemStack(this.material);
    final ItemMeta meta = itemStack.getItemMeta();

    meta.setDisplayName(this.name);
    meta.setLore(this.lore);

    itemStack.setItemMeta(meta);
    return itemStack;
  }

}

Then use it like this:

  ItemStack helmet = CustomItem.HELMET.create();
eternal oxide
pastel drift
#

Or use Kotlin 🙊

lost matrix
pastel drift
# lost matrix Elaborate
val custom_item = ItemStack(Material.NETHERITE_HELMET).also {
    val itemMeta = it.itemMeta!!
    itemMeta.setDisplayName("§cCool Helmet")
    itemMeta.lore = arrayListOf(
        "",
        "§cThis is a cool helmet"
    )
    it.itemMeta = itemMeta
}
slim kernel
#

could you do that if you have time pls?

lost matrix
slim kernel
lost matrix
#

But im still struggling with complex paths like this.

slim kernel
slim kernel
paper viper
lost matrix
lost matrix
paper viper
#

Ah interesting

shadow tide
#

if I were to do java entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).addModifier()); what would go inside addModifier()? I cant figure it out

spice hornet
#

Hi

slim kernel
lost matrix
spice hornet
#

My shadow plugin does not bundle Aikars ACF dependency with my fat jar. This is my build.gradle

plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '7.0.0'
}

group = 'de.cstmth'
version = '1.0-SNAPSHOT'

repositories {
    mavenCentral()
    maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
    maven { url = 'https://oss.sonatype.org/content/groups/public/' }
    maven { url = 'https://repo.aikar.co/content/groups/aikar/' }
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
    compileOnly 'co.aikar:acf-paper:0.5.0-SNAPSHOT'
}

shadowJar {
    relocate 'co.aikar.commands', 'de.cstmth.moderationvisor.acf'
    relocate 'co.aikar.locales', 'de.cstmth.moderationvisor.locales'
}
#

Can someone tell me why this happens? The build.gradle seems to be fine

shadow tide
spice hornet
#

Huh

#

What do I have to change it to?

ivory sleet
#

Use implementation also not compileOnly

clever bobcat
#

with worldedit can i do like //replacenear 25 grass_block 25%moss_block

ivory sleet
#

implementation will add the dependency as a compile time and runtime dependency as opposed to compileOnly which only adds the dependency as a compile time dependency

golden turret
eternal oxide
#

Video is zero length

golden turret
#

maybe you just did not downloaded it

eternal oxide
#

yeah, not downloading a video

slim kernel
#

when I do someArray.length does it start at 0 or 1?

golden turret
#

0

eternal oxide
#

0

#

always 0

clever bobcat
#

is this right

#

//replacenear 20 grass_bloc,0.5%moss_block

eternal oxide
clever bobcat
#

help me

eternal oxide
#

you are in the wrong channel for getting help using a plugin

slim kernel
#

okay thank you

clever bobcat
#

can you help me

#

plz

lost matrix
clever bobcat
#

you know the ansawer

#

help me

lost matrix
ivory sleet
#

Use the appropriate channel, end of discussion

lost matrix
#

You are the kind of person that goes into a computer shop and asks for help with your spanish homework because its about calculators.

shadow tide
#

[16:01:40] [Server thread/ERROR]: Ambiguous plugin name `plugin' for files `plugins\plugin.jar' and `plugins\lifesteal.jar' in `plugins' I got an error with my plugin, I have two that I made. This plugin was quick and sloppy so I expect it to be a stupid error

regal dew
#

plugin.jar and lifesteal.jar have the same plugin name in their plugin.yml

shadow tide
#

oooh

#

lol

regal dew
#

you cant have duplicate plugin names

lost matrix
shadow tide
#

I copied that from my other plugin and changed it lol, guess I missed that part

spice hornet
#

Is there a way to replace my current plugin.jar with the new plugin.jar while in development cycle? Stopping and restarting the server all the time takes a lot of time and I think there is a way to do it with reload. I know it is not recommended and would not do it on production.

#

When I try to overwrite the file using IntelliJ drag-n-drop though it gives me an IOError

regal dew
#

yes, because a class it might need on shutdown is not on the disk (it has been overwritten)

#

If you absolutely have to, unload, then replace, then load

#

or make sure no new classes are loaded on shutdown

spice hornet
#

I remember just letting shadowJar override it but that seems to not work anymore

spice hornet
#

I know this is possible, I just don't remember how

regal dew
#

Well, the exception is likely a zip file closed exception right

spice hornet
#

No, java.io.IOException: Cannot delete "filepath"

regal dew
#

oh thats different then

spice hornet
#

I'm just using IntelliJ Drag and Drop

#

I'm assuming it's the regular "file in use" block.

#

Which makes sense technically

regal dew
#

mhm no, probably this is an error you can just fix though

#

Does it also happen on a normal shutdown?

spice hornet
#

No. As long as the server is offline (I used stop), I can drag it into the plugins folder as regular.

#

When the server is actively running the plugin though it does not allow me to do so

regal dew
#

This ioexception, is it thrown in intellij with the shadowJar gradle task? Or does it happen on the server

#

not sure how you copy after your build to the server

spice hornet
#

I think we have a misunderstanding.

regal dew
#

Yeah ig, not really getting the full picture

slim kernel
lost matrix
slim kernel
spice hornet
#

I am regularly running the shadowJar task, no issues here. Then I want to move that fat jar to my test servers plugins folder to test the changes I have done etc.

Some while ago I had some way to make Gradle/shadowJar replace it directly but I don't know how to do that now. So my plan was to just drag and drop the newly created fat jar from /build/libs/ to /server/plugins/ but that is not allowed. Then, the error occurs.

#

Note that the server is running while I try to move the jar file. When the server is stopped, I can move it without issues.

young knoll
#

I'm able to replace the old jar during runtime

#

But I cannot delete it

regal dew
#

right, so you drag and drop directly, and the error is displayed in the server’s console?

ivory sleet
#

cstmth are you’re trying to hotswap? btw tldr

spice hornet
spice hornet
#

Is that the recommended way of doing it though?

ivory sleet
#

So do you run your server instance by a gradle task? If so do you run it using debug mode?

spice hornet
#

So how I would run a regular server as well. Is there a debug mode especially for development?

plain oxide
#
if (args[0].equals("decision")) {
  if(args[1] != null){
    String target = args[1];
    DorokeiCommandResult.randomDecision(target);
  }else{
    DorokeiCommandResult.decision();
  }
}```

When I execute the added command, I get the error "an internal error occurred while attempting to perform this command".

① /dorokei decision <MCID>
There is no problem when I hit

② /dorokei decision
If it is only, an error will occur

I want to execute different processes for ① and ②
young knoll
#

Check args.length, not args[1] != null

spice hornet
plain oxide
halcyon mica
#

Is there a way to get the block the player is currently colliding with

#

Not via position, but via collision

wary harness
#

any one can help

#

with this

#

how would I block that package

#

so it wont reach viaversion

young knoll
#

That is a lot of extra

wary harness
young knoll
#

mhm