#help-development
1 messages · Page 594 of 1
I still don't hold player instances anymore after some people told me it's bad pratice. Although it does not break anything (yet)
lol nah
"people" also say static is the spawn of the devil and should never be used, "people" are not smart
I mean that's true but when you should generally not save Entity instances it's a fair point to say that it's wrong to give Players a special treatment.
weak reference the player key if you are a pussy. but real men diamond hand their data till the end
how would you guys drown player?
with my hands
That's pretty boring for a God, ngl
i tried cancelling the playermove event but then the player wont go to bottom
im at a point where the most human things are the most interesting
Either give the player a downwards velocity or only cancel the move event when it's upwards
set movement speed to zero?
like this?
yes
If you want to make it a little smoother you can also get the players velocity and just change the Y
Where would I store a villager's profession and trades when transferring it to a spawn egg?
in the spawn egg's meta's PDC
I don't see persistent data containerson spawn eggs
ItemStack item = new ItemStack(Material.SOME_SPAWN_EGG);
ItemMeta meta = item.getItemMeta();
PersistentDataContainer pdc = meta.getPersistentDataContainer();
Hello, how can I change biomes foliage color (using nms ?)
tfw you accidentally fix a bug
I implemented a good solution to a problem without knowing it a few weeks ago.
well I guess I'm not complaining
how to do this
I sort of see how I fixed it but man
new String[] {"a", "a"}
oh thanks
how
?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.
i know java
then you know how to create a list/set
i don't really know but i'm pretty sure that when you don't want to modify the contents it's better for performance to use a set
Biome foliage color is controlled by the biome of the chunk. There is no way to set the color of individual blocks. Theoretically, you can change the chunk with chunk#setBiome(biome) but it’ll only change after a reload.
hey guys, I've asked how to hide player armor using protocol lib already, but I didn't get any further. I tried doing it by just writing all the stuff myself and I tried copying code from some wrapper and using it, which didn't work too. Can anybody help me with that?
my plugin is 16kb, where performance
microoptimisations 
micro fr
then, how do this exist ? https://www.spigotmc.org/resources/biomemanager-custom-biome-colors-and-effects-1-19-4-1-20-1.106419/
Storing the profession doesn't spawn the villager as that job when using the egg.
hashset or set
you can tell I've been having a good time
trying to upload an artifact update to maven central, getting this error:
Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @3c0036b
this is not my first time uploading an update to maven central, but with this particular artifact it's the first time. pom: https://pastebin.com/0ZjDuWTV
the error is given out by nexus-staging-maven-plugin:
[INFO] --- nexus-staging-maven-plugin:1.6.7:deploy (injected-nexus-deploy) @ TrUAPI ---
[INFO] Performing local staging (local stagingDirectory="G:\PROJ PLUGINS\fdev\TrUAPI\target\nexus-staging\staging")...
[INFO] + Using server credentials "ossrh" from Maven settings.
<then the error comes in>
Yummy (not really)
Here's the docs for the Set interface
https://docs.oracle.com/javase/8/docs/api/java/util/Set.html
The main point of a Set is to have a collection of unique objects within it; So you couldn't have 2 "a"'s in there.
I could be wrong, but the plugin is still just changing chunks. The thing is, in resourcepacks, (which must be used to get custom colors), different block types such as grass, trees, etc use different color maps.
you can google "how to create a set java". maybe you claim to know java well, but you need to be able to google
oh no... it's not fully fixed D:
not set, hashset
god this is so cursed
taht's not the question, the syntax in the screenshot is not even valid is it
hey
Fatal error trying to convert Chat v1.0:net/multylands/chat/listeners/Book.class
org.bukkit.plugin.AuthorNagException: No legacy enum constant for WRITABLE_BOOK. Did you forget to define a modern (1.13+) api-version in your plugin.yml?
somewhy my plugin does this ^
...
im on 1.16.5
artifact maven central failure hwelwpwe
It's storing as {"pluginName:profession": "librarian"}
private final Set<String> someSet = new HashSet<String>();
someSet.add("a");
someSet.add("a");
do i need to add everything with .add?
someSet.addAll(Arrays.asList("a", "a"))
well you could do something like:
private final Set<String> someSet = new HashSet<String>(Arrays.asList("a", "a"));
thanks
yeah and also it's not necessary to specify HashSet<String>, just do HashSet<>
Try looking into the source of this plugin https://www.spigotmc.org/resources/prodigysky.86542/
Also every HashSet is a Set, so you can still use the docs
okay thanks
ofc not, it's still a normal egg with some data. you have to listen to PlayerInteractEvent, get the data from that egg again, then spawn the villager yourself with the desired job etc
The IDE will take care of that
I am in an absolutely epic amount of muscle pain right now
F
how did you make that so big
It literally says in the YT vid it uses a resource pack
Markdown formatting ig
I tried that and the getClickedPosition() method always returns null
my ide is notepad
what?! XD
you sent 2 screenshots from intellij idea earlier
life is pain
Getting that block's position is suffocating villager if clicking on a wall (clicking on a wall with a normal spawn egg works)
i only make screenshots from intellij idea to make it preety
Good point, didn't even notice that XD
get the clicked block, then get the relative using the clickedBlockFace
`# asd``
😭
Block blockToSpawn = event.getClickedBlock().getRelative(event.getClickedBlockFace());
sth like that
btw getClickedPosition() shouldnt be null and it's not null for me
how i can rotate lit tnt to player's head rotation
so it's looking at player's face
Now running .toLocation(world) on it, the villager comletely disappears
ofc, getCLickedPosition is an offset only for that block
Hi, how to get a custom head with texture?
get the block's location and add the vector to it
Add the clicked position?
Block block = event.getClickedBlock();
Vector vector = event.getClickedPosition();
Location spawnLocation = block.getLocation().add(vector);
TNTPrimed thrownTnt = (TNTPrimed) player.getWorld().spawnEntity(player.getEyeLocation(), EntityType.PRIMED_TNT);
thrownTnt.setVelocity(player.getLocation().getDirection().normalize().multiply(FCore.GetInstance().getConfig().getDouble("throw-force")));
thrownTnt.setRotation(20, 50);
player.getInventory().getItemInMainHand().setAmount(player.getInventory().getItemInMainHand().getAmount() - 1);
``` the rotation doesn't work
It still suffocates the villager
guys, I tried printing out the packet,
PacketContainer[type=ENTITY_EQUIPMENT[class=PacketPlayOutEntityEquipment, id=85], structureModifier=StructureModifier[fieldType=class java.lang.Object, data=[com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor@646a96ae, com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor@70c4151e]]] wtf is this
wdym?
show a screenshot or video pls
looks like a normal toString() to me
like, what are those fields and how do I get anything without it erroring about that being out of bounds
fun mystery for all ages, what kind of math error causes this
seems fine to me?
nope
what's the matter
The two top ones
there's a space just over halfway up
oh
bet it's off-by-one shit
right now I'm wondering if there's some kind of rounding issue in rsps
they all get placed using the same math so if it was off by one they would all be off by one
ah
ehm
I would assume I either messed up the scaling but if that was the case I would expect it to just sort of gradually spread I think
or some rsp nonsense
Hello,
}
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
SkullMeta meta = (SkullMeta) head.getItemMeta();
meta.setOwner(texture);
head.setItemMeta(meta);
return head;
}
why i get a default head?
because "texture" is probably not a valid player name
off by 4.5 rsp units seemingly arbitrarily
may i ask what you are doing
i've seen you doing texture stuff for the past multiple weeks or something
and it is interesting but i ahve no clue what this is
he's building a bone-cube structure, duh
ah, of course
tower defense game and at the same time a plugin that manages custom models similar to modelengine but open source, gplv3 and free
I am not getting any errors but the lines on the sign is noget being setted
And my group is admin
@EventHandler
public void onChange(SignChangeEvent e) {
Player p = e.getPlayer();
if(e.getLine(0).equalsIgnoreCase("health")) {
if(isPlayerInGroup(p.getPlayer(), "admin") || isPlayerInGroup(p.getPlayer(), "h-admin")) {
e.setLine(0, "-----");
e.setLine(1, "HEALTH");
e.setLine(2, "Click here");
e.setLine(3, "-----");
}
}
if(e.getLine(0).equalsIgnoreCase("absorption")) {
if(isPlayerInGroup(p.getPlayer(), "admin") || isPlayerInGroup(p.getPlayer(), "h-admin")) {
e.setLine(0, "-----");
e.setLine(1, "ABSORPTION");
e.setLine(2, "Click here");
e.setLine(3, "-----");
}
}
}
@EventHandler
public void onInteract(PlayerInteractEvent e) {
Player player = e.getPlayer();
BlockState bs = e.getClickedBlock().getState();
if(bs instanceof Sign) {
Sign sign = (Sign) bs;
String line1 = sign.getLine(1);
if(line1.equals("ABSORPTION")) {
e.getPlayer().addPotionEffect(PotionEffectType.ABSORPTION.createEffect(999999, 4));
}else if(line1.equals("HEALTH")) {
e.getPlayer().setHealth(20);
}
}
}
}
?paste
text wall
dont you have to refresh the sign or something like that?
How do i refresh a sign?
blockState#update
Ohh..
I though it was something ingame...
btw you can do if(bs instanceof Sign sign) {
and remove the line below
I think I might have a clue
rsp model limits are -16 to 32
which is exactly where this is messing up
who is the owner
private static final UUID RANDOM_UUID = UUID.fromString("92864445-51c5-4c3b-9039-517c9927d1b4"); // We reuse the same "random" UUID all the time of this uuid? i need to past my uuid?
i want to overlay a player's skin on an image as if they are sitting down, any ideas on where to start with this?
Its not working for me
Im on java 8
why do you want java 8
Becuase this plugin is for 1.8
💀
What is wrong with that?
a lot is wrong
...
how to get the message that player typed in, but just the command, without args
String#split(" ", 1) to split message by spaces
Wait, if i use java 20 or what its called
Will it still work with these new features on 1.8?
dont run 1.8
Why?
how to get the Command with PlayerCommandPreprocessEvent
youll find out yourself
Dude, just explain
exploits, dupes
What do I do?
this will give you the first word
So you are basically saying i shouldnt play on 1.8
yeah
Yea
But these bugs and exploits can be fixed
play idk, but you def shouldnt host
who is gonna fix them
what
It depends on what kind of bugs you think
There is a bug with string, water and tripwire hooks then you can just do so you cant get tripwire hooks
who is gonna fix bugs and exploits
?1.8
Too old! (Click the link to get the exact time)
Sounds like a bad solution imo
i mean at least log4j is patched
Just drop support
Dude what the hell is this?
damn, remember playing 1.5.2
hell yeah
im pretty sure mojang backported it
something interesting :```java
public class BiomeBaseWrapper_1_17R1 implements Biome {
private String fogColor, waterColor, waterFogColor, skyColor;
private String grassColor,foliageColor;
@Override
public BiomeBase build(String fogColor, String waterColor, String waterFogColor, String skyColor) {
return build(fogColor,waterColor,waterFogColor,skyColor,null,null);
}
@Override
public BiomeBase build(String fogColor, String waterColor, String waterFogColor, String skyColor,String grassColor, String foliageColor) {
this.fogColor = fogColor;
this.waterColor = waterColor;
this.waterFogColor = waterFogColor;
this.skyColor = skyColor;
this.grassColor = grassColor;
this.foliageColor = foliageColor;
return build();
}
public BiomeBase build() {
//void generation
BiomeSettingsGeneration.a gen = (new BiomeSettingsGeneration.a()).a(WorldGenSurfaceComposites.p);
gen.a(WorldGenStage.Decoration.j, BiomeDecoratorGroups.W);
BiomeFog.a biomeFogCodec = new BiomeFog.a()
.a(Integer.parseInt(fogColor, 16)) //fog color
.b(Integer.parseInt(waterColor, 16)) //water color
.c(Integer.parseInt(waterFogColor, 16)) //water fog color
.d(Integer.parseInt(skyColor, 16)); //skycolor
//.e() //foliage color (leaves, fines and more)
//.f() //grass blocks color
//.a(BiomeParticle)
//a(Music)
if(foliageColor != null)
biomeFogCodec.e(Integer.parseInt(foliageColor, 16));
if(grassColor != null)
biomeFogCodec.f(Integer.parseInt(grassColor, 16));
return new BiomeBase.a()
.a(BiomeBase.Precipitation.a) //none
.a(BiomeBase.Geography.a) //none
.a(0F) //depth ocean or not // var3 ? -1.8F : -1.0F
.b(0F) //scale Lower values produce flatter terrain
.c(0F) //temperature
.d(0F) //maybe important, foliage and grass color
.a(biomeFogCodec.a()) //biomefog
.a(BiomeSettingsMobs.c) //same as void biome
.a(gen.a()) //same as void biome
.a();
}
}```
mmm i love obfuscated code
Like they did the game icon
But why dosent the lines on the sign not get updated?
@EventHandler
public void onChange(SignChangeEvent e) {
Player p = e.getPlayer();
if(e.getLine(0).equalsIgnoreCase("health")) {
if(isPlayerInGroup(p.getPlayer(), "admin") || isPlayerInGroup(p.getPlayer(), "h-admin")) {
e.setLine(0, "-----");
e.setLine(1, "HEALTH");
e.setLine(2, "Click here");
e.setLine(3, "-----");
e.getBlock().getState().update();
}
}
if(e.getLine(0).equalsIgnoreCase("absorption")) {
if(isPlayerInGroup(p.getPlayer(), "admin") || isPlayerInGroup(p.getPlayer(), "h-admin")) {
p.sendMessage("ewadad");
e.setLine(0, "&8&m---------------------------");
e.setLine(1, "ABSORPTION");
e.setLine(2, "Click here");
e.setLine(3, "&8&m---------------------------");
e.getBlock().getState().update();
}
}
}
@EventHandler
public void onInteract(PlayerInteractEvent e) {
Player player = e.getPlayer();
BlockState bs = e.getClickedBlock().getState();
if(bs instanceof Sign) {
Sign sign = (Sign) bs;
String line1 = sign.getLine(1);
if(line1.equals("ABSORPTION")) {
e.getPlayer().addPotionEffect(PotionEffectType.ABSORPTION.createEffect(999999, 4));
}else if(line1.equals("HEALTH")) {
e.getPlayer().setHealth(20);
}
}
}
}
idk
worked fine for me on newest versions
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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Is it possible in 1.20.1 to save itemstack with 100% of their data (PDC, nbt, etc) through restarts?
serialize
Itemstacks are serializable ?
hello, how can I get a biome temperature with nms ? (or spigot)
yea ofc
Block#getTemperature()
What
okay thanks
how i can hide commands with tab
so players cant tab them to see everything
and just see the commands that i want them to see
Do I need to make a new class for every custom command?
yea
rr, thanks
well, you can do one command for everything, like: /cmd fly (the rest of the command), /cmd gm (the rest of the command)
but not recommendetd
im back lmfao, how do i shade mongodb into a plugin?
a strange situation, but how to get players who are under the sun is more optimized than each time checking in which world the players are and whether the block is on top
how do i shade mongodb into a plugin?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>shade</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactSet>
<includes>
<include>org.mongodb:mongo-java-driver</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.mongodb</pattern>
<shadedPattern>my.package.xxx.mongodb</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>```
im stuck on shadedPattern
Hello, how can I use two versions of nms ? Here is my pom.xml :```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.paulem.alot</groupId>
<artifactId>ALOT-maven</artifactId>
<version>1.0-SNAPSHOT</version>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</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</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.realityforge.org.jetbrains.annotations</groupId>
<artifactId>org.jetbrains.annotations</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>```
use modules
how ?
i want to overlay a player's skin on an image as if they are sitting down, any ideas on where to start with this?
a strange situation, but how to get players who are under the sun is more optimized than each time checking in which world the players are and whether the block is on top
Just look at the logic behind skeletons
how can I use modules please ? I tried using it doesn't consider my plugin as a java project
apparently this uses the natural block light and compares to the sun
Hey I've had a question. How do I make a chart.js webserver line graph into my plugin
?
well~ I found... It's working 
how can I create a text like this up a LivingEntity (without using displayName)
armor stand probably
what?? were you find this
nms
i not can find
@echo basalt
take a look at this: https://github.com/JEFF-Media-GbR/JeffLib
basically you need one "core" module where you got your interface, that all NMS modules implement
modules
then you create one module per NMS version, each depends on your core module
and then you create one "dist" module that shades all the other modules (both core, and the NMS ones)
you then add the remapping stuff only to the NMS modules
how can i turn off collision ONLY for a mob? i tried entity.setCollidable(false); - doesn't work, tried to add it to Scoreboard Team with collision disabled - doesn't work
in your core module you then have something like "getNmsHandler()" or sth that returns your NMS interface, and you create that instance through reflection - because ofc core cannot depend on the individual NMS modules because they already depend on the core
what the heck is this and why did I write it lol
An array of something that has a toString() method it seems
what did you call to get the output?
Itemlist
Itemlist? tf
I mean you can check by hovering over packet.getModifier().read(i) (hover over the read part)
Should have a type
anybody knows?
Hello Guys !
I'm working on a project rn, and i need a bit of help. Let me give some context :
I have a command, that toggle fly for a player. When he executes it, a 10 secondes timer start. If the timer ends, the fly is disabled. If he re uses the command while the timer isnt finished, the fly is disabled too.
So this is working well.
And now, i want to add some particles around the player while he is flying (while the timer is running)
But my timer is working on a BukkitRunnable, that runs every 20ticks. And i want the particles to be "continuous", more like every 5 ticks (or less). But i cant find a way to make two runnable, that i can stop by hand (with the player do again the command, or when the timer end).
The timer runnable is stopping well, but i cant make the one for the particles work, and also stop it.
I hope someone can help me (working on 1.19.3)
Here is the code :
if (cmd.getName().equalsIgnoreCase("trp")){
type = TypeTransplanageDAO.getType(player.getUniqueId().toString());
if (type == null) {
TypeTransplanageDAO.createType(player);
type = TypeTransplanageDAO.getType(player.getUniqueId().toString());
}
String permission = "trp." + type.toLowerCase();
if (!player.hasPermission(permission)) {
player.sendMessage(ChatColor.RED + "Vous n'avez pas la permission d'effectuer ce type de transplanage.");
return true;
}
if (timers.containsKey(player)) {
BukkitRunnable task = tasks.get(player);
if (task != null) {
task.cancel();
}
timers.remove(player);
player.setAllowFlight(false);
player.setFlying(false);
} else {
timers.put(player, temps);
player.setAllowFlight(true);
player.setFlying(true);
player.spawnParticle(Particle.CLOUD, player.getLocation(), 100, 0.5, 0.5, 0.5, 0.1);
BukkitRunnable task = new BukkitRunnable() {
@Override
public void run() {
int time = timers.get(player);
if (time > 0) {
timers.put(player, time - 1);
sendActionBar(player, ChatColor.GREEN + "" + time);
} else {
cancel();
timers.remove(player);
player.setAllowFlight(false);
player.setFlying(false);
}
}
};
tasks.put(player, task);
task.runTaskTimer(Transplanage.getPlugin(), 0, 20); // Exécuter la tâche toutes les secondes (20 ticks)
}
return true;
}
Well you can't. Both sides have to have collisions turned off in order to not collide
hmm, can I get the actual entity object by using that entity id?
i want to overlay a player s skin on an
This is how you get items
As for this I'd probably just loop through them all
Although ProtocolLib has a util
and it's called?
how do I find the world out ._.
that's an infinite loop then
need to get player from entity id -> get entity from id -> requires world -> need player to get world of the player -> need to get player from entity id
is there a way to "unregister" an event?
haha breaking everybody with armor go brr (I know how to solve that, don't worry)
i want to unregister the event after the player has closed the GUI
i use the template from spigotmc article about guis
anyone there?
helloooooooooooooo
imagine having patience
i waited like 10 minutes
omg 10 whole minutes
nothing useful there
X
Can I read block data async? And do I have to use Bukkit.getScheduler().runTaskAsynchronously or can I also use java threads?
You should use ChunkSnapshots if you plan on reading large areas async
Do keep in mind they should be created sync and read async
How is the best way to keep a player with full healt and hunger
How do i set the players held items durability to max?
Guess it's just listening to damage and hunger events.
I dont why this dosent work and i dont even get the test111 message
} else if (line0.equals("SHOP")) {
if (line1.equals("Click here")) {
if (line2.equals("To open shop")) {
if (line3.equals("")) {
e.getPlayer().sendMessage("test111");
if (e.getPlayer().getWorld().getName().equalsIgnoreCase("A")) {
e.getPlayer().sendMessage("A");
new VagtshopA().open(e.getPlayer());
} else if (e.getPlayer().getWorld().getName().equalsIgnoreCase("B")) {
e.getPlayer().sendMessage("B");
new VagtshopB().open(e.getPlayer());
} else if (e.getPlayer().getWorld().getName().equalsIgnoreCase("C")) {
e.getPlayer().sendMessage("C");
new VagtshopC().open(e.getPlayer());
}
}
}
}
}
wtf
What?
Based on the code snippet provided, it seems that the conditions are nested, and in order for the "test111" message to be displayed, all the conditions need to be met. Here's a breakdown of the conditions:
- The value of
line0should be equal to "SHOP". - The value of
line1should be equal to "Click here". - The value of
line2should be equal to "To open shop". - The value of
line3should be an empty string.
If any of these conditions are not met, the code inside the nested conditions will not be executed, and you won't see the "test111" message.
To debug the issue, you can check the values of line0, line1, line2, and line3 to ensure they match the expected values. Additionally, you can add some debug statements to check if the code inside each if condition is being executed. For example, you can add System.out.println("Condition 1"); before the first if statement, and similarly for the other conditions.
Here's an example of how you can modify the code to include debug statements:
} else if (line0.equals("SHOP")) {
System.out.println("Condition 1");
if (line1.equals("Click here")) {
System.out.println("Condition 2");
if (line2.equals("To open shop")) {
System.out.println("Condition 3");
if (line3.equals("")) {
System.out.println("Condition 4");
e.getPlayer().sendMessage("test111");
if (e.getPlayer().getWorld().getName().equalsIgnoreCase("A")) {
e.getPlayer().sendMessage("A");
new VagtshopA().open(e.getPlayer());
} else if (e.getPlayer().getWorld().getName().equalsIgnoreCase("B")) {
e.getPlayer().sendMessage("B");
new VagtshopB().open(e.getPlayer());
} else if (e.getPlayer().getWorld().getName().equalsIgnoreCase("C")) {
e.getPlayer().sendMessage("C");
new VagtshopC().open(e.getPlayer());
}
}
}
}
}
By checking the debug statements in your console or log files, you can determine which condition is not being met and investigate the issue further.
Okay, its sends Condition 2 and then stops
Idk if it could do anything but orginal the text is danish i just translated it to english so people can read it
And at line 2 there stands "Åbne butikken" can the letter "å" have anything to do with it?
probably maybe and probably not
I wonder how I should do stuff when I don't have access to that mojang Pair class, maybe I'm just a lil too not understanding this
reflection do be good
Its not
I have just tried to change it to open and that didnt work
Hello, i want make an automatique message send with intervalle per player
So i make a bukkit runable in player joinevent ?
Or just a function in player join event ?
I would recommend you just add the player to a map in the player join event and then use a single scheduler that iterates over the map
And use a bukkit runable ?
Yes
to put it mildly, the only usefulness of bukkit runable is to execute actions with intervals?
What is the right way to add itemflags to the itemmeta
This is what i use and it doesnt seem to be working
meta.getItemFlags().add(ItemFlag.FLAG);
for more personal needs, I preferred to do an interval function on each player who joins (event join) is it a good thing?
Well having one scheduler player will definitly hurt performance more than having a single one. What are your "personal needs" except that it is easier?
Do you set the meta back on the item?
Yes
But theres still things like:
When on main hand:
+10 attack damage
And things like that
Does it show it ingame and just does not apply it? Or isn't it shown at all?
because when a player joins I would like to wait 15 min before sending him the first msg but if everyone has the same interval it is not possible. is it really terrible for performance?
The itemflag doesnt affect anything ingame
ItemMeta meta = this.item.getItemMeta();
if (meta != null) {
meta.setDisplayName(name);
meta.setLore(lore);
meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
this.item.setItemMeta(meta);
}
This is the only ItemFlag I worked with so far and that worked flawlessly
They really should do smth about that name
oh so it shows but it does not work? Well. Idk how those are applied
It's really bad, yes
Oh u use addItemFlags
I think you want tell that at me ?
no I was responding to Olivo
Maybe save a number like : minutesOnServer on the PDC and each minute check and add every players minute on server
That's why you store the timestamp in the Map and then you can have a single scheduler and still have different intervals for each player
Wrong reply
I meant to reply u
How ?
@sterile breach try this
No
If you loop 15 minutes, a player that joins the server the second before the 15 minutes will be able to talk
to know if a player wants to receive the messages, I have an info on him stored in the database, my idde would be the following
when a player joins, I make an sql query to find out if sibil wants to receive them, if so, I add him to an array that contains his name and the join time, every minute, I check if in the array a player corresponds to the current temod, if so I send him the message, is this a good approach to not have a performance problem?
Is not a talk permission, simple automatique broadcast
If by array you mean map, then yes that's fine
basically if you want to send a message every 15 minutes you want to store either the last or the next message time and compare accordingly. Once you sent a message you update the time
On join you simply set the join time or jointime+15minutes - depending on how you are comparing the times
on the other hand, how to do, if I store the time in ms, and that I check every minute, I have almost no chance of falling exactly on the moment when it joined + 15 min in ms how to do?
don't do an exact comparison. Use <= or >=
If that's critical then run your scheduler every second
Even if that doesnt happen and the player joins like 5 minutes before the 15 min check he will be sent a message or granted a feature or whatever 5 minutes earlier
No with the map méthode
and I make a gap of 1 min?
The if-statement will be the same
Ah yes if <= 15 MS
if (storedTime + 15minutes <= currentTime) {
// send message
// store currentTime
}
To do that, i add a bukkit runable at
Onenable ?
yes
And loop all players Evry minutes is not a problem for performances ?
Okay
the server does, too
ofc
If theres more than 150 or something, you might wanna do it async or exclude players like the staff team from the check. But even if it is a lot its gonna be like 0.05ms of lag each minute so its not a big problem
0.05ms is not lag. Lag only starts if you exceed the 50ms/tick
If I did a spigot plugin will it work with on paper server that is connected to bungeecord proxy?
yes
Okay thanks
Okay, i use bukkit runable or scheluder? What is the différences?
Bro when I try to set ItemStack with pdc to yaml, YamlConfiguration fails.💀
And gives unclear Exeptions
There ain't that much of a difference. BukkitRunnable got some more methods like cancelling itself. Just use a BukkitRunnable
Canceling itself is so op
I need to use it in onEnable ? Or i can add it in commands ?
You can use it wherever
Also, how would I split my plugin in half, cuz I made my plugin with things that were meant to be on the other server with other plugin, and my plugin contains like fly, gm etc. And also kits, anti-logout, and how would I split it so it's two different plugins, both of these things contains functions, references to the fly, gm section
How would i disable players from moving a specific item in the 8th slot in their inventory? I have tried cancelling the event but unfortuantely the players end up duplicating the item
What is pair? Where does it come from?
Pair is from NMS
I think you can't duplicate things
Try to drop the "duplicated" item and see if it drops or if it disappears
Test it in deop and survival
Is it like net.minecraft.server?
yup, creative was the issue tysm
Someone have an exemple/doc to see how to use bukkit runable méthode
?scheduling
new BukkitRunnable() {
@Override
public void run() {
//methods
cancel();
}
}.runTaskTimer(plugin, 1, 1);
//supports lambda expressions, does not allow for internal cancelling, but can be cancelled by storing the task ID.
Bukkit.getScheduler().sheduleSyncRepeatingTask(plugin, new Runnable() {
@Override
public void run() {
//methods
}
}, 1, 1);
//with lambda
Bukkit.getScheduler().runTaskLater(plugin, () -> //method(s), 1);
How would i disable it in creative too?
Try deoping urself
Can't. Creative mode doesn't have good packets.
Looks like you need to read that scheduling wiki. You can do internal cancelling
Wdym I copied that from wiki
scheduler.runTaskTimer(plugin, task -> {
if (Bukkit.getOnlinePlayers().isEmpty()) {
task.cancel(); // <--
return;
}
Bukkit.broadcastMessage("Mooooo again!");
}, 0L, 20L * 60L);
Taken from wiki ^^
Took from other wiki then, also mine has canceling too
supports lambda expressions, does not allow for internal cancelling, but can be cancelled by storing the task ID.
Was talking about that comment
Ohhh
Also the method you were using there is explicitly stated in the wiki to not be used
Oh mb
Also, is it better to run one bukkit runnable and just loop through a list of people and update the boss bar or just run a task for every person but after some event or under some condition cancel it??
Easier or better performance??
Both
Oh, well then I need to redo my code
On the PlayerInteractEntityEvent, how would I get the entity's spawn egg?
How a task is executed if i don't set time?
I don't think we have a method to go from entity to spawn egg
Hi, how can eh assign a skin on a bungee cord plugin?
You would have to make your own map
For every single entity???
yes
or use nms
What would cause a PDC key and value not to save? When a player leaves the game 3 values are changed back to false. or they are removed, it alternates.
Or you might be able to do some fancy string manipulation
NMS could be more useful since it allows for saving exact nbt data
True
It does depend on what you want though
Well MUSHROOM_COW and MOOSHROOM_COW_SPAWN_EGG have different names for the cow for some reason
The entity's namespaced key or the type?
So something like type.getKey().toString()?
type.getKey.getKey should be what you want
is the key a string like VILLAGER
Hey, how can eh assign a skin on a bungee cord plugin?
Print the value
Do I need to set it to uppercase?
@flint coyote , question, i stock my player in normal map or i use "cooldownmanager"?
You are adding _spawn_egg to it I assune?
yes
hey, is there an event for activating the portal frame?
And using material.matchMaterial?
_SPAWN_EGG
Oh I was doing .getMaterial()
I did something similar
there are oly a few entities that you have to manually adjust
in my case there were also spawn eggs for the golems , dragon and wither, but I think those are in the actual games now
and then I just checked if the entity type was a mooshroom and if so converted the name manually
its not taht big of a deal
mooshroom should work fine
and its way better than mapping every entity yourself
I think it works without manually set entities
name one you would usually need to change
wdym
An entity
well like I said mooshroom is the only one I found
because like you say, the spawn egg material is spelled differently from the entity type
Oh, I got mooshroom working without manual checks
This is why you use the namespaced key instead of the enum name
o.o
What do you mean by cooldown manager? You can put the map anywhere. That depends on your knowledge and programming style
Frost on mushrooms
can i retrieve from HangingPlaceEvent the entity on which lead placed on?
yes there is #getEntity
wait, lead? Isn't that event for paintings and maybe itemframes?
yes
What would cause a PDC key and value not to save? When a player leaves the game 3 values are changed back to false. or they are removed, it alternates.
never heard of that
mistake, using other event, sorry
with no context, it sounds like you just remove them when the player quits the game
how and when do you add the tags
tags get added when the player first joins. they are set to false. when a player creates the double jump book, it turns to true. ( when they right click ). when they leave, they either get set back to false or they just disappear. I set them like this.
playerData.set(new NamespacedKey(Overhaul_Systems.getPlugin(), "DoubleJump"), PersistentDataType.BOOLEAN, false);
playerData.set(new NamespacedKey(Overhaul_Systems.getPlugin(), "OverSaturation"), PersistentDataType.BOOLEAN, false);
playerData.set(new NamespacedKey(Overhaul_Systems.getPlugin(), "Healthy"), PersistentDataType.BOOLEAN, false);
is there a way to retrieve block from PlayerLeashEntityEvent?
Why do you create a new NamespacedKey each time?
That event is fired when you add a leash to an entity, not to a block
who
I dont remember this was a long time ago.
u can create only one in plugin's main for example and then use it everywhere
upd: u need do it cuz everytime u create new same namespaced key
Well unless you need multiple instances it does not make sense to create them multiple times. Create a single instance and use that.
Could be that this is the reason your values go missing
why would it only be these 3 tho? it would be all of them no? I write them all the same, and I have like 20.
I'd expect it to be all of them, yes
If it works for others and fails on those you should doublecheck if there's any difference in setting/obtaining them
public class Main {
private NamespacedKey key;
public void onEnable() {
key = new NamespacedKey(bla bla bla);
}
public NamespacedKey getKey() {
return key;
}
}
thats simple like this
Well if he got 20 keys I'd suggest using a class to handle all of them.
Therefore also setting and retrieving values for them
ye
So all my keys I should put into a class, and get them that way?
its just an example for better thing
Could create something like a "PDCManager" interface and implement it in a "PlayerPDCManager". Then declare your keys there and add functions to set/retrieve values based on the player parameter
That's also going to be a lot of changes. Like a good hour or 2 of work.
Also create an enum for the names of your keys in there
Sure is but it's pretty clean
That don't sound to bad.
is #getEntity returns really entity who being leashed?
declaration: package: org.bukkit.event.entity, class: PlayerLeashEntityEvent
Yeah, it doesnt help that im also still learning java, even after the few years ive been doing this. I just redid my 4 plugins over the past 4 days removing all the static methods and doing it properly
hm strange, mine seems to not works
I mean the best part about programming is that you never know everything
Would be boring to not learn something new every once in a while
which is also the worst part
I mean you always have new modules.
or other packages.
modules and packages arent really teher to learn though
they just make things complicated
Well yeah if you feel like updating your old projects it is - by the time you made the update you learned something else again
itw more about the concepts and structure behind them
yes, I just exited refactor hell but now I can easily create new features with little sweat again
so thats nice
Welp, I have a lot of work to go do now lol.
That's the spirit
but anyways, thats likely not even your actual problem toast
come again?
but I guess you will get to that once you made a proper structure xD
save me time of work ?
no I meant the keys dissapearing
Ofc it is not. I expect he sets/obtains them differently. So cleaning it up will probably get rid of that problem aswell
yeah likely
it may well be a side effect of something
I mean thats all of code
but you know what I mean
idk what it could be. it was working before. like i created this almost 2 months ago. Never touched it again because there was no need it worked. then it jsut stopped for some reason.
Steaf you gonna rename once you turn 24 years old?
Because I was named Fabsi23 for years aswell. Did not exactly change it this year though. Was probably with 22 or 23
its just some numbers after my name since my usual tag was taken ofc
and spigot server forces me to use my spigot username
lol nice
yeah I get that. I was also named Fabsi23 on spigot though
still shows it on my profile
i dont remember why i went for the 23 though
I do
then how are you not named that in discord?
oh i see
Fabsi was also taken once I was allowed to namechange on discord
So now I'm Fabsi_ here and _Fabsi on MC
This isn't me asking for help, I'd like to report some documentation I think is a bit misleading but not sure where this would be best suited. The documentation for the BlockDropItemEvent says
This event will also be called if the player breaks a multi block structure, for example a torch on top of a stone. Both items will have an event call.
Which to me implies that each item will have a separate event call each, but actually means both items will have a single event call between them. This might just be me, but if this anyone else would read it the same way I think this should maybe be clarified
Though I feel like it would make more sense for them to be separate event calls, I don't really understand why they're grouped together, so maybe this isn't a documentation issue but actually an implementation issue
Hey, quick question, can I hide the 'Ingredients' and 'AppliesTo' in a netherite upgrade smithing template? if so, which flags would I need to hide?
Probably HIDE POTION EFFECTS
^^
Apologies if stupid question, is there an equivalent for https://github.com/PaperMC/Paper/pull/9388 in bukkit/is one planned? Somewhat surprised more people haven't run into this
Since I'm gonna have to handle multi-block structures myself, is there a method that returns all blocks part of a multi-block structure stemming from a given block? For example, any signs or torches attached to a block or any part of a chorus "tree" above a chorus stem?
Gotta love how the moment I look at the PR the PR gets renamed
is there a place to more formally request API additions like this?
I’m sure something like that could be implemented
Although it also shouldn’t be hard to do yourself
?jira
yeah, a matter of time more than anything else - trying to get CoreProtect updated for 1.20 and wasn't expecting to hit this as a tangent amongst everything else I need to look at!
Actually the code was easier to write than I thought. Of course, if there's a built-in method for it that would be preferred, but I think something like this should work (haven't managed to test it yet, though)java final Set<Block> pastBlocks = new HashSet<>(); final List<Block> pendingBlocks = new ArrayList<>(); pastBlocks.add(event.getBlock()); pendingBlocks.add(event.getBlock()); while (!pendingBlocks.isEmpty()) { final Block block = pendingBlocks.remove(0); for (BlockFace face : BlockFace.values()) { final Block adjacentBlock = block.getRelative(face.getOppositeFace()); if (pastBlocks.add(adjacentBlock)) { if (adjacentBlock instanceof Attachable attachable && attachable.getAttachedFace() == face) { pendingBlocks.add(block); // Do something with the attached block } } } }
Anyone know of a good way to get the position (The head position, body position, and feet position) of an npc in the sleeping pose? The npc's hitbox seems to have shrunk to it's feet, so I want to try and create an artificial bounding box using slimes.
I've never even thought about the fact that you can have NPCs sleeping, why is that so strange to me, like NPCs are just fake players I shouldn't be surprised that they can do player things lol
yeah but for some reason, unlike players there hitbox seems to shrink when they are in that position, which makes no sense to me 🤷♂️
player's hitbox shrink too wdym
Ye that's strange, as far as the server knows there is no difference between a player and an NPC other than that one isn't actually logged in, so it must be something to do with the way you're putting the NPC in the sleeping position
Orrr that lol
also fun fact... you can put wardens in sleeping pose but none of the others, looks kinda funny
https://bugs.mojang.com/browse/MC-10919 Oh looks like it's actually a bug reported in 2013 😭
i mean, mojang kinda coded it that way
feature
hmm
anyway around the small hitbox's, to my knowledge using slimes or armorstands seems to be what everyone is doing. But the position of the entities are so annoying (especially with the npc turning ever so slightly)
oh no im gonna be banned by mojang for encouraging violence
this was what they meant by bed pvp i pretty sure
Might as well just disable all PVP on Spigot servers, just to make sure it doesn't give a bad impression to the kids 🙏
hmm, what're you trying to achieve?
Making a some what artificial bounding box by placing the entities on top of the npc
seems to be the best way I could find
Unless I use raytraing 😒
ah... yeah well that's gonna be a bit wonky no matter what, because of lag and such
i mean you can place interact entities as passengers, but that has limits in terms of hitbox placement
yeah already tried something like that
it's also buggy as heck... you have to resend metadata to force offset to take effect when you have an interact entity as a passenger on another...
I mean, I would guess player rotation still applies, so just add your entity "behind" them?
If the rotation points "up" instead of "forward", you would just have to add/remove 90 to/from the pitch of that rotation
I don't understand what you are asking for there
Getting the npc's location it spawns the slime on the npc's leg, which is also were there hitbox is, is there a way to maybe find the rest of the body using that as an anchor point?
explain it without referencing other implementations
"calculating which side of a sign has had colors, dye, or ink sacs used on" does seem trivial without further information
i believe it's based on yaw of the entity, but I'm unsure, and no access to source code rn
Hmm alr, i'll play around with the code and see what I can do
I thought the other implementation was a good reference, but sure. Take PlayerInteractEvent for example, which most would have used to check whether a sign was being dyed before. If you now want to get the side on which you're using this, you need to do some math based on player vector and block facing to calculate this now, because both sides of the sign can be written on, and anyone wishing to do this is going to need to write their own logic.
Seems ideal to go in the API, and Paper seem to be adding it on that basis too
Spigot can't use paper's implementations, else you end up with a whole shebang of pain
We have to avoid looking at other implementations
oh, that I wasn't aware of
Even permission isn’t enough sadly
I don't remember the specifics
I'm curious why permission wouldn't be enough?
Just that it's a nono
The CLA says all code you submit must be your own
That's... very strange. So, if you collaborate on a code project with someone, you're required to submit it in both your names, even if the other person didn't want to be credited for it? I know this isn't the same situation, but surely if Paper gives Spigot permission to use their code without requiring credit it's roughly the same?
Pretty much
Wait I had to Google what a CLA was, and at first glance I thought it was something required for all GitHub contributions, but then other places are talking about adding a CLA to your project, so I can't tell if this is GitHub-wide or if this is specific to Spigot?
^
Whats the best way to store a Location as a string
Ah right, that makes a lot more sense, but then still surely Spigot themselves can choose to not enforce the CLA for a particular request? Like, they can't punish themselves (I realise Spigot isn't a "person" but idk how to properly word it)
best depends on where you are storing
sorry for not knowing the obvious r.e. other implementations, I've updated with a bit more detail
Yes but that defeats the entire purpose of it
The CLA is in place to prevent another DMCA
The spigot CLA is there to protect the project. Spigot enforces the CLA to prevent people from contibuting code, then DMCA claiming later.
Spigot likely wouldn't have a CLA if Bukkit didn't get hit with the DMCA.
But if you have permission from Paper, then why would there be a risk of DMCA?
no way to tell where teh code originated, just trust
Maybe if you had some kind of signed permission
But just someone saying it’s okay doesn’t mean that can’t change their mind later
config file
Location is ConfigurationSerializable
So long as you don;t access the config before worlds are loaded
you are safe
There’s even a convenient getLocation method
But if they changed their mind, wouldn't that change of mind only apply to additions made to Paper after their mind was changed? Cos otherwise wouldn't any "open-source" project be able to just "change their mind" about being open-source then just sue every company that used them?
Safer to have spigots own CLA and require signing for contributions
If it ain't in writing, it didn't happen.
lol I just watched a video about the DMCA of CraftBukkit and now im reading this channel
Cos otherwise wouldn't any "open-source" project be able to just "change their mind" about being open-source
That's exactly what lead to this in the first place
spigot needs to get built by BuildTools because it would be illegal to distribute compiled binaries of the vanilla server right?
Yes
separate-ish issue, but yes
I thought what lead to it was Bukkit distributing Minecraft's code, and I don't recall Minecraft ever being open-source (though it's been a while since I've looked into the Bukkit DMCA thing so I can't remember too much about it)
so what spigot does is containing the vanilla source code and compiling it because its legal to distribute the sourcecode itself?
BuildTools downloads the vanilla source from Mojang
and deobfuscates it?
isn't there a command that has an article explaining the dmca
those patches are basicly the source of spigot itself?
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
As I understand it, Mojang doesn't provide the source code, but they provide the compiled code and the mappings required to get the source code from that compiled code. But then, at that point aren't they pretty much just sharing the source code? Like, what's the point of the mappings instead of just providing the actual source? Law is confusing lol
Legality is nothing but a confusing mess, but it's their way of making it easier for us devs.
so Spigot is literally patching the vanilla software to include its changes as well as integrating the Bukkit API
Mhm
well, Spigot is patching CraftBukkit and Bukkit which is also maintained by the Spigot Team, and CraftBukkit is patching the Vanilla Server to integrate Bukkit
I understand Spigot not being able to re-host it, but surely Mojang themselves can? Like, they're intentionally making it easy for devs to reproduce the source, so why not just actually provide the source
why aren't we just applying code changes to CraftBukkit instead of patching CraftBukkit with Spigot?
but why isn't it all in craftbukkit
Idk, maybe obfuscating it helps prove their ownership
It also optimizes things a bit
Iirc some license issues
You’d have to ask MD more about that
md? are you here?
Oh I thought it was like CraftBukkit made no changes other than just opening up an API for developers, so running a Bukkit server without plugins was no different to running a vanilla server, then Spigot actually adds features to make the server more performant, secure or easy to maintain
No prey much everything Is in craftbukkit besides a few things
Don't use craftbukkit api though lol it still lacks features
I'm not saying to not obfuscate the compiled version, I'm just saying to provide a source version. Those shouldn't be mutually exclusive, surely?
Mostly components
MD on his way to not merge the components patch 
I thought Components was a Paper-exclusive thing lol
Ok I'm guessing that means it is
No
Spigot has components just not ok everything
different component types
And everything is behind a spigot interface
Ah
spigot has bungeechat components, while keeping all the string methods available, paper on the other hand
Eg. player.spigot().sendMessage
Spigot components only apply to chat messages and books atm
paper use adventure components, deprecating all spigot string methods
But there is an open PR to provide them for everything
I really just want md to merge choco pr already its done
and nms-patches under CraftBukkit does the magic and basicly patches CraftBukkit's bootstrappers and loaders into the vanilla software?
Mhm
Why can't all developers just be friends 😦
?
As in, not DMCA each other lol
(I'm kidding btw, I understand roughly why licencing is important, but it would be a lot easier if licensing just wasn't a thing)
Licensing is very important 
People love their IP
Speaking of which I've got your ip 192.168.0.12
my IP is 127.0.0.1
For Mojang it's especially important, cos they're a company and need to make a profit, which is a lot harder when people can just re-compile it for free, but between Spigot and Paper it's a bit more ehh, like I still understand why but ehh
No no not that IP
I think they realise lol
Hey, I'm trying to get into Mc Java development but I can't seem to get even the beginning stages right,
I'm following this tutorial: https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellij-idea/#wikiPage
and I can't seem to setup/find Spigot-API-shaded. Can anybody help?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Personally, I find it easier to use Maven (or Gradle/Ant), especially if you're already familiar with Java development
tf
There is also an IDEA plugin specifically for Minecraft development which setups up a lot of the project for you, but ofc it's good to get in the habit of doing this yourself to familiarise yourself with how it works
i don’t want a company like microsoft to take my library for example
abuse it, make money with it
and do all kinds of stuff
copyright and licensing is important
Is this also outdated? https://www.spigotmc.org/wiki/creating-a-plugin-with-maven-using-intellij-idea/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
That one is pretty spot on with how most people do it nowadays.
do you know java and what went wrong
we need an error
to help you
I'm just askin' for now, haven't tried using that one yet
hopper ima go sleep
As I said, I was kidding. I know it's important and I know why. I even specifically mentioned why it's important for commercial reasons. Just, I think a world where there was no need for licenses (not just without licenses, I mean where it wasn't necessary for everyone to be happy, like where we didn't have to worry about our code being abused) would be a much better one, both for devs and for end-users
licenses don’t only protect developers
but specific licenses can also protect the user
gpl, does just that
Like, a world where we didn't need laws to prevent people from murdering each other would probably be a very good one too
I don’t think laws prevent people from murdering eachother
you dont have a point hopper
you’re clearly saying this cause you don’t wanna comply to licenses
right?
Do you think I want to murder people too? 🤨
@young knoll it’s like saying i wish we didn’t need laws that prohibit murder
ok?
do you wanna murder people
... no
Maybe
a license is an agreement, that way everyone is happy
you don’t agree
don’t use it
i can’t imagine a world without licensing and copyright
although that wasn’t too long ago
My whole point is that I wish we didn't have to rely on laws to reduce (maybe prevent was a poor word) murder. If we didn't have laws, the world would be complete chaos and that wouldn't be good. However, in a world where there wasn't chaos without laws (like, humans somehow just inately knew what other humans were ok with and whether it was worth doing something someone wasn't ok with for a positive net benefit, and would also always do what's best), then laws wouldn't be necessary, and life would be a lot easier. Sadly, though, humans aren't perfect, so we do need laws to keep the world in order. For the same reason, we do need licenses, but if we didn't it would definitely be easier
Like, if I said the world would be easier if we didn't need to sleep, that's not me saying that we should all just stop sleeping and that I don't want to comply with my wish to sleep, I'm just saying I would quite like an extra 8 free hours every day lol
How did we get here lol
laws could be improved a lot
laws are one of the most important things to be improved tho
Ye, but the net benefit is still positive
omfg I hate tracking some object in a video manually
tracking cannot be done automaticly sadly
it takes like 10 minutes to track an object that is in sight for 10 seconds
Why are you needing to do it manually? It still takes a bit of time to do it automatically, but it's definitely quicker than doing it completely manually
idk how it works automaticly
Which editor you using?
but heck its a figure in a video game which I had to track my self-animated loading circle on
davinci resolve
If you're applying visual effects to it, use the tracker in the Color tab. If you're adding text or a sprite or tracking it with the camera, use one of the several trackers in the Fusion tab
im applying a fusion comp
but the atmosphere in the game especially is very tinted and same-colored, thats why I doubt any AI would be capable of fully tracking the head of the figure
im really new into learning video editing. I really like it, but its very very hard to get into
You can make it track in B&W so the color won't matter, as long as there is a noticable difference in brightness
I wanna try this out now. How does it work with a fusion comp?
I've not tried to Studio version, so if you're using that you might have a better chance with one of the Studio trackers, but usually it's the planar tracker you need
I am using the free version
Then you find a frame where the object you want to track is clearest, draw around that object, extend the outer box so that it covers the maximum distance it should reasonably travel in a single frame, set the starting frame and use the video player like buttons to track forwards/backwards until it tracks everywhere you need that tracking information. You can then apply that planar transform onto the loading circle
If you don't get a good result, you can manually adjust individual frames and have it do everything inbetween automatically and there's plenty of other options you can change to limit it to only the information it should require to find the object (such as the B&W one I mentioned earlier)
where even is the planar tracker
I think just Add > Tracking > Planar Tracker
Lemme open up Resolve lol, I'm just going based off memory rn
alright
I'll move into #general
okay
any of yall know why i get cannot cast CraftZombie to player? its for this bit of code java if (config.getBoolean("freeze-command.negate-attack")) { // this is the line it errors if (event.getDamager() instanceof Player player){ if (frozenDict.get(player.getUniqueId()) != null) { event.setCancelled(true); } } }
A zombie isn't a player, and besides that's supposedly not even the line that's erroring?
Ye, in which case it's not the casting causing the error (which it wouldn't cos you're only casting if it's actually cast-able i.e. instanceof Player)
Show the actual error
But you can only cast something to something else if it's an instance of that something else. A zombie is not an instance of a player, so you wouldn't be able to cast it
at me.alecjensen.generalutils.commands.FreezeCommand.EntityDamageByEntityEvent(FreezeCommand.java:83) ~[generalutils-0.2.1-all.jar:?]```
Ye I assure you that the first line won't be line 83, you aren't trying to cast on that line
Make sure the code on your server is up to date
it is
It's either that or you're mis-reading the line numbers
Is there a method that lets the server run a command for a player? (Nvm I think player.chat() can do it)
heres the whole function im not casting anywhere ```java
@EventHandler
public void EntityDamageByEntityEvent(EntityDamageByEntityEvent event) {
if (config.getBoolean("freeze-command.negate-damage")) {
if (frozenPlayers.get(event.getEntity().getUniqueId()) != null) {
event.setCancelled(true);
if (event.getDamager() instanceof Player attacker) {
attacker.sendMessage(ChatColor.RED + "This player is frozen!");
}
}
}
if (config.getBoolean("freeze-command.negate-attack")) {
if (frozenPlayers.get(event.getDamager().getUniqueId()) != null) {
event.setCancelled(true);
}
}
}```
Player.performCommand()
Would player.chat("/home") technically still work
Don't think so, and it's still better to use the dedicated commands
Oh fair enough
frozenPlayers.get(event.getDamager().getUniqueId())
I'm guessing frozenPlayers is aMap<Player, ...>, meaning this will beget(Player), meaning it must try to castevent.getDamager().getUniqueId()toPlayerin order to run the function, but you're not checking ifevent.getDamager().getUniqueId()is actually an instance ofPlayer(in fact, it won't be, it'll be an instance ofUUID) so this produces the error
its HashMap<UUID, Boolean>
It wouldn’t cast like that anyway
Hiii, I was wondering if I could add a custom villager profession, and use a resource pack to change it's look
?paste
Does this code run on the main thread? https://paste.md-5.net/ehocajuvet.cs
Oh
.get blocks until it’s finished
You need something like .thenAccept or .whenComplete
Is this correct now?
Method: https://paste.md-5.net/tawuvahufa.cs
Impl: https://paste.md-5.net/dahasedowe.js
The builder will be empty when your return runs
Really? I tested it out and its working
damn what do i change other then removing #join
Sorry for the questions but I dont understand the topic too well
how do i add metadata directly to an item from a string? kinda like minecraft's /give system (example: /give (player) (item){metadata})
the only way I have found is by using Bukkit.getUnsafe().modifyItemStack on an existing item stack
but if anyone has a better idea, please let me know too xD
You can use setItemMeta, something like below.
ItemStack item = new ItemStack(Material.PAPER);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("Back");
item.setItemMeta(meta);
Bukkit.getItemFactory().createItemStack(input)
i tried that but its so hard to actually store the itemmeta
cuz im accessing it from a string
🥵
ooooo
Some might be paper specific
Does give me some ideas tho
uwu
Does PlaceholderAPI support returning placeholders async?
I am using completable futures
How can I check if a given Block is Attachable? I'm stuck, cos all the implementing classes for Attachable are deprecated in support of BlockData and none of the implementing classes of BlockData implement Attachable, which seems to suggest Attachable is useless but then why isn't it itself deprecated and what can I use instead?
Hangable
Hangable only includes Lantern and MangrovePropagule- I need to check for any block which requires another block for support, such as torches, signs, chorus fruit, ladders...
Pretty sure I went over this before
Hm?
yeah around here
Some materials are directly Hangable, see the Material docs
Not sure what you mean, sorry
list.add(entityPlayer?.uuid!!)
connection.send(ClientboundPlayerInfoRemovePacket(list))
connection.send(ClientboundRemoveEntitiesPacket(getEntityID()))``` I'm using this to send a removal packet, but it isnt working and isnt removing npcs, anybody know why?
Is inventory.firstEmpty() being null the best way to check if a player's inventory is full?
It's not a perfect solution as it only compares empty slots. Ideally you'd want to check if the item you want to add is compatible with existing stacks in the inventory.
You might be able to do that with Inventory#addItem(), but I haven't tested that myself.
I do inventory.addItem(items) but it completely deletes the given item when the player's inventory is full
That's shouldn't be possible. #addItem() only adds items. It can't remove any existing ones.
No, it doesn't give the item if the inventory has no space for it
Well, that's to be expected... If the inventory is actually full, meaning all slots filled and the item they are trying to pickup doesn't match any existing slots or all existing slots that match are full, how could it add the item?
Is there any way to check so I can drop the item at their location instead of adding it to the inventory?
Yes, according to the docs, #addItem() does return a HashMap of any item that it couldn't add. So just check if the map is empty and if it's not, iterate over it and spawn the items.
How is block breaking damage stored on bedrock compared to java?
is the integer value just the amount of total items or the amount in the stack
The integer is the slot number. The itemstack itself should contain the amount.
It is saying that I can't iterate through a HashMap
Ok
If you need both, there's a weird thing where you have to iterate over Map.Entry<K,V>
WHY THE FYCK WILL IT NOT LET ME SEND IT
[20:53:00 INFO]: [FancyBrewersPlugin] Enabling FancyBrewersPlugin v1.0-SNAPSHOT
[20:53:00 ERROR]: Error occurred while enabling FancyBrewersPlugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.NoClassDefFoundError: com/mongodb/xxx/mongodb/MongoClient
at net.tonepvp.fancybrewers.FancyBrewersPlugin.onEnable(FancyBrewersPlugin.java:51) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_371]
Caused by: java.lang.ClassNotFoundException: com.mongodb.xxx.mongodb.MongoClient
there
ew 1.8
Map<String, Integer> myMap = new HashMap<>();
for (Map.Entry<String, Integer> entry : myMap.entrySet()) {
entry.getKey();
entry.getValue();
}
That's how you can iterate over the entry set if you need both values. Weird formatting, but apparently you gotta be specific.
There's probably some lambda equivalent, but I'm not good with streams.
could anyone help?
so basically you to shade the mongo jar in
i fucking tried
dame bro
nice embed fail tone broski
this is why your mother doesnt love you tk
Hi
String result = PlaceholderAPI.setPlaceholders(p, "%essentials_is_teleport_enabled%");
if (result.equalsIgnoreCase("yes")) {
return true;
} else {
return false;
}
why i never got true?
Hey guys, is there a way to remove enchantment restrictions without manually getting the event and doing all the math to choose enchantments and levels?
Cause i need that to work with everything related to enchanting, like anvils, enchanting tables and villagers
Does anyone here know if you can create a resource pack with multiple skins for a single entity, and depending on the NBT data inside the entity it chooses the skin to pick from?
How can I spawn a Village with my plugin?
default is yes, no
hey guys, just a quick question
how can i detect if a gliding player is being boosted by fireworks
eg: something like this:
if (player.isGliding() && !player.isBoosting())
??
thanks guys!!
trying to prevent this
does anyone here happen to be very familiar with custom resource pack models and can tell me exactly how the origin of a model works?
I think it's limited to -16 to +32 but I don't really see it moving
What's the program u using to move it
or do you just edit the json
?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.
Oh found it
all good guys, thanks anyway, i found the solution :)
No I want to display it on the web
Hi, how can I use bungeecord to put a skin on a player?
And using it on lobby bungeecord
bungeecord
Yes
So lobby is a spigot?
The proxy no
Hub*
But I want to do it under bungeecord
So u making a bungeecord plugin?
Yes
Proxy - bungeecord
Hub - spigot
Other server - spigot
To what server you're making plugin
Proxy
Server name: "SpigotMC"
But how do you want to put the skin on player if you use proxy to do it
Proxy is just connection, there's no player or world in it
It just forwards you to lobby
You would need to do a spigot plugin and put it in all you're servers (beside proxy)
I tried to do it with SkinRestorer but it can't find the url and I don't understand how to do it.
Where?
What url
I'd like it if when you join the proxy it would put a skin with the SkinsRestorer api except that I don't know how to put a skin that is attributed by a url.
Now make that spigot and add it to lobby
Okay, but I still don't know how to do it
Learn spigot
On player server join -> get player, get textures, apply textures to player, done
Player player = event.GetPlayer();
String skinUrl = "https://zone-delta.xyz/api/skin-api/skins/" + player.getName();
//SkinData skinData = new SkinData(skinUrl);
try {
//ZoneDelta_Bungee.getSkinsRestorerAPI().setSkin(player.getName(), "https://zone-delta.fr/api/skin-api/skins/" + player.getName());
main.applySkin(playerWrapper, skinUrl);
} catch (SkinRequestException e) {
throw new RuntimeException(e);
}
System.out.println(player + " +++ " + skinUrl);
Just changed the ProxiedPlayer to Player
You cant do anything to player in proxy cuz THERES NO WORLD IN PROXY
Also the skin doesn't replicate to lobby
I programmed my own program for it
Work harder not harder👍
I'm pretty sure theres free programs
Like blockbench
It also has web version
Did you even try if the program works
there are no programs that do what I want to do and are free
What do you want to do
control models via api in-game in spigot servers for free and under a gplv3 license
Control models via API?
that's what I said