#help-development
1 messages Β· Page 1528 of 1
how do i make it when somebody hits another person the person being hit a message
Do you know java?
yeah but im no expert
Ever made a plugin?
then take a look in teh javadocs for EntityDamageByEntityEvent
Use EntityDamageByEntityEvent and then check if the damager and damagee is both players, in that case just post the message
?jd
Dosnet matter if I remove the return statement it still dosent work
You havn't show us enough code to comment any further.
public static void onHit(EntityDamageByEntityEvent event) it sais missing method body, or declare abstract
This is practically everything that has to do with the code
public static void onHit(EntityDamageByEntityEvent event) it sais missing method body, or declare abstract
What is perform? and what is it overriding?
It just makes it so I can make subcommands into one major command
The perform method is called in the main command method
Then add sysout debugs to see what isn't being called. Somewhere your code is not even running as that is such basic code it can;t fail if its actually called.
can i edit an a hologram with a boolean?
like whan boolean is true the holo will say "true"
and whant the boolean is false the holo will say "false"
At a glance it looks like you are modifying the Map as you loop over it. Concurrent maps are for Thread safety not modifying without itterating.,
Nope. just get an object from the map
You can see the code.
hwlp
i have a minecraft server with aternos and i have a few plugins (bukkit and spigot)
i have a plugin that does /dual
the only problem is it requires admin/moderator
is there a way to change what commands require moderator?
you have to tell us what exactly is not working
does the command even fire if its a command?
is it the for loop?
Does anyone know what pathfinder goal I should choose when making a zombie attack a specific player only?
Or do I have to create my own one
just set the player as the zombies target
It fires on a command and I cant say what isent working because it dosen tell me, nothing ingame and nothing in console it just returns blank
so debug
than it will tell u
thats what im doing rn
To that you need a pathfinder goal...
since when?
Well how would you set it's target otherwise?
over the #setTarget(LivingEntity) method?
?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Mob.html#setTarget(org.bukkit.entity.LivingEntity)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#attack(org.bukkit.entity.Entity)
^^
declaration: package: org.bukkit.entity, interface: Mob
declaration: package: org.bukkit.entity, interface: LivingEntity
Yeah I saw that now
Guys, I created a config.yml. I want to make that when someone types /test, a siege a setting changes.
For example:
test123:
After command, it becomes:
test123: "Already run"
I tried using the getConfig().set method but nothing happened.
yeah just check if the boolean is true and then set the string to true
did you also save the config?
uhh i need like to edit the holo
just change the customname of the entity
not on create
saveConfig()
umm ye i am dumb π₯΄
The cme looks be thrown from within the getType method and passed back through your invoke
Hey, does anyone know what I can do to fix this error ?
Could not pass AsyncPlayerChatEvent to project v1.0
thank you, worked
we would need more information
U mean this?
public static onAsyncPlayerChatEvent(AsyncPlayerChatEvent e) {
api.getTextChannelById(<idL>).ifPresent(channel -> { channel.sendMessage("test"); });
}```
It prints out the team like I want it to but it wont send it to the player?
more like the error following that statement
Ok wait, I need to startup my laptop :|
whats inside your msgPlayer
@stone sinew This seems like its you calling the getType method async causing the cme and not your own Map.
i meant more like what is your msgPlayer method actually doing
what is the action. for hitting a player with EntityDamageByEntityEvent
check if both entities are instanceof Player
check placeholderapis github wiki page for best information
hm
any of you guys know how i might circumvent falling block render distance limitations?
for some reason, falling blocks seem to derender very close to me
like say only 20 blocks away
i want them to be rendered farther distances away
How can I read from yml file that people can add content to? this.getCustomConfig().getInteger("lord.weight"); would obviously work for only for lord rank, example:
ranks:
lord:
weight: 1
duke:
weight: 1
emperor:
weight: 2
# And so on
any one know how to fix?
Hello, how do i get a HashMap with getConfig.get... ?
getValues I believe
Question.. How can meta be a LinkedTreeMap when it's literally being casted to a Map<String, Object>?
Map<String, Object> meta = (Map<String, Object>) data.get(i).get("meta");
System.out.println("Data is: " + data.get(i).get("meta").getClass().getName()); // com.google.gson.internal.LinkedTreeMap
System.out.println("Meta is: " + meta.getClass().getName()); // com.google.gson.internal.LinkedTreeMap
just because you cast something doesn't mean it is that class
you could cast a player instance to an Entity
the object itself would still be a player
help
do you have the repository ?
what repository ?
for the placeholderapi
So casting doesn't cast stuff, got it - how would I go about making the thing I'm casting to another type actually cast to another type?
ummm yes?
<repositories>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
this repo
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.9</version>
<scope>provided</scope>
</dependency>
</dependencies>```
what is the javadoc to tell a player "welcome" i mean, only a player not to all the server
well choose an implementation of the Map interface (e.g. HashMap) and create a new one using the LinkedTreeMap as a basis
not really a single javadoc. Basic concept is to listen to the player join event and send a message to the player.
yes
does mvn package work out fine ?
unrelated error tho
Bukkit.broadcastMessage("Bienvenido " + event.getPlayer().getName() + "a HitleCraft!")
"Bukkit.broadcastMessage" but i think that with this javadoc the message is sent to all the server
checkout Player#sendMessage instead
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project main: Compilation failure: Compilation failure:
[ERROR] /C:/code/plugin/nedertight/src/main/java/net/inbar/main/Main.java:[107,29] incompatible types: java.lang.String cannot be converted to java.util.logging.LogRecord
[ERROR] /C:/code/plugin/nedertight/src/main/java/net/inbar/main/Main.java:[113,24] cannot find symbol
[ERROR] symbol: method warn(java.lang.String)
[ERROR] location: class java.util.logging.Logger
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
that is something just wrong with your code
whatΒΏ
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
line 107 getLogger().log("hook into placehoderAPI!");
} else {
getLogger().warn("Could not find PlaceholderAPI! This plugin is required.");
Bukkit.getPluginManager().disablePlugin(this);
}```
i haven't find any msg javadoc D:
isn't your IDEA screaming at the getLogger.log method call ?
declaration: package: org.bukkit.command, interface: CommandSender
note that Player extends CommandSender
so you can use that method there
ok ty
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
System.out.println("hook into PlaceHolderAPI");
} else {
System.out.print("Could not find PlaceholderAPI! This plugin is required.");
Bukkit.getPluginManager().disablePlugin(this);
}```
now it's will work
maybe
the plugin working fine
but i dont know how to make placeholder
i read the docs and i have error
have you clicked the reload button in the maven window ?
try it π
?
above it
https://hastebin.com/uheridococ.kotlin I don't suppose anyone wants to sort my headache out?
but is your pom fixed ?
yep
soo
The papi documentation is pretty good, you got this πͺ
and i have youtube
yeah I am. But the error occurred in 1.8 but not in 1.16
Anyone want to join me over in hell? https://hastebin.com/gurazenewe.kotlin
I'm almost ready to just not make this plugin lol
@eternal night can you help me with that?
Hi, i need help
can you send me the entire stack trace π
Does anyone know why this https://mystb.in/HawaiiMouthMining.swift does not remove the lore? It contains the string, but it does not work (I've debugged)
getLore returns a new copy of the lore every time
Oh
you will have to store the list in a variable and then modify the list
after you you are done, feed that list back to the itemmeta using ItemMeta#setLore
Yeah
@eternal night do u know this?
send code...
Also ```java
NMSReflection nms = NMSReflection.getInstance();
nms.getNMSTypeMethod(nms.getCraftWorld(minion.getStartingLoc())); // <- Runs method sync to place Object in map.
new BukkitRunnable() {
public void run() {
Map<Location, LocationData> blockData = BlockRetrieval.getInstance().getBlocksNMSLambda(minion.getStartingLoc(), minion.getRadius(), minion.getType());
new BukkitRunnable() {
public void run() {
lj.chopTrees(blockData);
lj.setIsWorking(false);
}
}.runTask(MinionMain.getInstance());
}
}.runTaskAsynchronously(pl);
sure
package Evento;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class MiEvento extends Event {
private final String playerName;
public ExampleEvent(String playerName){
ExampleEvent exampleEvent = new ExampleEvent("Msrules123");
this.playerName = playerName;
}
private static final HandlerList HANDLERS = new HandlerList();
@Override
public HandlerList getHandlers() {
return HANDLERS;
}
public static HandlerList getHandlersList() {
return HANDLERS;
}
public String getPlayerName() {
return this.playerName;
}
}
?paste
please
^
this is pain
oh sorry
@acoustic pendant it is probably ExampleEvent
do you know java?
more or less
When did you start
i'm learning classes rn
- You are using a constructor that != the name of the class
- You are creating a new object of a class that (probably) does not exist.
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Not sure what to say, but the cme is not in your code. Its being thrown back from the nms
@weary geyserlmao i just realized, i solved it ty
Sorry, I'm new to plugin development
i have already seen it but didn't realize xd
does anyone have a list of all events?
?jd
?jd
slow haha
Yeah I'm gonna have to dig into that.
yeah
alright
so
i have the basic App.java file
for just onEnable and onDisable
would i create another file/class in order to manage an event or something?
You can do that in the same class or a different one
Guys, I want to save a location in config.yml (I did that), but how is the correct way to call it with p.teleport?
nvm
getConfig().getLocation(path)
Location loc = getConfig().getLocation("path.to.location");
Player#teleport(loc);
too pretty ^
yeah idk
:(
its a utube channel :)
totally not mine
π
stop or kick
:(
no :(
i need subs
go ask somewhere else
don't post it here
this isnt an advertisement server
i love this mod https://www.youtube.com/watch?v=FcJ0ID9B7xQ
ummmm
help
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
post shit in general smh @granite stirrup
23.06 14:55:39 [Server] INFO at net.inbar.main.Main.regstercmd(Main.java:33) ~[?:?]```
why cant i shitpost here ?
because its a help channel
WHAT DO YOU THINK?
getCommand("hunger-lob").setExecutor(new hglob());
``` line33
k
only a few people are allowed to have off-topic discussions on here
yes me
help meeeeeee
No, it's NNY, frostalf and a few others. But not you
be patient
Does anyone just have a class or whatever for simply Serializing / Deserializing ItemStacks to a database? This is beyond a joke
yes it is me i shitpost all the time
.
never gotten muted it never gotten deleted
Cmon man, gimme the pass π
i dont care if you shitpost a little in here but large convos go in #general, especially when people are asking for help
^
commands:
hunger-lob:
Your command was not found in your plugin.yml
ohhhhhhhhhhhhhhh
ye
i am dumb
when a player is hit by an arrow or fireball, it triggers the EntityDamageByEntityEvent. It's the same if the player blocks it with a shield.
Anyone know how to tell from the event if the player blocked it?
check the final damage?
Hi, I would like to know how I could prevent a list of biomes from generation. I would like to generate a world without ocean in 1.16. Here is my topic whith my progression: https://www.spigotmc.org/threads/how-to-remove-biome-from-world-generation.511921/
Hmm, I'm getting Unhandled exception type IOException when using BukkitSerialization.itemStackArrayFromBase64(String data)
ItemStack[] Stock = BukkitSerialization.itemStackArrayFromBase64(myBase64StringItemStack);
where are you storing these ItemStacks?
Where? Into a database, but they're just strings?
what database?
an SQLite database
standby
Well, there's not really an error as such, I can't build the jar to get an error, and running a build with --stacktrace enabled doesn't spit out anything useful
then wrap your call in a try/catch
PlayerInteractEvent I guess
@eternal oxideIt's all working fine lol ... thanks man! I never want to work with item serialisation again!
hm
check clickedBlock and currentItem
i know, but there is a tag for eggs?
spawneggs ?
I think paper has one
instead tag
What can happen with paper test build as a server ? Is this possible that my plugin which isnt working (incomphrehensibly), doesnt work because I'm on paper 1.17 ?
no
paper is spigot fork
spigot plugins works on paper
Try asking Paper
But what Aniby says is correct things should generally work
yes but what about "1.17 test builds" those are a fork of 1.16.5 spigot as well, right ? I guess it shoudnt create that much of problems for plugins functioing
paper has master
use this
master ?
master already for 1.17
master version
they are forks of spigot 1.17
paper waited to update until spigot 1.17 released
hmm yea that's what I use
I guess my problem doesnt come from paper but rather from inner working of plugins then
if the plugin was written for 1.16-, then problems may arise, especially with JDK (lower 11) and NMS
Now not enough plugins with 1.17 support
Hmm yea I coudnt do much things in this case
I'll just have to wait
anyway
thank you
I guess nobody has an idea for my problem: #help-development message
for next issue with problem with server ask in #help-server
Instead of trying to override the vailla biome registry write your own world generator
You should be able to salavge most of the vanilla one
I looked up in this way too, but I have no clue how to filter the biomes π€·ββοΈ
I assume I tried it in a wrong way
public class CustomChunkGenerator extends ChunkGenerator {
@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
ChunkData chunk = createChunkData(world);
for (int X = 0; X < 16; X++){
for (int Z = 0; Z < 16; Z++) {
for(int Y = 0; Y < 256; Y++){
if(getBlackList().contains(biome.getBiome(X, Y, Z))){
biome.setBiome(X, Y, Z, Biome.FOREST);
}
}
}
}
return chunk;
}
private ArrayList<Biome> getBlackList(){
ArrayList<Biome> blackList = new ArrayList<>();
blackList.add(Biome.OCEAN);
blackList.add(Biome.COLD_OCEAN);
blackList.add(Biome.DEEP_COLD_OCEAN);
blackList.add(Biome.WARM_OCEAN);
blackList.add(Biome.DEEP_WARM_OCEAN);
blackList.add(Biome.LUKEWARM_OCEAN);
blackList.add(Biome.DEEP_LUKEWARM_OCEAN);
blackList.add(Biome.FROZEN_OCEAN);
blackList.add(Biome.DEEP_FROZEN_OCEAN);
return blackList;
}
}
is it possible to check the light level of a location which a player is in
get the block
okay thx
when i clicking on block with paper(simply custom block) happening this:
https://imgur.com/XUNH7XV
replacing of block
and i should prevent it
how i can do it?
nvm
anyone know why persistentdata on an itemstack wouldn't be persistent over a relog?
I'm on 1.16.5
I have this ```java
public void onDeath(EntityDeathEvent e) {
}``` how can I check if the player killed the entity?
@EventHandler
public void getCoin1(EntityDeathEvent e) {
Entity dead = e.getEntity();
if (dead.getLastDamageCause() instanceof Player) {
}
}
something like that
then cast the damager to player
use codeblocks
whoops
thx :)
π
read javadocs of this event
show the code regarding PDC that fails
lower 1.8, i think
because I have this problem
oading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
it's written, update you class call
google.com doesn't helps?
nop
am I wrong
what do u mean
but it wont work for some people on older mc version
like 1.8
I remember com.mysql.cj.jdbc.Driver
had some problems
it should'nt be the cause
so u thinks I should be good with just using com.mysql.cj.jdbc.Driver
how do you import your connector ? maven ?
for all version
indeed
no
multiple pools
Hey guys, I appreciate any help in this spigot forum if anyone is familiar with packets
https://www.spigotmc.org/threads/floating-item-but-its-more-like-a-flying-item-lol-how-to-fix.512287/
Hello, does anyone have an idea of how to get a SKULL_ITEM with a custom data? For example the data being VALUE from a site such as minecraft-heads.com
This is the code I am trying to fit it into:
@EventHandler
public void onInteract(PlayerInteractEvent e) {
Player player = e.getPlayer();
if (player.getItemInHand().getType() == Material.SKULL_ITEM && (
e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK))
for (String world : getConfig().getStringList("worlds")) {
if (player.getWorld().getName().equalsIgnoreCase(world))
player.performCommand(getConfig().getString("backpack"));
}
}
Game profile
and etc.
see spigotmc forum
Okay so I installed buildtools but how would I import it to my gradle project?
wdym? you did?
idk if you're asking about the actual buildtools jar or not, but buildtools is just for creating the server jars
lmao
shockbyte is amazing
apparently, if you have world directories exceeding 5gb in size, they will send you a support ticket telling respond to them in 24 hours, or they will trim the world to 5gb
ooh thast going to end well
imagine getting your production server's world fucking deleted overnight because you didn't check your support ticket section every 12 hours like a good goy
it doesn't even need to be preloaded
even without preloading my main server's map would likely be like 50gb
my preloaded world with basically nothing on it is like 3gb
and theres nothing on it, its just grass and water
(worldpainter)
with pregeneration its a bit over 100gb
nah
talking about my production server's main world
the region files are greatly shrinked
i pregenerated it at around 1.14
they've opened the same ticket about trimming the world 3 times in the last month
i might have a pregen plugin running on my test server or something
ugh a server im working on
i guess the node I'm on is running out of disk space
my $2.5/month test server uses around 350gb of disk space on the node i'm on
idk i ran buildtools on this https://www.spigotmc.org/wiki/buildtools/ and added a dependency on maven and it works im able to access NMS but how would I do it with gradle
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
are u sure you're talking in the right sizes
350gb is larger than my entire vps's allocated storage
nah impossible
i call bs xd
i have a lot of worlds
accumulated over many years
a fair bit of it is probably heap dumps as well
also
what provider allows you 350gb of disk for 2.5$ a month
im spending 28 usd on a vps that gives me 240gb ;-;
a provider that doesn't give a shit about its end users
and lets its nodes run out of resources causing its clients services to crash
in other words, shockbyte
uh, i think you need the craftbukkit jar, but I dont use nms so dont quote me
they've been getting better about it over time
like, now they actually apply some sort of limits to their clients
before, you could allocate just about as much disk space as you wanted
You need to depend on spigot not spigot api to use nms
cant you use reflection (if your not on java 16)?
Well you could
tbh i never used nms tho
Importing NMS still helps with class names etc
probs methods aswell?
compileOnly 'org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT'
?
arent most of the method names tho like a and b or is that just the obfuscation ?
nah i think you would have to import a file from disk
idk tho
any idea how to make an entity intangible?
also what do you mean intangible
that's a lot of fun, when using a vpn spigot will not load any images
your question is intangible
as in, will not collide with other blocks
or entities
blocks would be a good start tho
for entities, you can set setCollidable or whatever it's called to false
however, both entities have to have it set to false
for blocks, you can't
i'm not sure if you can even with nms
hm
i hate that when spigot doesnt load cuz its doing the verifying thing idk the wayback machine popup shows XD
you can not using nms if you're willing to do fun tricks
is there some way i can put an entity on a Vex?
set ai to false then teleport the entity around
yes, set it as a passenger
make the vex invis but have the other entity ride it
then you can have it wherever you wnat
you could also use protocol fucknuggetry to disguise the vex as something else
true
hrm
the only other issue is
i want to do it with fallingblocks
i'll take a video and show you guys what im currently doing
falling blocks are very tangible
the issue with teleporting a noai entity around is that it won't receive the clientside physics simulation that regular entities get
that's the prob bob
falling blocks doesnt even have collision?
which can make it look choppy if you have a little more latency than usual
are you implying that mc doesn't look choppy with normal connections the second physics are involved?
it looks choppy on singleplayer...
yes, imagine what it looks like when it gets even worse
Minecraft:
Friendship ended with Physics
Jank is my new best friend
qait
i can tupload files
god damnit
where do i host
AHGH
also
ignore the zombie
he's my vex test
upload it to a different discord and link it here
and ignore the sick tunes
see how they kinda
gut slurrped out
of the hole
at some points
that's because they get caught on blocks
i dont want that
just grabbing all blocks around a point, replacing them with falling block entities, and sending them to their relative position for where my cursor originally selected
(so i change angular coordinates with respect to myself)
yup
how are you 'sending' them to the relative position
just giving them a velocity to it that's proportional to the distance between the two points
teleport them instead
falling blocks afaik don't have clientside simulation for the physics that pushes them out of occupied blocks
so teleporting them via either teleport or relative entity move packets will probably have the desired effect
how difficult would it be to modify world gen to place a block randomly underground, I've heard some horror stories dealing with terrain gen with bukkit api
it will also make the thing snappier, making it not lag as far behind your moving cursor
the client will still interpolate the before and after positions of the teleport/relative move, making it look smooth
you can start with the simple entity::teleport api method and if that doesn't have the desired effect, you can try sending relative move packets via f.e protocollib
define shittily
like the teleport takes 1+ seconds to happen
instead of being every tick
or maybe it is teleporting a bunch and the client isn't showing it
mm, can you take a video and show relevant code
there may be something you overlooked
for (int i = 0; i<blocklistsize; i++) {
metatarget = currenttarget.clone();
metatarget.add(xoffset.get(i), yoffset.get(i), zoffset.get(i));
tovector = (metatarget.toVector().subtract((blocklist.get(i).getLocation().toVector())));
//blocklist.get(i).setVelocity(tovector.multiply(0.25-(0.08*(1/((0.07*tovector.length())+1)))));
//blocklist.get(i).teleport(blocklist.get(i).getLocation().add(blocklist.get(i).getVelocity()));
blocklist.get(i).teleport(blocklist.get(i).getLocation().add(tovector.multiply(0.25-(0.08*(1/((0.07*tovector.length())+1))))));
}```
afaik it should work fine as people have done all sorts of moving structures by doing that with falling blocks
Every bucketrunnable tick that happens
the current target is just where you are looking at
that looks next to illegible
the offsets are just the relative x/y/z offsets from the center for the blocks
metatarget.add(xoffset.get(i), yoffset.get(i), zoffset.get(i));
why is anything past this point necessary
other than a teleport call using the resulting location/vector
Can someone make a plugin for me tbst makes easter eggs so that u right click on the egg that u get rhe egg counter up till u have all and then if u have all that u get a price. Can someone script this for me?
assuming currenttarget is the center of where you're looking at, currenttarget + offset should be the absolute target location of the falling block
That isnt hard for a scripter right?
the thing is
i don't want it to instantly snap to that position
i want there to be a tiny bit of lag, because that makes it have more oomph
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
^^
that should be handled by the client, maybe
Ye no but i want it free
the client does some interpolation aka lag for teleport calls as well
lets see how it looks
but depending on what you want it might not be enough
There everybody is probably already in use or i have to pay 20$ for thag dumb simple plugin
Still ask it there
This is not the right place
if you want to increase the lag, you will want to make the center location itself lag behind'
not the falling blocks themselves
Ok
as calculating the lag for each block individually may result in desynchronizing the shape
and is a redundant computation
you can for example take the current location, add the target location, and divide by 2
to get the middle
and teleport it to the middle each tick
progressively moving closer to the target and slowing down
however, that will result in the blocks not actually 'lagging' behind, technically
they will instead find the fastest route to where you're looking at currently
if you want them to actually lag behind, you need to store and rotate a list of f.e the last 20 target locations
this is so bad
i'm pretty sure that interpolation doesn't work unless you have a velocity set
all entities do
like I mentioned before, people have made like windmills and trains and shit by teleporting falling blocks around
so it sould be possible to do this too
yes, assuming he is doing the code properly, the plugin should be teleporting the falling blocks each tick
however apparently they only move only very intermittently
so he doesn't have enough locations to move the blocks fluent
assuming it does fire every tick, he should
try to get a line for each block between the old and the new cursor location and teleport the blocks along the list
easy way to find out, though; sysout the target coordinate with each iteration
very intermittently as in every 1.5 seconds
rather than 20 times a second
see the linked video
how can I register a block populator for a world without making my own custom chunk gen? world.getPopulators().add won't work because the world doesn't exist yet
a decade ago someone suggested WorldInitEvent, maybe that still works
You can always make your plugin load post world
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
</dependency>
```Ok so I added this dependency and it works now
for maven idk about gradle
quick question. how many lines can you fit in an actionbar?
one, I would think
If it works with maven it works with gradle
This
I can't seem to get it to work with gradle
Did you forget mavenLocal() as a repository
nope
Could you send your build.gradle
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'java'
}
group = 'me.elexation'
version = '1.0'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
mavenLocal()
maven {
name = 'spigotmc-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT'
}
processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
}
π
how do you send a blank message
heyy bros
so i stubbed my toe
how do i unstub it
is there a way
like
shove a drumstick up my ass
cant u just send a space?
no
where are the pseudo mods when you need them
oh you mean in discord...
@wraith rapids sorry man, dunno honestly
it sort of works with vexes using blocks as ridable passengers, tho
that's a lot of entities though
did you try the relative move packets
wtf XD
i don't know how those work
oh yeah i remember someone once told me that you had the 1.8 spigot discord
very simple
can you privately message me some code snippets for them?
hook up to protocollib
i have to mow the lawn
then create a relative move packet
with the values you need
and then you send it
β
β
βuh
i don't have any browsers running rn
google "protocollib spigot" and you'll find a bunch of threads about people asking help with it
i really gotta go tho
β
see u soon
myeah, nonstandard whitespace works
some whitespaces dont work
zero widthspace works tho
β
π¨π»βπ <-- what is this XD
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
hmm
a message consisting of 2000 zero width whitespaces
βββββββββββββββββββββ ββββββββ
you cant even paste more than one of these
Its possible make a entity visible only for certain players ?
β
yes, but it involves protocol fucknuggetry
and yes you can paste more than one
they are just zero width so it doesn't look like it's doing anything
zero width whitespaces
but when do you use it?
probably for encoding child porn in otherwise normal messages, idk
Bruh
β
if a method exists that hides something, it will be used to hide child porn
for example, the old golden winrar + image merger trick
i think the zero width whitespace is the only whitespace u can use to make a message look like it has no content in discord XD
it used to ship a lot of CP on 4ch back in ye olden days
"i used to"
you cant even select the content of the message in discord when it has a zero width whitespace XD without using ctrl a
triple click?
tried
quintuple click
didnt work
β
dev_mode:
enable: 'false'
dev_name: ElgarL``` elgar what are you doing in my config
That would be a Towny config
lul
why is ur name in there
if enabled it spams the crap out of the named dev with every debug message Towny produces.
what if there are multiple devs π
w h y
do you not have expandability in mind smh
dev_name: -|
- ElgarL
- gecko10000
zero bus factor resistance
lol
the code only supports a single dev
only a single dev supports the code
le single-string list
it was a joke
# Used when two players have no special relationship.```
lol
Can I send data between servers
yaml only has single line comments :(
Not on bungee
Yes you can
requests?
Websockets or packets/requests
lol
Idk - the way I kinda want it to work is one server just goes
βHey yall - got some data for youβ and hucks the data to every server who is listening
should i learn the Socket class?
the Socket class probs can do that i think?
Looks like you want websockets
How fast though
its probs depends on server location lol
^
if its close it would be pretty fast
It's fast
yep
Ok , how scalable are websockets
well you probs have like a really small delay like really small its not gonna be instant to send to localhost but its almost as instant
Very
isnt it the ServerSocket class
It can be a bit tricky to scale but there are guides
Isnβt there like a server with consumers
Cause ideally it could be any server can send data to all others
there's a shit tier socket tutorial resource on spigot
but you probably want to avoid that, as it's trash
there does exist a higher quality one somewhere else I'm sure, you just need to search for it
the principle is simple; you open a connection and throw some data through it, or you make yourself available to be connected to, and wait for data to arrive
This networking Java tutorial describes networking capabilities of the Java platform, working with URLs, sockets, datagrams, and cookies
?
if (Player.getInventory().getItemInMainHand().equals(itemManager.effectClearer)) { error Non-static method 'getInventory()' cannot be referenced from a static context
what is Player?
if your in a command ((Player)sender).getInventory().getItemInMainHand().equals(itemManager.effectClearer) but make sure you check if sender is a instanceof Player
Player is a class
getInventory is non-static: it is an instance method; you call it on an instance, an object, not a class
only static methods can be called on a class directly
ik lol
i'm not talking to you
oh
so
learn java, basically
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
:)
java.nio.channels tho
lol
anyone here ever used citizen's api?
nope
Citizens has an extensive API that can be used for making your plugins work with NPCs or even for adding a brand new character that can be attached to an NPC. Make sure you always are using an up-to-date build of the CitizensAPI to ensure that your plugin works with the latest release of Citizens.
yeah ive read through all of that, im still having issues, but i guess ill just try and figure it out xD
ah found it
apparently NPCClickEvent doesn't work, but NPCRightClickEvent does...? idk lmao
oh
"The NPCClickEvent only fires if the click type is both"
What is the default potion material?
What is the default potion type, I mean
I could get pink name rn
actually nvm
I'm using my boosts from that free nitro I got on something else
i got free nitro from that epic games thing lol
yeah same
i couldnt accept it
i have like 3 codes which i gave away one to someone idk who tho XD
Can someone tell me what the default potion is
Like if you don't set the PotionMeta
it doesnt exist in 1.13+ i think
i think its just a normal water bottle
What if I'm using under that version
splash?
yeah, it's the same for all potion kinds
i thought it was gonna be a normal water bottle?
nah, they made a specific kind for if the PotionMeta isn't set
it doesn't put out campfires
probs a water bottle
I'm using it for a GUI icon anyways so it doesn't matter too much
yum pink potion
how come you can't just set the potionmeta?
Well... the system I'm using takes a Material so...
I could change that but I don't feel like doing that rn
ah
you probs should of made it a itemstack
yeah an ItemStack is much, much better for choosing icons. You want to be able to set the name and whatever else of it.
;-;
and lore
f
i figured out how to use java enums XD
cuz i didnt know much about them
You already can
could you add a method that sets the ItemMeta of the button?
Trust me, it's fine
ok
Hey, does anyone can help me ? Here is my question: #help-development message
And yes I have already looked up for ChunkGenerator: #help-development message
It's a preset to set the name, icon type (Material), description, and cooldown of an ability item
well
More like enum parameters
yeah
Anways, is how do I generate a random double from -1 to 1?
like, it could be negative or positive
I could do ThreadLocalRandom.current().nextBoolean() ? Math.random() : -Math.random() but that's pretty sloppy
You could have an event which runs every time a new chunk is generated, and then do whatever you'd like to the chunk. It doesn't look like you can just straight up set the biome of new chunks this way, though.
I really have no clue how to overwrite the biome for a chunk
yeah
I don't think you can
editing the world file is your best bet, probably, but I don't have any advice there.
π¦ sad thnx anyway
It seems possible before 1.16
But the methods changed since 1.16
with Java 16 I cannot use the second link's method, I can to use java 11 max because the Field isn't accessible anymore after
the first link show how to list Biomes and BiomeBase, I search a way to edit the list but I only found a recent tuto for add new biomes, not remove an old one π¦
You could straight up cancel the chunk load event, but I don't think that's what you want... lol
yup indeed, It will generate a void chunk I think xD
Do you mean just being unable to use setAccessible?
I know there is BiomeReplacer, But the methods to edit the biomes list isn't in their repo: https://github.com/lulu2002/BiomeReplacer
not exactly, in fact it is the "modifiers" field which not accessible anymore
Nevermind, I just found the other github repo
You dont need to remove the final modifier if you use setAccessible
lol the event isnt cancellable
yeah, that makes sense
Hello! How to visible entity to a specific player?
whats the method to set an effect to a plaer?
packets
only way
packets and nms
Ahh
is it addPotionEffect?
there is a spigot thing to hide a player from a player
and also show a player to a player
but thats it
no entity showing and hiding :(
Sad
PotionEffect.apply(<player>)
Lmao
Yeah, this feature shouldn't not-exists
yeah i think we need it
ideas what could be the reason for this thing? i mean... it's not really a problem, it doesn't do anything but it's weird tho. some method names will lead to never used warnings
@rigid otter but to hide a entity from a player you have to send a packet to that player to despawn the entity
Really?π€ But even it work, it is not a better way like Entity#setVisible(List<Player>);
and only to that player
I was replying to someone else, sorry
if you want to actually hide a entity from a player you gotta use packets
you can kinda fake it with potion effects i guess
Okay, but I'm not good at working with Packet yet, can you tell me more precise point? I mean what packet?
if you only want to have one person see something, you can send packets to make it exist
only for them
can't you just give him the potion effect invisibility and hide the particles?
yeah but thats hiding it for everyone
what about just 1 player
isn't there Entity#setVisible(Entity) or smt?
thanks
no?
I DID IT
There are no that method
Lmao
if you want the packet its PacketPlayOutEntityDestroy
weel thnx to lulu2002 and his amazing plugin BiomeReplacer
no
Ok thanks!
and also for showing its PacketPlayOutSpawnEntityLiving
but you need nms
to use these
Yes yes, thank you!
I'm on 1.16.5
since i tested protocollib on 1.17 it broke completely
@rigid otter use protocollib it makes packets and stuff easy
1.17 changes nms
Ohh yeah
yeah i think it listens for packets and does packet stuff and other protocol related stuff
Yeeeeaah thank you, I'll try that!
PotionEffect swiftness = new PotionEffect(PotionEffectType.SPEED, 10000, 10);
does this look good?
isnt PotionEffect abstract?
or no
i dont know cuz i never used it
going off this
lul
what
Is there any method to know how long a player has been online on the server?
declaration: package: org.bukkit, interface: OfflinePlayer
use this
thats kinda buggy tho
i used it before and it got the time wrong
it said in 2060
XD
eheh it's not buggy π₯°
I successfully removed all oceans from generation
π
I replaced them with forest biome
not that i mean the getLastPlayed() method
is something like this possible in 1.8: shoot a player into the sky 50 blocks, then slow fall
ah xD didn't see
velocity ?
declaration: package: org.bukkit.entity, interface: Entity
i think you would do java Vector vect = new Vector(player.getLocation().getDirection().getX(), 50, player.getLocation().getDirection().getZ()); vect = vect.normalize(); player.setVelocity(vect); cuz thats what i saw
unless its something different
grepper said that lol
nop you will just push your player in the wrong direction I think, I didn't renember exactly how to use velocity
not in legacy
f
uh
are u really gonna have 1.8 users
its in 1.9+
slow falling
atleast i think
actually wait
i think that was something else
yeah slow falling came in 1.13+ oof
the entire server is 1.8, not in my control though sadly
teleport
is all i can think off
use math and teleport
not gonna be perfect
but it will have to do
p.sendMessage(p.getFirstPlayed() + "");
p.sendMessage(p.getLastPlayed() + "");
p.sendMessage(p.hasPlayedBefore() + "");```
u gotta convert it to string lol
if you want it as string
?
Im making a command, so if u execute the command it will give u a command block
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player){
if (command.getName().equals("cmdb")){
Player p = (Player) sender;
p.
}
}
How to fill the p.?
why do u have just a lonely p.
just for a variable ...
p.getInventory().add() I believe
what is getInventory().add() for?
Aren't you trying to give someone a command block..?
That's how you do it