#help-development

1 messages · Page 2234 of 1

hybrid spoke
#

maybe that would've helped that guy

agile anvil
#

And finally, try to name your variable a,b,c... It's way faster (proof: obfuscation do it)

radiant aspen
hybrid spoke
#

i dont think so but you can PR it

radiant aspen
#

Unicode better

agile anvil
#

Then copy paste

radiant aspen
agile anvil
#

You're right

#

Jokes apart, do you guys know if it's possible to use a Java 17 dependency on a Java 8 plugin?

chrome beacon
#

If you run Java 17 on the server it should be possible

agile anvil
#

Yeah, but I mean since the plugin should also be compatible with llower Java version, it should still run when not having this plugin on it

#

But on gradle I can't import it...

hybrid spoke
agile anvil
#

"Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 8"

hybrid spoke
#

but if the plugin is compiled in java 8 you obv. cant use java 17 features

agile anvil
reef lagoon
#

How do I get the size of all offline players

#

nvm

#

got it

eternal oxide
#

Bukkit.getOfflinePlayers().size()

reef lagoon
#

The .size() is red

eternal oxide
#

.length not .size()

reef lagoon
#

alr

fading lake
#

hey maybe my tnt cannon can help too

tender shard
#

or use tabs. a tab can replace 4 spaces, or even 8. then you can make it faster but it still looks like you have spaces

#

life hack

tender shard
covert karma
#

is there a way to somehow use pehkui with spigot? so basically have players use the mod client side and use spigot to send packets to tell people entity sizes?

agile anvil
#

I guess that if you know exactly which packets you need to send, you can do it for sure. You just have to write your own packets

ornate heart
#

Couldn’t you prevent the distribution of premium plugins by linking it to some sort of site registration? Is this a problem worth solving?

eternal oxide
#

Any premium plugin you write must be able to run without the internet

ornate heart
#

Is that a requirement by spigot?

tender shard
#

yes

ornate heart
#

Ah gotcha

tender shard
eternal oxide
#

all downloaded premium plugins have a custom ID injected. You can host a ban list when the plugin can check to see if its banned and disable. but you can't stop the plugin workgin if it has no internet

ornate heart
#

So just to be clear I wouldn’t be able to disable the plugin if I detect that there’s no internet access?

eternal oxide
#

no, the plugin must be able to be used the instant its downloaded

eternal oxide
#

without internet

unreal maple
#

Hey, I'm having issues with dispatching a large amount of commands for a Vote Party.
I'm currently executing a sync runnable with a period of 4 to handle the rewards, but the payload is still causing large TPS drops

Anyone have any suggestions for dispatching a large payload of commands to all online players? (~600 total commands because of 150 online)

tender shard
#

premium plugins must work without internet, without access to a specific server, and without any additional activation / license keys etc

tall dragon
#

?loaddis

#

?loaddistro

quaint mantle
tall dragon
#

what was it

quaint mantle
#

ops

tall dragon
hybrid spoke
quaint mantle
#

no I want to be a player or a npc!

hybrid spoke
#

so send a fake player

quaint mantle
#

how?

hybrid spoke
#

?bing

undone axleBOT
covert karma
#

?google

undone axleBOT
covert karma
#

interesting

hybrid spoke
#

no

hybrid spoke
#

?bing

undone axleBOT
covert karma
#

?duckduckgo

#

aww

hexed hatch
#

Just zombies with armor

rough drift
sterile token
#

Hi

#

Good afternoon

#

Who have tagged me?

#

Could you solvw your issue?

humble tulip
#

mfnalex

#

how do i build a multimodule project into 1?

sterile token
sterile token
humble tulip
#

how exactly?

#

?paste

undone axleBOT
humble tulip
#

my current base pom

sterile token
#

But why you want to build it?

ornate heart
#

do minecraft servers generally have static ips or do some have dynamic ips?

humble tulip
#

to have all in 1?

humble tulip
sterile token
#

Oh ok

humble tulip
#

kinda got it working by having Core shade the other modules

sterile token
#

Yeah

#

You can do that

#

That what I do

#

Minion what is the plugin about?

hybrid spoke
#

just build the parent pom

humble tulip
#

i get one from each module

sterile token
#

Its type pom

hybrid spoke
#

oh well nvm

hybrid spoke
humble tulip
# hybrid spoke thats the way to go

now i cant get access to the core module in any other since i cant depend on core since core depends on the other modules to build and combine the jar

#

[ERROR] [ERROR] The projects in the reactor contain a cyclic reference

#

even though i put the scope as provided

crude estuary
humble tulip
#

i can create a module to just build it

crude estuary
#

when the DHCP Decides to Give you the same IP

agile anvil
#
  • DHCP is local
crude estuary
crude estuary
agile anvil
#

Well i was lazy to read the previous conv so it's in case you wanted to open a server externally x)

crude estuary
#

Your ISP has a DHCP

#

so it can be Dynamic

#

and Most of the Times it is

agile anvil
#

Yeah for sure

quaint mantle
#

and stuff

lethal roost
#

Thrown when an entity creates an item drop.
kinda worded weirdly, does that mean that this event happens whenever a player or entity drops an item?
and which event would i use if i want to execute some code whenever a player presses the Q key and drops an item? PlayerDropItemEvent or EntityDropItemEvent?

quaint mantle
#

only the lost adventurer part

eternal oxide
#

it could be dragged from their inventory, pressed Q or a Piglin dropped it

lethal roost
#

ok thx

hexed hatch
#

Just set attributes

tender shard
#

i wonder why PersistentDataContainer#getOrDefault's default parameter is annotated with @Nonnull

#

doesn't really make sense

quaint mantle
#

god but I did it for 1.8 and not 1.16

hexed hatch
#

oh cringe lol

quaint mantle
#

1.8 smooth 👍

hexed hatch
#

smooth brain more like

quaint mantle
#

hm

#

so wat i do?

hexed hatch
#

Upgrade to latest lol

quaint mantle
#

no D:

#

no way im using 1.18

#

for a sb plugin

hexed hatch
#

Latest is actually 1.19

quaint mantle
#

:no:

#

:angei:

hexed hatch
#

Keep typing Alex

tender shard
quaint mantle
#

bro

#

for some reason

#

when a new version is out

#

the previous version is a bommer

hexed hatch
#

There are people in the Minecraft community that are younger than 1.8 lol

quaint mantle
#

*boomer

hexed hatch
#

My brother in Christ 1.8 is like 8 years old

quaint mantle
#

I use 1.6 o.o

tender shard
#

it's a pretty easy logic

quaint mantle
#

hi elgarl

tender shard
eternal oxide
#

The API keeps improving. So of course we always suggest you update. New features

#

like Attributes, that you want to use.

quaint mantle
#

bald 🥚

#

but

#

I forgot

#

nvm

#

thanks tho

hexed hatch
#

The fact that I’m at risk with interacting with a 14 year old in this server is an affront to my sanity

quaint mantle
#

im -10 tho

eternal oxide
quaint mantle
#

wait was they talking about me?

#

or?

#

bro I acutally wrote 2 + 2 = 1

hexed hatch
quaint mantle
#

my brain

quaint mantle
#

?

hexed hatch
#

3 blocked messages lol

quaint mantle
#

D:

#

why block

tender shard
quaint mantle
#

alr im out before I get the whole server to block me

hexed hatch
tender shard
#

yeah pretty stupid. There should be an option to not see them at all

quaint mantle
#

wait

#

I got how to set the entity type as a fake player

#

then what do I do?

tender shard
lethal roost
#

ohhhhhhhkay um
i dropped an item
why didn't this code execute?

    public void onItemDrop(EntityDropItemEvent event) {
        Bukkit.getLogger().info("entity drop item event fired");
    }```
tender shard
#

did you register the listener?

lethal roost
#

um


    private final FileConfiguration config;

    public PlayerDropItemHandler(HeavyWeapons plugin) {
        Bukkit.getPluginManager().registerEvents(this, plugin);
        this.config = plugin.getConfig();
    }

    // Removes effect if player drops item

    @EventHandler
    public void onItemDrop(EntityDropItemEvent event) {
        Bukkit.getLogger().info("entity drop item event fired");
    }
}
``` i think???
tender shard
#

and you dropped the item using Q or similar, right?

lethal roost
#

yeah

#

other stuff seemed to be working

#

just not this fsr

tender shard
#

it might be that you have to use InventoryClickEvent and check if the ACtion is DROP

#

maybe EntityDropItemEvent is only for "loot" of dying entities

lethal roost
#

i've checked that by killing zombies but that didn't work either

#

huh

tender shard
#

show the code in your main class

lethal roost
#

    FileConfiguration config = getConfig();

    @Override
    public void onEnable() {
        // Plugin startup logic
        config.options().copyDefaults(true);
        saveDefaultConfig();

        new PlayerHeldItemHandler(this);
        new PlayerDropItemHandler(this);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if(cmd.getName().equalsIgnoreCase("hvwreload")) {
            this.reloadConfig();
            new PlayerHeldItemHandler(this);
            sender.sendMessage(ChatColor.GREEN + "HeavyWeapons reloaded successfully");
            return true;
        }
        return false;
    }

    public FileConfiguration getConfigFile() {
        return config;
    }
}```
tender shard
#

why are you creating a new listener everytime the command is run?

#

and why do you compare the command's name?

#

and why do you have a onCommand method if you never register the command?

lethal roost
#

damn ok lemme try to answer all those questions lol

  1. i create a new listener cause whenever i reload the config with the command the config reloads but fsr the material doesn't update within the code, so it doesn't actually update the item -- i remember you (or someone else) talking about config cache or smth so idk
  2. i kinda had no idea what i was doing most of the time trying to get the command to work so i tried following a bunch of tutorials online and they all seemed to do things differently, and people kinda gave really complex answers in the discord i couldn't understand because i'm stupid so i just tried something and it worked ig
  3. i mean i put it in plugin.yml and it seems to have an autocomplete feature in the chat? does that count as registering?? i know i didn't put a line in the onEnable() but idk, it works but probably not very cleanly
    again this is my first plugin 😢
tender shard
#
  1. I'm not sure but don't you have two listeners then, after reloading? A better solution would be to simply not cache the config object, then a simple reloadConfig() is enough
  2. If you do not register more than one command per commandexecutor, you don't need to compare the name. I mean it doesn't hurt to do so, it's just useless
  3. I am not sure whether getCommand("asd").setExecutor() is only needed when the onCommand method is not in the main class. So as long as it works, just ignore my third question
#

so instead of saving "config" as field in your PlayerDropItemHandler, just store the plugin in a field. And instead of "config.get(blabla)", do "plugin.getConfig().get(blabla)" instead

lethal roost
#

oh ok

tender shard
#

the reason is that getConfig() always returns your cached config. If you do reloadConfig() however, you get a new config object. And your listener still keeps a reference to the old one, if you save the config object in a field

lethal roost
#

ah alright

tender shard
#

but anyway, the listener should actually work

#

hm I just checked. Neither killing a pig nor pressing Q triggers the event for me

glossy venture
#

do u have correct @EventHandler annotation

#

sounds rediculous but ive had that happen several times

#

idk if there are any other ones in default spigot but with my own event system i confused it

lethal roost
#

i mean this is the entire code ```package heavyweapons.heavyweapons.handlers;

import heavyweapons.heavyweapons.HeavyWeapons;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDropItemEvent;
import org.bukkit.inventory.ItemStack;

public class PlayerDropItemHandler implements Listener {

private final FileConfiguration config;

public PlayerDropItemHandler(HeavyWeapons plugin) {
    Bukkit.getPluginManager().registerEvents(this, plugin);
    this.config = plugin.getConfig();
}

// Removes effect if player drops item

@EventHandler
public void onItemDrop(EntityDropItemEvent event) {
    Bukkit.getLogger().info("entity drop item event fired");
}

}```

#

so i'm not sure what you mean

glossy venture
#

maybe try using just system.out

#

idk

lethal roost
#

willing to accept any solution at this point lmao

#

but the other code i want to run in the end result doesn't execute so even if system.out works i'm not sure if it'll help 🤔

outer wadi
#

How would I write with packets to an open sign editor?

#

i want to have custom lines there

#

(no embed)

lethal roost
# tender shard so instead of saving "config" as field in your PlayerDropItemHandler, just store...

small brain me is confused again
do you mean this?


    private final FileConfiguration plugin;

    public PlayerHeldItemHandler(HeavyWeapons plugin) {
        Bukkit.getPluginManager().registerEvents(this, plugin);
        this.plugin = plugin.getConfig();
    }

    // Equipping or unequipping items via offhand keybind

    @EventHandler
    public void onPlayerHoldItem(PlayerItemHeldEvent event) {
        Player player = event.getPlayer();
        ItemStack mainhandItem = player.getInventory().getItem(event.getNewSlot());
        ItemStack offhandItem = player.getInventory().getItemInOffHand();
        Material configMaterial = Material.valueOf(plugin.getString("material")); ... etc etc```

really bad with java terms but at least it doesn't give me an error, tho i don't know if it actually did anything
#

i feel like it's the same thing but just with some names changed

tender shard
#
public class YourClass {

  private final Plugin plugin;

  public YourClass(Plugin plugin) {
    this.plugin = plugin;
  }
}
opal juniper
#

Change my mind

tender shard
#

normally you should reference stuff by the weakest type possible. But in this case it doesn't matter at all anyway, so I'd say JavaPlugin == Plugin in this case

#

I mean you also wouldn't declare a method to require an ArrayList if you could just require a List instead, would you?

vocal cloud
#

👀

tender shard
#

they only need the config and Plugin declares getConfig(), so no point in explicitly making it a JavaPlugin

river oracle
#

whats the difference between the Plugin class and JavaPlugin I see people use Plugin sometimes and I don't get it

tender shard
#

JavaPlugin is an abstract class, Plugin is an interface

river oracle
#

oh okay

tender shard
#

for example JavaPlugin has the constructor logic builtin. If you'd just implement Plugin you'd have to do that yourself

river oracle
#

interesting

vocal cloud
#

It usually depends what you need from it. 99% of people probably don't need JavaPlugin or even their PluginClass but they use it anyways kek

tender shard
#

yeah true

#

if all they need is to access the config, then go for Plugin

river oracle
#

I use JavaPlugin to further abstract my classes that aren't project specific

#

🤷‍♂️

eternal oxide
#

I generally DI JavaPlugin as I never know what shitty code I'm going to write in the class in the future

river oracle
#

it'd be stupid to change the variable for every project also it would invalidate utilities to use a specific main class

tender shard
#

btw I also think that JavaPlugin doesn't provide ANY additional methods than what's in Plugin already anyway. So you actually never need JavaPlugin

vocal cloud
#

Generally I spend 5h using reflection to fix an issue I didn't have to begin with when it comes to DI kek

river oracle
tender shard
vocal cloud
#

It's best practice usually

harsh totem
#

I have this code which is supposed to set two arrow's vector to be around one arrow to make a bow shoot 3 arrows at once:

                arrows[1].setVelocity(vector.rotateAroundY(-50));```
I was wondering how to make them rotate vertically instead of rotate in the y axis. any ideas?
river oracle
tender shard
#

as said, it's the same as List and ArrayList. in 99% of cases you'll be doing stuff with ArrayLists but still, why declare it as ArrayList if you don't use any ArrayList specific methods?

#

type should be as weak as possible because then you can use it in more cases

#

for example many methods where you'd think they require a String actually only need a CharSequence

#

it wouldn't make sense to specifically require a String if no String-specific methods need to be accessed

vocal cloud
#

It's also good practice for when you start working with your own custom interfaces and such

river oracle
#

the description in the docs makes 0 sense to me

tender shard
#

I don't know if anyone has ever used it lol

eternal oxide
#

You'd have to dig through the CB source to see where it reads plugins from the plugins folder to register them. See if it handled PluginBase differently from JavaPlugin

tender shard
#

the SimplePluginManager only uses "Plugin" all the time

#

everything else wouldn't make sense since PluginManager#enablePlugin etc also only require a Plugin, not a PluginBase or JavaPlugin

sterile token
#

How would you access to a plugin instance if the plugin uses DI?

#

Throw Plugin Manager right?

tender shard
tender shard
#

throw plugin manager? whut?

sterile token
#

And what about if you want to access from another plugin!

#

🤔

tender shard
#

you can't DI inject it from the original plugin then so the questions doesnt really make sense

sterile token
#

Because i used to use a static getter for main class. Now that I dont use any more I dont know how to access

#

Do I explain?

tender shard
sterile token
#

Isnt what I said before?

#

😂 😂

tender shard
#

no, there you were talking about DI which you cannot do from another plugin

tender shard
eternal oxide
#

DI is to pass references from one part of your plugin to another class you are instantiating

tender shard
#

and that the plugin manager has the instance of it in a list

sterile token
#

Oh allrgiht

harsh totem
sterile token
#

So in fact for accessing plugin a from another plugin, which doesnt have a static getter we use Plugin Manager right?

stable geyser
#

help pls

#

D:\1.16.5>java -Dfile.encoding=UTF-8 -Xmx1G -jar spigot-1.16.5.jar
Unsupported Java detected (61.0). Only up to Java 16 is supported.

D:\1.16.5>pause
Press any key to continue . . .

tender shard
#

Unsupported Java detected (61.0). Only up to Java 16 is supported.

stable geyser
#

bro i have all java versons downloaded

#

how to activate correct one

tender shard
#

specify the full path to a supported ajva version

#

for example

stable geyser
#

how

tender shard
#

"C:\Program Files\Java\jdk-8\bin\java.exe" -jar spigot-1.16.5.jar

stable geyser
#

thanks

chrome beacon
#

Do note that's an example and copy pasting it won't work

stable geyser
#

o

harsh totem
stable geyser
eternal oxide
tender shard
chrome beacon
#

You need to find that yourself

stable geyser
#

its in program files

#

like everyone

tender shard
#

why are you using 1.16 anyway? all newer versions support java 17 and later

harsh totem
eternal oxide
#

so diagonals

stable geyser
tender shard
#

okay then you'd have to get the direction of the player location, and then... you need math lmao

eternal oxide
#

up and odwn in a line would be simple

tender shard
#

it was extremely easy but I don't really remember how the math is supposed to work

#

yeah up and down is easy

#

but left and right requires some angles and stuff

harsh totem
#

I have this Vector vector = arrow.getVelocity(); arrows[0].setVelocity(vector.rotateAroundY(50)); arrows[1].setVelocity(vector.rotateAroundY(-50)); arrows[2].setVelocity(vector.rotateAroundZ(50)); arrows[3].setVelocity(vector.rotateAroundZ(-50));
which gets the bug in the video

eternal oxide
#

yep x and z

stable geyser
#

@tender shard i need ur permission to sent photo

eternal oxide
#

nope, you don;t rotate them

tender shard
harsh totem
stable geyser
eternal oxide
tender shard
stable geyser
#

thanks

eternal oxide
#

its quite complex Math

tender shard
#

but ugh

#

how is this called agian

#

if you have a vector that is 90° aligned to the original one

#

how is that called in english

eternal oxide
#

parallel

tender shard
#

no

#

parallel is same direction

#

but I need the 90° rotated direction

eternal oxide
#

um, no idea if there is a single word for that

tender shard
#

like the red thing has a 90° angle to the blue

#

that's the word I'm looking for

eternal oxide
#

yep

harsh totem
#

hmm

harsh totem
tender shard
#

it's called Orthogonale in german

stable geyser
#

y this coming

tender shard
#

so basically you need the direction of the eyesight vector. get the orthogonal vector of that and normalize it. then add this to the player location's vector. and that's it

harsh totem
#

most of this isn't relevant

#

all the at...

humble tulip
agile anvil
humble tulip
#

what are u trying to do?

agile anvil
tender shard
tender shard
#

two vectors are orthogonal if their multiplied result is 0

#

but erm how to calculate that... I need a pen and paper

#

my math classes are 10 years ago lol

humble tulip
#

and |a||b|

#

and cos theta

#

well cos 90 is 0

#

so hence why it's 0

agile anvil
#

It's the dot product

humble tulip
#

that's it

subtle folio
#

ah yes math

agile anvil
#

Given two vectors A [a1, a2...] and B [b1, b2, ...]
The dot product A.B is the sum of a1*b1, a2*b2, ...

humble tulip
#

so if the dor product is 0, it's perpendicular

agile anvil
#

Yeah if A.B = 0, A and B are orthogonal

humble tulip
#

i did math up to 3d vectors but dont recall seing that word

#

we just used perpendicular

#

weird thinking abt it now

#

although, the concept is the same

agile anvil
#

Perpendicular is only used in 2D, not 3D

humble tulip
#

yeah but same concept

#

90 degrees

agile anvil
#

Same concept but not the same things

eternal oxide
agile anvil
tender shard
#

this is all i could come up with

#

i doubt that it helps anyone lmao

#

fucking pq formula

humble tulip
agile anvil
humble tulip
#

though when talking abt 90 degrees, it's generally more abt planes

#

not vectors

agile anvil
#

You have to specify the vector from which your doing the rotation

#

If I give you a vector and tell you to find a vector that is a rotation of 90°, could be infinite possibilities

humble tulip
agile anvil
#

When you give a plane or a vector yes

eternal oxide
#

Watch the video I linked. You already have teh Direction vector of the arrow, you can get the second vector by rotating the vector around Y by 90. That gives you the Plane.

humble tulip
#

do u want to make a "shotgun" effect?

#

where the arrows go out in a cone?

#

@harsh totem ur doing the correct thing. what ur doing wrong is vector.rotate(amount) and then vector.rotate(-amount)

#

the second one sets the vactor back to it's initial pos

#

use vector.clone.rotate

harsh totem
#

@humble tulip thank you it works now

topaz moon
tender shard
simple silo
#

How do I kill an armor stand? (with spigot)

tender shard
topaz moon
#

nope but I'm also from northrhein westphalia

#

:D

tender shard
#

oh okay. I have to answer the doorin the next 45 minutes because I was "randomly chosen" to have to answer their fucking questions in person

topaz moon
#

Last time they asked me (about 6 years ago) I declined

#

maybe it wasn't zensus but a compareable organisation

lethal roost
tender shard
topaz moon
#

nah 5000€ fine if you answer them wrong

twilit roost
#

I have 2 locations
They are placed so it forms rectangular shape
I just need to calculate each corner out of those 2 corners
corner1 being upper location
and corner2 being lower location

humble tulip
#

one sec

#

i gotchu

twilit roost
#

again 😄
you are my savior

severe harbor
#

So I had an interesting idea for a plugin and wanted to see if anyone knew if it was a thing or not before I looked into it.

**My Idea: **
Items dropped and respawned by a player (after death) can show up in loot chests in dungeons/structures later.

I was thinking about something like this while reading The Hobbit. I thought about how they found those old elven weapons and how that could be used in a SMP. Imagine you or someone else on the server dies at some point and they loose their stuff. Maybe some villager or zombie came along at some point and scooped up an old weapon and several days or months later, a player finds that weapon (with the same name and stats) in an old chest somewhere. Or possibly a zombie or skeleton has a chance of spawning with that weapon in hand? This would of course apply to other items as well. Just using weapons as an example.

Is there a plugin like this somewhere? Would it even be possible? What do you guys think?

topaz moon
#

lol

humble tulip
undone axleBOT
humble tulip
#

that what u want?

topaz moon
#

but you're right

#

holy

twilit roost
tender shard
#

a university?

twilit roost
humble tulip
#

np

topaz moon
tender shard
#

this is so stupid lol

topaz moon
#

:D

#

idk tbh

#

what do they ask

twilit roost
humble tulip
woeful flicker
#

jesus LOL

covert karma
#

is there an opposite event of ExplosionPrimeEvent which triggers when a creeper no longer ignites (player out of range)

twilit roost
humble tulip
opal juniper
twilit roost
#

great

humble tulip
#

and u dont need to calculate which is lower

humble tulip
#

dont even care to change it now

twilit roost
#

can I dm u ? again 😄

humble tulip
#

sure

covert karma
#

how can i make creepers always explode?
this doesnt work because creeper.explode() triggers the same event again which then gets cancelled

    @EventHandler
    public void onCreeperIgnite(ExplosionPrimeEvent event) {
        // Always explode after 1.5 seconds even if player left the radius
        event.setCancelled(true);
        if (event.getEntity() instanceof Creeper creeper) {
            Bukkit.getScheduler().runTaskLater(plugin, creeper::explode, 30L);
        }
    }
chrome beacon
#

You can add a PDC tag to identify the creepers you're exploding

#

?pdc

crude loom
#

I tried looking into how to remove arrows from a player with NMS
And I found this : ((CraftPlayer)p).getHandle().getDataWatcher().watch(9, (byte) 0);
It just canceled the player receiving any damage from the arrows and now it won't reset even if I reset the server
What can I do?

dusky wasp
covert karma
crude loom
dusky wasp
crude loom
#

Oh I'm using 1.8 so that wouldn't be possible for me, how do I cancel the player not receiving arrow damage though?

#

Yeah 1.8 is a nightmare 😅

subtle folio
#

EntityDamageByEntitEvent

#

check if damager is arrow

#

check if victim is player

chrome beacon
crude loom
#

I would love to, but this plugin is PVP based so I have to do it

chrome beacon
#

No you don't

subtle folio
#

we don’t need another pvp server

crude loom
# subtle folio EntityDamageByEntitEvent

Like that?

  if(e.getCause() == EntityDamageEvent.DamageCause.PROJECTILE && e.getDamager() instanceof Arrow && e.getEntity() instanceof Player){
            Bukkit.broadcastMessage(e.getDamager().getType().toString());
            e.getDamager().remove();
            return;
        }
chrome beacon
#

You can disable attack cooldown on modern versions

crude loom
#

and it was requested in 1.8

crude loom
#

It doesn't work😅

subtle folio
#

errors in console?

#

debug

strong flax
#

where do i download spigot

eternal oxide
#

?bt

undone axleBOT
crude loom
subtle folio
chrome beacon
#

You're removing the entity so it won't damage the player

crude loom
#

It does reach it because the print statement I put there does work

subtle folio
#

i see i see

#

csncel the event ?

#

why do you remove the entity

crude loom
chrome beacon
#

Wait so what's the issue

crude loom
crude loom
chrome beacon
#

You need to use the modern MySQL driver

#

The one you're using is outdated an unsecure which is why it's being denied

broken stirrup
#

i want to make a plugin that doesnt allow renaming items this is my code is:

`@EventHandler
public static void onInvClick(InventoryClickEvent event) {

    HumanEntity player = event.getWhoClicked();
    if (event.getClickedInventory() != null) {
        if (event.getClickedInventory().getType() == InventoryType.ANVIL) {
            if (event.getSlotType() == InventoryType.SlotType.RESULT) {
                ItemStack item = event.getCurrentItem();

                ItemMeta meta = item.getItemMeta();
                meta.setDisplayName(null);
                item.setItemMeta(meta);

            }
        }
    }
}`

the problem is that if the item is already renamed it renames the item to the original name, for example; i have an iron sword called "arkhalis" wich is a part of the plugin and when someone puts it in the anvil and applies an enchantment the item is renamed do "Iron Sword"

quaint mantle
#

---- Minecraft Crash Report ----
// But it works on my machine.

Time: 6/23/22 4:28 PM
Description: Exception in server tick loop

java.lang.NullPointerException: Exception in server tick loop
at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
at net.minecraft.server.v1_8_R3.NBTTagCompound.a(SourceFile:406)
at net.minecraft.server.v1_8_R3.NBTTagCompound.load(SourceFile:70)
at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:84)
at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:53)
at net.minecraft.server.v1_8_R3.NBTCompressedStreamTools.a(NBTCompressedStreamTools.java:43)
at net.minecraft.server.v1_8_R3.ChunkRegionLoader.loadChunk(ChunkRegionLoader.java:70)
at org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:25)
at org.bukkit.craftbukkit.v1_8_R3.chunkio.ChunkIOProvider.callStage1(ChunkIOProvider.java:1)
at org.bukkit.craftbukkit.v1_8_R3.util.AsynchronousExecutor.skipQueue(AsynchronousExecutor.java:336)

#

im getting this error

#

i mean the server keeps crashing

#

any fx?

river oracle
#

bruh feels the need to post it in every help channel

quaint mantle
#

nah

river oracle
#

?paste

undone axleBOT
quaint mantle
#

discord message send limit

covert karma
#

how do i spawn a custom entity, i made a class that extends Creeper but when doing world.spawnEntity() i can only give it an entitytype

quaint mantle
#

come dm

river oracle
undone axleBOT
river oracle
#

legit

#

just use hastebin

quaint mantle
#

oh

covert karma
#

no

river oracle
#

you basically can with a bit of messing around

covert karma
#

i made a creeper class that has a custom event in it

quaint mantle
#

here

#

full log

river oracle
#

you can use custom textures :P

chrome beacon
#

Make sure this is actually the version being used ln the server

covert karma
chrome beacon
#

Doubt it

river oracle
#

I was going to help but nah can't be patient

quaint mantle
chrome beacon
#

Spigot server not MySQL

quaint mantle
covert karma
#

how do i spawn that entity tho

chrome beacon
#

Oh NMS entities

broken stirrup
#

i want to make a plugin that doesnt allow renaming items this is my code is:

`@EventHandler
public static void onInvClick(InventoryClickEvent event) {

    HumanEntity player = event.getWhoClicked();
    if (event.getClickedInventory() != null) {
        if (event.getClickedInventory().getType() == InventoryType.ANVIL) {
            if (event.getSlotType() == InventoryType.SlotType.RESULT) {
                ItemStack item = event.getCurrentItem();

                ItemMeta meta = item.getItemMeta();
                meta.setDisplayName(null);
                item.setItemMeta(meta);

            }
        }
    }
}`

the problem is that if the item is already renamed it renames the item to the original name, for example; i have an iron sword called "arkhalis" wich is a part of the plugin and when someone puts it in the anvil and applies an enchantment the item is renamed do "Iron Sword"

quaint mantle
covert karma
quaint mantle
#

can u fix it? pls "pls"

chrome beacon
quaint mantle
#

oh

covert karma
chrome beacon
#

World#addFreshEntity

#

World being the NMS world not Bukkit

steel swan
#

Hey so i have a problem with my code :

for(Player players : Bukkit.getOnlinePlayers()){
                    User personalUser = new User(players.getDisplayName(), "alive", null, null, 0); //error is on THIS line
                    setUser(players.getUniqueId(), personalUser);
                    users.add(personalUser);
                }

User class :

public class User {

        private Role PlayerRole;

        private String PlayerName;

        private List<String> PlayerTags;

        private Team PlayerTeam;

        private Integer PlayerKills;

        public User(String name, String tags, Role role, Team team, Integer kills) {

            PlayerName = name;
            assert PlayerTags != null;
            PlayerTags.add(tags);
            PlayerRole = role;
            PlayerTeam = team;
            PlayerKills = kills;
        }

        public void setKills(Integer kills){this.PlayerKills = kills;}

        public Integer getKills(){return PlayerKills;}

        public void setTeam(Team team) {this.PlayerTeam = team;}

        public Team getTeam(){return PlayerTeam;}

        public void setRole(Role role) {this.PlayerRole = role;}

        public void addTag(String tag) {this.PlayerTags.add(tag);}

        public List<String> getTagList(){
            return PlayerTags;
        }

        public void setName(String name) {
            this.PlayerName = name;
        }

        public String getName() {
            return PlayerName;
        }

    }

error :
https://paste.md-5.net/hopozixozu.bash

steel swan
#

PlayerTags.add(tags);

chrome beacon
#

Why did you hide the warning Intellij gave you with an assert 🙃

steel swan
#

i dont get it i defined it up there

chrome beacon
#

It's defined not initialized

#

It has no value

#

You cannot add stuff to a list that doesn't exist

#

So start by creating your list instance

steel swan
#

ok i know how to fix it

chrome beacon
#

Now this is a learn java moment

undone axleBOT
lethal roost
#

my cursor turns invisible against it 😢

lethal roost
#

ah aight

river oracle
#

did you instanciate it

#

no you didn't why I bother even asking that

#

you have to instanciate the list

steel swan
#

wdym yes i initiated my list did i do smth wrong while doing it?

#

my bad

#

my bad

#

my bad

river oracle
#
com.naruto.lopversion.narutonew.NarutoNew.onCommand(NarutoNew.java:219) ~[?:?]``` whats on line 219
steel swan
#

its fixxed it was a stupid mistake

lethal roost
covert karma
#

for debug i put a broadcast in there as well

#

but it doesnt get called when the creeper explodes

chrome beacon
chrome beacon
eternal oxide
#

ignite is when it starts its count I believe

chrome beacon
#

Yeah that's what they want

covert karma
#

yeah it just doesnt get called

eternal oxide
#

you mean the ignite method isn;t called?

chrome beacon
#

Check the NMS class and see how it works

covert karma
#

how can i tell if thats the thing that gets called

#

i mean i assume it is, because nothing else is called ignite

#

and spigot api uses this name as well

chrome beacon
covert karma
#

that doesnt really help

chrome beacon
#

Check other behaviour not just that method

covert karma
#

yes, there is nothing else in there that has anything to do with igniting

chrome beacon
#

Don't have access to a pc so can't check for myself

covert karma
#

ok hang on

#

i tried explodeCreeper() instead just to see if that would work

#

and it does

#

hmm ok

#

well thats not the behaviour i want tho

chrome beacon
#

Does the Creeper have goals and a brain

#

If so check if it has a goal that would cause the ignite

covert karma
#

i mean yeah it extends Mob

chrome beacon
#

Yeah I'm looking for Creeper specific goals

covert karma
#

oh here

#

what do i do with that?

chrome beacon
#

There it is

#

SwellGoal

#

You will need to replace that with your own

covert karma
#

._.

#

how

chrome beacon
#

You could override that method

#

And then create your own SwellGoal with the behaviour you want

quaint mantle
#

keep getting this error
Cannot resolve constructor 'ItemStack(me.superischroma.spectaculation.item.SMaterial)'

@Override
    public SEntityEquipment getEntityEquipment()
    {
        return new SEntityEquipment(new ItemStack(SMaterial.IRON_SWORD),
                new ItemStack(Material.CHAINMAIL_HELMET),
                new ItemStack(Material.CHAINMAIL_CHESTPLATE),
                new ItemStack(Material.CHAINMAIL_LEGGINGS),
                new ItemStack(Material.CHAINMAIL_BOOTS));
    }
``` yes I know it should be Material.SOME_ITEM but I have added some custom items and I want to add it to the equipment part
whats the error and how do I fix it?
harsh totem
#

is there a way to get the axis a player is facing?

chrome beacon
#

It needs a material

#

So convert your one to the regular one

quaint mantle
#

but I dont want it to be a material

#

I want it to be a custom material which I made

#

which is SMaterial

chrome beacon
#

Alright then you will need to start modding the Spigot jar

#

Basically make your own fork

quaint mantle
#

so this wont work?

chrome beacon
#

It won't

eternal night
#

I mean, "custom materials" don't even work really

quaint mantle
#

so I cant give mobs custom helm and stuff?

chrome beacon
#

You can

#

Just not custom materials

quaint mantle
#

ah

#

alr thanks man

sterile token
#

You can add amor to amor stand vía code?

warm galleon
#

How to i include NMS things like CraftLivingEntity with maven? my pom.xml looks like this

<project>
...
<repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <!--Spigot API-->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <!--Bukkit API-->
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

or is there a better way to remove ai from an entity ( so they dont move around )

chrome beacon
eternal night
#

setAI(false) ?

#

or did that not exist back in the 1.8.8 days

chrome beacon
eternal night
#

well

harsh totem
#

how do I get the values on the right?

eternal night
#

sucks

#

tho, NMS isn't really needed

#

iirc NoAI existed in 1.8.8

#

just no API call

chrome beacon
chrome beacon
eternal night
warm galleon
quiet ice
#

Did you use bt?

chrome beacon
#

Probably not

warm galleon
#

no

quiet ice
#

You need to compile spigot in order to use nms

chrome beacon
#

?bt

undone axleBOT
warm galleon
#

i thought bt was used only as like

#

to make the server

#

not for development

chrome beacon
#

It's for both

covert karma
#

fusecreeper extends net.minecraft.world.entity.monster.Creeper

chrome beacon
#

Yeah that's not a bukkit entity

#

So you can't really cast it

covert karma
#

ok alternatively how can i make the goal not cancelable

harsh totem
covert karma
#

OH SHIT IT FINALLY WORKS OMG

chrome beacon
paper viper
harsh totem
chrome beacon
#

Haven't seen you here in a while pulse

chrome beacon
harsh totem
#

no auto complete

ancient plank
#

kappa

chrome beacon
#

get yaw or get pitch

harsh totem
#

thanks

crude loom
#

How can I detect the shooter of a projectile when it kills a player?

tardy delta
#

Entitydeatheveny

chrome beacon
#

Get the entity cast it to a projectile and call get shooter

tardy delta
#

^^

#

Cant type on phone lmap

chrome beacon
#

On phone too :)

ancient plank
#

lmap

tardy delta
#

Sitting in the train lmao

eternal oxide
#

nm, I thought you said on 🙂

tardy delta
#

Don't try to be funny

eternal oxide
#

Yes sir

tardy delta
#

😩

covert karma
#

how would i replace any creeper that spawns with my custom creeper

#

i am trying to do it in creaturespawnevent but i am getting stackoverflow errors

#

so i tried adding a pdc entry to my custom creepers to not make an infinite loop, but that doesnt do anything

if (entity instanceof Creeper && entity.getPersistentDataContainer().get(creeper_is_fusecreeper_key, PersistentDataType.BYTE) == null) {
    Creeper creeper = (Creeper) entity.getWorld().spawnEntity(entity.getLocation(), EntityType.CREEPER);
    entity.remove();
    creeper.getPersistentDataContainer().set(creeper_is_fusecreeper_key, PersistentDataType.BYTE, (byte)1);
}
worldly ice
#

spawning an entity calls the event again

eternal oxide
#

You call spawn before you set teh PDC

worldly ice
#

and since you don't modify the pdc until after it overflows

eternal oxide
#

use teh spawn that accepts a consumer

steel swan
#

so i have an enum called Role, how can i create a list containing all vallues of that enum

worldly ice
#

Enum#values()

eternal oxide
#

set teh pdc in the consumer

covert karma
coarse grotto
#

Hi, I am creating a plugin that allows a player to use a certain item and get a permission (tmc.hasthestone) and if they have the permission and they die they're items are kept just for that one instance until they get the permission back...how can I detect the player death? this is what I have in terms of detecting the player death

#
@EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player player = event.getEntity();
        ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
        if (player.hasPermission("tmc.hasthestone")) {
            event.setKeepInventory(true);
            event.setKeepLevel(true);
            String removestone = "lp user " + player.getName() + " remove tmc.hasthestone";
            player.sendMessage("Inventory and Levels Kept.");
            Bukkit.dispatchCommand(console, removestone);
        }
    }```
humble tulip
eternal oxide
coarse grotto
humble tulip
#

isnt it -> lp user name permission unset permission.node

coarse grotto
#

im not using luck perms

#

i am using light perms lol

humble tulip
#

ohhh ok

coarse grotto
#

yea

#

everything works besides detecting player death

humble tulip
#

is the death not recognised?

coarse grotto
#

yea it isn't recognised at all

humble tulip
#
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        System.out.println("player died");
        Player player = event.getEntity();
        ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
        if (player.hasPermission("tmc.hasthestone")) {
            event.setKeepInventory(true);
            event.setKeepLevel(true);
            String removestone = "lp user " + player.getName() + " remove tmc.hasthestone";
            player.sendMessage("Inventory and Levels Kept.");
            Bukkit.dispatchCommand(console, removestone);
        }
    }
#

try that

#

see if you see player died in the console

coarse grotto
#

alrighty

ancient plank
#

I always make a listener class and do a lot of work in it and forget if I ever registered it, so I put it on my server and then get irritated when I find out I didn't register the class kekw

coarse grotto
humble tulip
covert karma
humble tulip
#

ye u can do that too

coarse grotto
#

now lets see if it magically works

#

yep it works but problem is my items are still kept

#

do I need to set the event.setKeepInventory(true); & event.setKeepLevel(true); to false after?

humble tulip
#

doubt that'll do much

#

maybe have an else

#

and set keepinvneotry to false

coarse grotto
#

ill try that

ornate patio
#

what's the convention for display commands with different params depending on the first param

#

like this is what i have right now
§cUsage: /<command> <add|remove> <player> §7OR §c/<command> <list> [page]

coarse grotto
# humble tulip maybe have an else

Ok I have a problem where it drops the items and XP when I die but still keeps the items in my inventory when I dont have the permission

smoky oak
#

wait a creeper and a exploding creepere are different entities?

ornate patio
#

I'm trying to make a command that takes a player's username as an input, even if they aren't online

#

i need to get the UUID from that player name

humble tulip
#

and do event.getDrops.clear

#

event.setDroppedExp(0)

ornate patio
smoky oak
#

@ornate patio can't you just do getPlayer? It's deprecated because using names means they could'Ve changed

#

but it does have the uuid

coarse grotto
ornate patio
#

it doesnt sound reliable thogh

humble tulip
coarse grotto
smoky oak
# ornate patio

what that wants to say is that players can change their names. The only reason it's deprecated is that unlike getPlayer(uuid) it can return the wrong player

smoky oak
#

if for example i do something like /teleportonlogin <name> and two players switch names before rejoining

#

it'll hit the other player

coarse grotto
#

got it

#
@EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        System.out.println("player died");
        Player player = event.getEntity();
        ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
        if (player.hasPermission("tmc.hasthestone")) {
            event.setKeepInventory(true);
            event.setKeepLevel(true);
            String removestone = "lp user " + player.getName() + " remove tmc.hasthestone";
            player.sendMessage("Inventory and Levels Kept.");
            Bukkit.dispatchCommand(console, removestone);
        } else {
            event.setKeepInventory(false);
            event.setKeepLevel(false);
        }
    }```
ornate patio
smoky oak
#

well getoffline was always an issue

ornate patio
#

just wondering if there was a library to automatically handle mojang requests and stuff

humble tulip
agile anvil
ornate patio
#

getting UUIDs from player name

coarse grotto
ornate patio
humble tulip
#

there's this

coarse grotto
#

the two lines I need to add in the setting keep inventory

humble tulip
#

ur gonna have to cache yourself

coarse grotto
#

ok

humble tulip
#

also print a message in the if saying "keeping inventory"

#

and "not keeping inventory" in the else

ornate patio
humble tulip
ornate patio
#

yeah but im lazy

humble tulip
#

just put it in a map for x amt of time

ornate patio
#

ill worry about it later ig lmao

smoky oak
#

can u make an inedible item edible?

humble tulip
#

for sure with texture packs u can

#

using edible items ofc

smoky oak
#

wait, is eating handled by the client or the server?

coarse grotto
#

well now another problem has arrived...it always thinks I have the permission when I don't

humble tulip
#

see what the console says

#

console will say wheter the command was executed successfully

coarse grotto
#

the command does work

agile anvil
smoky oak
#

welp that answers that question

humble tulip
#

can u send a pic of ur console when u die?

agile anvil
#

But it still sends the beginning of the animation

#

However you can just send the packet of eat without playing the animation it will work

coarse grotto
humble tulip
coarse grotto
#

ohh

#

one moment then

humble tulip
#

i can send pics

coarse grotto
#

aha

humble tulip
#

hm

#

when u check ur perms what u see?

coarse grotto
#

when I did it at the top it said I have the permission and then after when I died twice it said I dont have it

#

I can do a screen recording for an example if you'd like?

smoky oak
#

@agile anvil can you elaborate on the packet?

twilit roost
#

Im moving blocks on which players are standing
How do I move the player seamlessly so they don't fall down but move together with those blocks?

#

?paste

undone axleBOT
twilit roost
twilit roost
#

but it doesn't work how I imagened it to

humble tulip
#

try with luckperms

twilit roost
humble tulip
#

see how that works

twilit roost
#

or do u mean source code?

smoky oak
#

yes

#

honey blocks drag entities when moved

twilit roost
#

ooh

#

nice

humble tulip
#

or unsetting it and setting it somehwere else?

twilit roost
#

unsetting and setting

humble tulip
#

u can try and see if it works

twilit roost
#

WorldEdit
I paste schematic, after second i Undo paste
and paste again

smoky oak
#

to be fair

#

piston movement is gltichy once you exceed a few dozen

twilit roost
#
private void doSlideMovement(Entity var0) {
    Vec3 var1 = var0.getDeltaMovement();
    if (var1.y < -0.13D) {
        double var2 = -0.05D / var1.y;
        var0.setDeltaMovement(new Vec3(var1.x * var2, -0.05D, var1.z * var2));
    } else {
        var0.setDeltaMovement(new Vec3(var1.x, -0.05D, var1.z));
    }
    var0.resetFallDistance();
}
``` this doesnt help me tho
smoky oak
#

why not?

smoky oak
#

i mean you got to have the vector wheree you move to

twilit roost
#

what does even var0 and var1 mean?

coarse grotto
humble tulip
#

the delta movement is the block before

#

compared to the block after

smoky oak
#

.......learn to read

twilit roost
#

oh then it makes sense

humble tulip
coarse grotto
humble tulip
#

use luckperms

#

well just try and see

#

if it's a lightperms bug, u can report it to alex

twilit roost
#

couldn't I just do Location newLoc = shipNewPos.subtract(player.getLocation)); ?

humble tulip
#

shipnewPos.clone.add(shipOldPos.clone.subtract(player.getLocation))

#

that's the new player loc

twilit roost
#

ye thx

coarse grotto
smoky oak
twilit roost
#

oh right

coarse grotto
#

any ideas on what to do?

agile anvil
# smoky oak <@318130333025435674> can you elaborate on the packet?

Well I don't find the "start" packet sent by the client, but it seams to have changed.
Now the end of the animation is managed by the server.
So

  1. Player starts eating and send : Idkpacketname x)
  2. Server receive, count the correct time, send EntityStatus packet with status 9 (end of action), update food and items
subtle folio
#

I want to make a sort of gui that like, two players can see at the same time

#

what would be the best way to update both guis?

eternal night
#

you could just send them the same inventory ?

#

if possible

subtle folio
#

wait

#

is that possible

eternal night
#

Yea

agile anvil
#

x)

subtle folio
#

lessgo

coarse grotto
#

@humble tulip problem solved...I am very dumb... I have OP which means I HAVE ALL PERMS SMH

subtle folio
#

ily

smoky oak
agile anvil
#

It should, have to find which one

smoky oak
#

eh im just asking to know

#

if im doing something i'll have to make a runnable anyways

#

and giving that one information or stop it is annoying

slim brook
#

Hello ! Someone know how I can did a "machine". I would like do a loop that do something when block (exp = cauldron) with an special NBT make something on all chunks loaded

#

I already use NBTAPI

smoky oak
#

there's a onChunkLoad event. No idea how to use that api tho

#

just loop through all chunk coordinates and check the blocks

slim brook
#

onChunkLoad check all block in ?

smoky oak
#

kinda

#

the event just gives you the chunk

#

go from there

slim brook
#

Hmm ok

smoky oak
#

do three nested loop, one per coordinate

#

id suggest y the outer one

slim brook
#

THx I will see un Spigot API what I can do 🙂

slim brook
#

cause check all block in loaded chunks with 100 players that will lag no ?

smoky oak
#

its once per chunk not once per player

#

whats your view distance?

slim brook
#

actually 10

#

But it's default

#

I will change this to 4 or 6

#

But it's same problem

#

I don't want create tps drop X)

smoky oak
#

yea scanning around a billion blocks at once will cause lag

#

is your plugin the one responsible for that nbt data?

agile anvil
slim brook
#

Yes it is

smoky oak
#

yea in that case

#

save locations in chunk PDC

#

and done

slim brook
smoky oak
#

uh no

#

doing that has the issue of you registering unloaded blocks

#

thats unnecessary overhead

#

save the locations of those blocks in the chunk file

agile anvil
#

Or save them in the chunk file, but it will be harder to catch them all if you want a quick erase of data

smoky oak
#

hoo boy

#

thats a good point

#

its such a pain in the ass to clear out pdcs

small current
slim brook
#

what's PDC ? 😅

small current
#

what kind of color code is it

eternal night
#

?pdc

smoky oak
#

blocks have not

slim brook
#

Ok ok

smoky oak
#

theres a library that emulates that by stuffing pdc into chunk pdc

#

i think mnfalex made it

agile anvil
slim brook
#

but the 1.8.8 version didn't have that no ?

smoky oak
#

i think they do have that

#

im not sure

small current
smoky oak
#

could be a 1.13 thing

slim brook
#

That why i use NBTAPI

agile anvil
agile anvil
slim brook
small current
#

yes and i can but idk what it is based on actually

solid cargo
#

why tf

#

i just opened it and starterd crying like that

slim brook
#

For don't call the configuration file everytimes ?

slim brook
solid cargo
#

thanks!

#

update: invalidating caches helped

agile anvil
#

Depends. If you have to do some regular stuff on your machines (other than just checking if it's a machine when a player interact for instance), I recommend you to load your machines on memory. To avoid overload, listen to ChunkLoadEvent and check in your config file if one or more machine are in the chunk, then load it

#

If it's just an interact stuff, don't load your machines, just give them an NBTTag, and check each time a player interact that the block has the NBT of the machine

small current
#

what is the 6 digit based color code based on numbers

#

the name of it

agile anvil
#

It's hex RGB

smoky oak
#

algae

small current
agile anvil
#

Yeah

small current
agile anvil
#

Hex are numbers, 0-9a-f

smoky oak
#

can u try to set the color to #ffffff and make a screenshot

#

i want to see what happens

small current
smoky oak
#

NICE

small current
smoky oak
#

if wromg colour

agile anvil
#

Did you do that server side ??

small current
#

yes

#
Location location = player.getLocation();
                BiomeFog fog = ((CraftWorld) player.getWorld()).getHandle().getBiome(new BlockPosition(location.getX(), location.getY(), location.getZ())).l();
                Field c = fog.getClass().getDeclaredField("c");
                c.setAccessible(true);
                c.set(fog, Color.RED.asRGB());
agile anvil
#

Well that's good to know thanks !

smoky oak
#

now the question is

#

can you do that only to the entire biome

agile anvil
#

Try with "fcc203"

smoky oak
#

or to single parts of it

small current
#

it requires int

smoky oak
#

I'd like to affect a specific area of blocks

agile anvil
small current
smoky oak
#

could i declare an area of blocks a new biome then?

agile anvil
smoky oak
#

does that work?

small current
smoky oak
#

giving hex inputs decimal numbers

agile anvil
small current
#

piss

agile anvil
#

lmao it works

smoky oak
#

wrong game sniper

smoky oak
#

particles cause

#

um

#

lag?

#

i cant send out more than 40k particle packets before it MASSIVELY delays them

#

chops them up for some reason

#

it loads half of it

agile anvil
#

40k per second ???

smoky oak
#

then the other half

#

yes

agile anvil
#

OMG x)

smoky oak
#

i mean a packet is what

humble tulip
smoky oak
#

60 bytes?

agile anvil
#

It's almost a DOS in that case

smoky oak
#

well the issue is probably my router anyways

#

unfortunately for smooth curves i need a buttload of particles

agile anvil
smoky oak
#

im using the colour change particle

#

since thats nondescript and can be assigned a colour

small current
# humble tulip can u share how u did this?

Location location = player.getLocation();
BiomeFog fog = ((CraftWorld) player.getWorld()).getHandle().getBiome(new BlockPosition(location.getX(), location.getY(), location.getZ())).l();

            Field c = fog.getClass().getDeclaredField("c");
            Field f = fog.getClass().getDeclaredField("f");

            f.setAccessible(true);
            c.setAccessible(true);

            c.set(fog, Color.PURPLE.asRGB());
            f.set(fog,Optional.of(Color.PURPLE.asRGB()));
#

1.17.1

smoky oak
#

might be an idea to do that remapped

#

i noticed youre using vanilla nms there

humble tulip